Core/Auras: Fixed SPELLMOD_DOT not being applied
Closes #14817 Signed-off-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
1 parent
08b8dd10d1
commit
198ffba5ee
2 files changed
+24
-10
No files matched your search
@@ -9949,11 +9949,15 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
|||||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
|
float tmpDamage = float(int32(pdamage) + DoneTotal);
|
||||||
float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype));
|
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicDamageAurasTick.
|
||||||
// apply spellmod to Done damage (flat and pct)
|
if (damagetype != DOT)
|
||||||
if (Player* modOwner = GetSpellModOwner())
|
{
|
||||||
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage);
|
tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype);
|
||||||
|
// apply spellmod to Done damage (flat and pct)
|
||||||
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
|
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage);
|
||||||
|
}
|
||||||
|
|
||||||
return uint32(std::max(tmpDamage, 0.0f));
|
return uint32(std::max(tmpDamage, 0.0f));
|
||||||
}
|
}
|
||||||
@@ -10793,11 +10797,15 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
|||||||
DoneTotal = 0;
|
DoneTotal = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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);
|
||||||
float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto));
|
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicHealAurasTick.
|
||||||
// apply spellmod to Done amount
|
if (damagetype != DOT)
|
||||||
if (Player* modOwner = GetSpellModOwner())
|
{
|
||||||
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal);
|
heal *= SpellHealingPctDone(victim, spellProto);
|
||||||
|
// apply spellmod to Done amount
|
||||||
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
|
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, heal);
|
||||||
|
}
|
||||||
|
|
||||||
return uint32(std::max(heal, 0.0f));
|
return uint32(std::max(heal, 0.0f));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5845,6 +5845,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
|||||||
else
|
else
|
||||||
damage = std::max(int32(damage * GetDonePct()), 0);
|
damage = std::max(int32(damage * GetDonePct()), 0);
|
||||||
|
|
||||||
|
if (Player* modOwner = caster->GetSpellModOwner())
|
||||||
|
modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage);
|
||||||
|
|
||||||
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
||||||
|
|
||||||
// Calculate armor mitigation
|
// Calculate armor mitigation
|
||||||
@@ -6148,6 +6151,9 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
|||||||
else
|
else
|
||||||
damage = std::max(int32(damage * GetDonePct()), 0);
|
damage = std::max(int32(damage * GetDonePct()), 0);
|
||||||
|
|
||||||
|
if (Player* modOwner = caster->GetSpellModOwner())
|
||||||
|
modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage);
|
||||||
|
|
||||||
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user