Quantcast

Account for damage-multiplier auras that stack.

Johnny C. Lam [10-19-13 - 07:53]
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
Filename
OvaleFuture.lua
OvaleState.lua
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