mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +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
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1431,8 +1431,7 @@ void Aura::TriggerSpell()
|
|||
case 23493:
|
||||
{
|
||||
int32 heal = caster->GetMaxHealth() / 10;
|
||||
caster->ModifyHealth( heal );
|
||||
caster->SendHealSpellLog(caster, 23493, heal);
|
||||
caster->DealHeal(caster, heal, auraSpellInfo);
|
||||
|
||||
int32 mana = caster->GetMaxPower(POWER_MANA);
|
||||
if (mana)
|
||||
|
|
@ -5876,10 +5875,8 @@ void Aura::PeriodicTick()
|
|||
|
||||
uint32 heal = pCaster->SpellHealingBonus(pCaster, spellProto, uint32(new_damage * multiplier), DOT, stackAmount);
|
||||
|
||||
int32 gain = pCaster->ModifyHealth(heal);
|
||||
int32 gain = pCaster->DealHeal(pCaster, heal, spellProto);
|
||||
pCaster->getHostilRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
|
||||
|
||||
pCaster->SendHealSpellLog(pCaster, spellProto->Id, heal);
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_PERIODIC_HEAL:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -7423,6 +7423,21 @@ void Unit::UnsummonAllTotems()
|
|||
}
|
||||
}
|
||||
|
||||
int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical)
|
||||
{
|
||||
int32 gain = pVictim->ModifyHealth(int32(addhealth));
|
||||
|
||||
if (GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
SendHealSpellLog(pVictim, spellProto->Id, addhealth, critical);
|
||||
|
||||
if (BattleGround *bg = ((Player*)this)->GetBattleGround())
|
||||
bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain);
|
||||
}
|
||||
|
||||
return gain;
|
||||
}
|
||||
|
||||
Unit* Unit::SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo)
|
||||
{
|
||||
if(!victim)
|
||||
|
|
|
|||
|
|
@ -952,6 +952,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss);
|
||||
int32 DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical = false);
|
||||
|
||||
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL);
|
||||
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage );
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7700"
|
||||
#define REVISION_NR "7701"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue