diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ef96f53f4..394621bf2 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6298,6 +6298,13 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const // ignore non positive values (can be result apply spellmods to aura damage uint32 damage = std::max(GetAmount(), 0); + // If the damage is percent-max-health based, calculate damage before the Modify hook + if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE_PERCENT) + { + // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner + damage = uint32(std::ceil(CalculatePct(target->GetMaxHealth(), damage))); + } + // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo()); @@ -6329,8 +6336,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const // 5..8 ticks have normal tick damage } } - else // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner - damage = uint32(std::ceil(CalculatePct(target->GetMaxHealth(), damage))); // calculate crit chance bool crit = false;