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:
@@ -938,6 +938,12 @@ namespace Game.Spells
|
|||||||
float healMultiplier = effectInfo.CalcValueMultiplier(unitCaster, this);
|
float healMultiplier = effectInfo.CalcValueMultiplier(unitCaster, this);
|
||||||
|
|
||||||
m_damage += damage;
|
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
|
// get max possible damage, don't count overkill for heal
|
||||||
uint healthGain = (uint)(-unitTarget.GetHealthGain(-damage) * healMultiplier);
|
uint healthGain = (uint)(-unitTarget.GetHealthGain(-damage) * healMultiplier);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user