Skip to content

Commit 198ffba

Browse files
robinschShauren
authored andcommitted
Core/Auras: Fixed SPELLMOD_DOT not being applied
Closes #14817 Signed-off-by: Shauren <shauren.trinity@gmail.com>
1 parent 08b8dd1 commit 198ffba

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9949,11 +9949,15 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
99499949
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
99509950
}
99519951

9952-
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
9953-
float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype));
9954-
// apply spellmod to Done damage (flat and pct)
9955-
if (Player* modOwner = GetSpellModOwner())
9956-
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage);
9952+
float tmpDamage = float(int32(pdamage) + DoneTotal);
9953+
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicDamageAurasTick.
9954+
if (damagetype != DOT)
9955+
{
9956+
tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype);
9957+
// apply spellmod to Done damage (flat and pct)
9958+
if (Player* modOwner = GetSpellModOwner())
9959+
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage);
9960+
}
99579961

99589962
return uint32(std::max(tmpDamage, 0.0f));
99599963
}
@@ -10793,11 +10797,15 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
1079310797
DoneTotal = 0;
1079410798
}
1079510799

10796-
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
10797-
float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto));
10798-
// apply spellmod to Done amount
10799-
if (Player* modOwner = GetSpellModOwner())
10800-
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal);
10800+
float heal = float(int32(healamount) + DoneTotal);
10801+
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicHealAurasTick.
10802+
if (damagetype != DOT)
10803+
{
10804+
heal *= SpellHealingPctDone(victim, spellProto);
10805+
// apply spellmod to Done amount
10806+
if (Player* modOwner = GetSpellModOwner())
10807+
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, heal);
10808+
}
1080110809

1080210810
return uint32(std::max(heal, 0.0f));
1080310811
}

src/server/game/Spells/Auras/SpellAuraEffects.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5845,6 +5845,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
58455845
else
58465846
damage = std::max(int32(damage * GetDonePct()), 0);
58475847

5848+
if (Player* modOwner = caster->GetSpellModOwner())
5849+
modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage);
5850+
58485851
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
58495852

58505853
// Calculate armor mitigation
@@ -6148,6 +6151,9 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
61486151
else
61496152
damage = std::max(int32(damage * GetDonePct()), 0);
61506153

6154+
if (Player* modOwner = caster->GetSpellModOwner())
6155+
modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage);
6156+
61516157
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
61526158
}
61536159

0 commit comments

Comments
 (0)