Quantcast

Fix bug with SpellDamageBuff() information not being applied to DoTs.

Johnny C. Lam [09-06-13 - 02:47]
Fix bug with SpellDamageBuff() information not being applied to DoTs.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1017 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
OvaleCondition.lua
OvaleState.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index a7a63d5..f5338fc 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -151,6 +151,8 @@ local function UnitGainedAura(guid, spellId, filter, casterGUID, icon, count, de
 					Ovale:DebugPrintf(OVALE_AURA_DEBUG, "    Snapshot stats for %s %s (%s) on %s from %f, now=%f, aura.serial=%d",
 						filter, name, spellId, guid, lastSpellcast.snapshotTime, Ovale.now, aura.serial)
 					OvalePaperDoll:SnapshotStats(aura, Ovale.lastSpellcast)
+					-- TODO: This isn't correct if lastSpellId doesn't directly apply the DoT.
+					aura.damageMultiplier = Ovale.lastSpellcast.damageMultiplier
 				end
 			end
 		end
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 836c101..3dd3136 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -1383,8 +1383,9 @@ OvaleCondition.conditions.damage = function(condition)
 		local sp = OvalePaperDoll.stat.spellBonusDamage
 		local mh = OvalePaperDoll.stat.mainHandWeaponDamage
 		local oh = OvalePaperDoll.stat.offHandWeaponDamage
+		local bdm = OvalePaperDoll.stat.baseDamageMultiplier
 		local dm = OvaleState:GetDamageMultiplier(spellId)
-		return 0, nil, OvaleData:GetDamage(spellId, ap, sp, mh, oh, combo) * dm, 0, 0
+		return 0, nil, OvaleData:GetDamage(spellId, ap, sp, mh, oh, combo) * bdm * dm, 0, 0
 	end
 end

@@ -1400,7 +1401,10 @@ end
 --     Spell(rupture)

 OvaleCondition.conditions.damagemultiplier = function(condition)
-	return 0, nil, OvaleState:GetDamageMultiplier(condition[1]), 0, 0
+	local spellId = condition[1]
+	local bdm = OvalePaperDoll.stat.baseDamageMultiplier
+	local dm = OvaleState:GetDamageMultiplier(spellId)
+	return 0, nil, bdm * dm, 0, 0
 end

 --- Get the damage taken by the player in the previous time interval.
diff --git a/OvaleState.lua b/OvaleState.lua
index edba394..f109365 100644
--- a/OvaleState.lua
+++ b/OvaleState.lua
@@ -656,7 +656,7 @@ function OvaleState:NewAura(guid, spellId, filter)
 end

 function OvaleState:GetDamageMultiplier(spellId)
-	local damageMultiplier = OvalePaperDoll.stat.baseDamageMultiplier
+	local damageMultiplier = 1
 	if spellId then
 		local si = OvaleData.spellInfo[spellId]
 		if si and si.damageAura then