From 753faaeee1992b4a51d7e0c13a4a17a996ead186 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 7 Dec 2021 20:46:01 -0500 Subject: [PATCH] Core/Spells: Fix spells with Health Leech effect, now check damage absorb when calculate Heal Port From (https://github.com/TrinityCore/TrinityCore/commit/9752ef4d6ea311acb6a60317c270cb5c053f951d) --- Source/Game/Spells/SpellEffects.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index c49fe1c47..b9a347709 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -938,6 +938,12 @@ namespace Game.Spells float healMultiplier = effectInfo.CalcValueMultiplier(unitCaster, this); m_damage += damage; + + DamageInfo damageInfo = new(unitCaster, unitTarget, (uint)damage, m_spellInfo, m_spellInfo.GetSchoolMask(), DamageEffectType.Direct, WeaponAttackType.BaseAttack); + Unit.CalcAbsorbResist(damageInfo); + uint absorb = damageInfo.GetAbsorb(); + damage -= (int)absorb; + // get max possible damage, don't count overkill for heal uint healthGain = (uint)(-unitTarget.GetHealthGain(-damage) * healMultiplier);