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

Closes: #23311
(cherry picked from commit ad89472fe3512b4a5f4160240154fd5b11a3b07c)
This commit is contained in:
Gildor
2021-12-07 00:31:48 +01:00
committed by Shauren
parent 6034992dff
commit 9752ef4d6e
+6
View File
@@ -1274,6 +1274,12 @@ void Spell::EffectHealthLeech()
float healMultiplier = effectInfo->CalcValueMultiplier(unitCaster, this);
m_damage += damage;
DamageInfo damageInfo(unitCaster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);
Unit::CalcAbsorbResist(damageInfo);
uint32 const absorb = damageInfo.GetAbsorb();
damage -= absorb;
// get max possible damage, don't count overkill for heal
uint32 healthGain = uint32(-unitTarget->GetHealthGain(-damage) * healMultiplier);