Core/Spell: Fixed irregular handling of SPELLMOD_DOT

This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 02:15:54 +01:00
1 parent 31b1b42b07
commit a6c7f2b98c
4 files changed
+42 -23

No files matched your search

+16 -12
View File
@@ -6692,14 +6692,16 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
float tmpDamage = (int32(pdamage) + DoneTotal);
// DOTs calculated in AuraEffect::PeriodicDamageAurasTick
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype));
// apply spellmod to Done damage (flat and pct)
if (Player* modOwner = GetSpellModOwner())
if (damagetype != DOT)
{
if (damagetype == DOT)
modOwner->ApplySpellMod<SPELLMOD_DOT>(spellProto->Id, tmpDamage);
else
tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype);
// apply spellmod to Done damage (flat and pct)
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod<SPELLMOD_DAMAGE>(spellProto->Id, tmpDamage);
}
@@ -7408,14 +7410,16 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
DoneTotal = 0;
}
float heal = float(int32(healamount) + DoneTotal);
// DOTs calculated in AuraEffect::HandlePeriodicHealAurasTick
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto));
// apply spellmod to Done amount
if (Player* modOwner = GetSpellModOwner())
if (damagetype != DOT)
{
if (damagetype == DOT)
modOwner->ApplySpellMod<SPELLMOD_DOT>(spellProto->Id, heal);
else
heal *= SpellHealingPctDone(victim, spellProto);
// apply spellmod to Done amount
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod<SPELLMOD_DAMAGE>(spellProto->Id, heal);
}