Core/Spells: Fix spells with Health Leech effect, now check damage absorb when calculate Heal

Port From (https://github.com/TrinityCore/TrinityCore/commit/9752ef4d6ea311acb6a60317c270cb5c053f951d)
This commit is contained in:
hondacrx
2021-12-07 20:46:01 -05:00
parent 5081e1aa69
commit 753faaeee1
+6
View File
@@ -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);