fix(Scripts/Spells): apply healing modifiers on paladin Lay On Hands (#23861)

This commit is contained in:
Blaiseum
2025-11-29 06:51:44 +01:00
committed by GitHub
parent e6e6c6289e
commit 966c522c1d

View File

@@ -961,6 +961,24 @@ class spell_pal_lay_on_hands : public SpellScript
return true;
}
void HandleMaxHealthHeal(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetExplTargetUnit();
if (!target || !caster)
return;
uint32 baseHeal = caster->GetMaxHealth();
uint32 modifiedHeal = target->SpellHealingBonusTaken(caster, GetSpellInfo(), baseHeal, HEAL);
// EffectHealMaxHealth() ignores healing modifiers, so we pre-apply the
// difference here; this delta will be added on top of the raw heal.
int64 healAdjustment = int64(modifiedHeal) - int64(baseHeal);
SetHitHeal(healAdjustment);
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
@@ -1000,6 +1018,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::HandleMaxHealthHeal, EFFECT_0, SPELL_EFFECT_HEAL_MAX_HEALTH);
}
int32 _manaAmount;