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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user