Skip to content

Commit

Permalink
[8953] Apply spell mutiplier to final damage for health calculation i…
Browse files Browse the repository at this point in the history
…n Spell::EffectHealthLeech.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
Quriq14 authored and VladimirMangos committed Dec 8, 2009
1 parent b36712e commit ef6e30f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2776,21 +2776,21 @@ void Spell::EffectHealthLeech(uint32 i)

sLog.outDebug("HealthLeech :%i", damage);

uint32 curHealth = unitTarget->GetHealth();
damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage );
if (curHealth < damage)
damage = curHealth;

float multiplier = m_spellInfo->EffectMultipleValue[i];

if (Player *modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);

int32 new_damage = int32(damage*multiplier);
uint32 curHealth = unitTarget->GetHealth();
new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage );
if (curHealth < new_damage)
new_damage = curHealth;

uint32 heal = uint32(damage*multiplier);
if (m_caster->isAlive())
{
new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL);
m_caster->DealHeal(m_caster, uint32(new_damage), m_spellInfo);
heal = m_caster->SpellHealingBonus(m_caster, m_spellInfo, heal, HEAL);
m_caster->DealHeal(m_caster, heal, m_spellInfo);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8952"
#define REVISION_NR "8953"
#endif // __REVISION_NR_H__

0 comments on commit ef6e30f

Please sign in to comment.