diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 62389db5b..0acf87cb2 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -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;