From 8f72e5032a0ec76a1bfc7ed39933d86c9c42ff85 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 19 Oct 2013 07:53:47 +0000 Subject: [PATCH] Account for damage-multiplier auras that stack. An aura whose effect stacks can set "stacking=1" in a SpellInfo declaration. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1075 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleFuture.lua | 6 ++++-- OvaleState.lua | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OvaleFuture.lua b/OvaleFuture.lua index dc0be41..56ca152 100644 --- a/OvaleFuture.lua +++ b/OvaleFuture.lua @@ -111,8 +111,10 @@ local function GetDamageMultiplier(spellId) for auraSpellId, multiplier in pairs(auraList) do local count = select(3, OvaleAura:GetAuraByGUID(playerGUID, auraSpellId, filter, nil, "player")) if count and count > 0 then - -- TODO: Try to account for a stacking aura. - -- multiplier = 1 + (multiplier - 1) * count + local auraSpellInfo = OvaleData.spellInfo[auraSpellId] + if auraSpellInfo.stacking and auraSpellInfo.stacking > 0 then + multiplier = 1 + (multiplier - 1) * count + end damageMultiplier = damageMultiplier * multiplier end end diff --git a/OvaleState.lua b/OvaleState.lua index d32aeda..d8bcf1b 100644 --- a/OvaleState.lua +++ b/OvaleState.lua @@ -738,8 +738,10 @@ function OvaleState:GetDamageMultiplier(spellId) for auraSpellId, multiplier in pairs(auraList) do local count = select(3, self:GetAuraByGUID(playerGUID, auraSpellId, filter, nil, "player")) if count and count > 0 then - -- TODO: Try to account for a stacking aura. - -- multiplier = 1 + (multiplier - 1) * count + local auraSpellInfo = OvaleData.spellInfo[auraSpellId] + if auraSpellInfo.stacking and auraSpellInfo.stacking > 0 then + multiplier = 1 + (multiplier - 1) * count + end damageMultiplier = damageMultiplier * multiplier end end -- 1.7.9.5