[8941] Limit used energe as expected for spell 22568 and ranks.

Thanks also to Sarjuuk for code simplification.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Nick Nitro 2009-12-07 18:05:38 +03:00 committed by VladimirMangos
parent 1f7163f449
commit 65f1d6ba14
2 changed files with 6 additions and 4 deletions

View file

@ -515,12 +515,14 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
// Ferocious Bite
if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000800000)) && m_spellInfo->SpellVisual[0]==6587)
{
// converts each extra point of energy into ($f1+$AP/410) additional damage
// converts up to 30 points of energy into ($f1+$AP/410) additional damage
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
float multiple = ap / 410 + m_spellInfo->DmgMultiplier[effect_idx];
damage += int32(m_caster->GetPower(POWER_ENERGY) * multiple);
damage += int32(((Player*)m_caster)->GetComboPoints() * ap * 7 / 100);
m_caster->SetPower(POWER_ENERGY,0);
uint32 energy = m_caster->GetPower(POWER_ENERGY);
uint32 used_energy = energy > 30 ? 30 : energy;
damage += int32(used_energy * multiple);
m_caster->SetPower(POWER_ENERGY,energy-used_energy);
}
// Rake
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellInfo->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8940"
#define REVISION_NR "8941"
#endif // __REVISION_NR_H__