[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

@ -2504,14 +2504,8 @@ void Spell::EffectHealPct( uint32 /*i*/ )
if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DAMAGE, addhealth, this);
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, false);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo);
unitTarget->getHostilRefManager().threatAssist(m_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);
}
}
@ -2528,8 +2522,7 @@ void Spell::EffectHealMechanical( uint32 /*i*/ )
return;
uint32 addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, uint32(damage), HEAL);
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, false);
unitTarget->ModifyHealth( int32(damage) );
caster->DealHeal(unitTarget, addhealth, m_spellInfo);
}
}
@ -2559,11 +2552,7 @@ void Spell::EffectHealthLeech(uint32 i)
if(m_caster->isAlive())
{
new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL);
m_caster->ModifyHealth(new_damage);
if(m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->SendHealSpellLog(m_caster, m_spellInfo->Id, uint32(new_damage));
m_caster->DealHeal(m_caster, uint32(new_damage), m_spellInfo);
}
// m_healthLeech+=tmpvalue;
// m_damage+=new_damage;