mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7701] Move explicit healing repeating code to DealHeal functions.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
adf9eb942d
commit
7c0201f834
6 changed files with 24 additions and 31 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue