Merge d15f91f11ebadc408633e3f09eeea2caa9d03b52 into f6c4164765afe447476114e632ee3d70b04a1777

This commit is contained in:
Paul 2025-02-20 08:52:41 +03:00 committed by GitHub
commit d47c075aaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -964,6 +964,20 @@ class spell_pal_lay_on_hands : public SpellScript
return true;
}
// Handling of healing percentage modifiers
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
{
float modifier = 1.0f;
for (AuraEffect* aurEff : target->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_PCT))
modifier *= (1.0f + aurEff->GetAmount() / 100.0f);
for (AuraEffect* aurEff : target->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT))
modifier *= (1.0f + aurEff->GetAmount() / 100.0f);
SetHitHeal(-(target->GetMaxHealth() * (1 - modifier)));
}
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
@ -1003,6 +1017,7 @@ class spell_pal_lay_on_hands : public SpellScript
{
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands::CheckCast);
AfterHit += SpellHitFn(spell_pal_lay_on_hands::HandleScript);
OnEffectHitTarget += SpellEffectFn(spell_pal_lay_on_hands::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL_MAX_HEALTH);
}
int32 _manaAmount;