[10475] Implement SPELL_AURA_HEAL_ABSORB (301)

Used for example in spells 66237 and 70659.

Also rename CalculateAbsorbAndResist -> CalculateDamageAbsorbAndResist
This commit is contained in:
VladimirMangos 2010-09-12 02:38:29 +04:00
parent ae53d49352
commit 84a915e1b1
9 changed files with 112 additions and 28 deletions

View file

@ -1010,13 +1010,17 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
else
procEx |= PROC_EX_NORMAL_HIT;
uint32 absorb = 0;
unitTarget->CalculateHealAbsorb(addhealth, &absorb);
addhealth -= absorb;
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
{
caster->ProcDamageAndSpell(unitTarget, real_caster ? procAttacker : PROC_FLAG_NONE, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
}
int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo, crit);
int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo, crit, absorb);
if (real_caster)
unitTarget->getHostileRefManager().threatAssist(real_caster, float(gain) * 0.5f, m_spellInfo);
@ -3291,7 +3295,11 @@ void Spell::finish(bool ok)
// Heal caster for all health leech from all targets
if (m_healthLeech)
m_caster->DealHeal(m_caster, uint32(m_healthLeech), m_spellInfo);
{
uint32 absorb = 0;
m_caster->CalculateHealAbsorb(uint32(m_healthLeech), &absorb);
m_caster->DealHeal(m_caster, uint32(m_healthLeech) - absorb, m_spellInfo, false, absorb);
}
if (IsMeleeAttackResetSpell())
{