[7701] Move explicit healing repeating code to DealHeal functions.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Trazom 2009-04-23 04:51:49 +04:00 committed by VladimirMangos
parent adf9eb942d
commit 7c0201f834
6 changed files with 24 additions and 31 deletions

View file

@ -1040,18 +1040,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
else
procEx |= PROC_EX_NORMAL_HIT;
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, crit);
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo, crit);
unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
if(caster->GetTypeId()==TYPEID_PLAYER)
if(BattleGround *bg = ((Player*)caster)->GetBattleGround())
bg->UpdatePlayerScore(((Player*)caster), SCORE_HEALING_DONE, gain);
}
// Do damage and triggers
else if (m_damage)
@ -2776,10 +2770,7 @@ void Spell::finish(bool ok)
// Heal caster for all health leech from all targets
if (m_healthLeech)
{
m_caster->ModifyHealth(m_healthLeech);
m_caster->SendHealSpellLog(m_caster, m_spellInfo->Id, uint32(m_healthLeech));
}
m_caster->DealHeal(m_caster, uint32(m_healthLeech), m_spellInfo);
if (IsMeleeAttackResetSpell())
{