[7789] Fixed mana gain from spell effect EffectDestroyAllTotems.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
Maxxie 2009-05-06 13:18:44 +02:00 committed by ApoC
parent 54f29f7138
commit 4c29782d66
2 changed files with 8 additions and 5 deletions

View file

@ -6155,7 +6155,7 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/)
void Spell::EffectDestroyAllTotems(uint32 /*i*/) void Spell::EffectDestroyAllTotems(uint32 /*i*/)
{ {
float mana = 0; uint32 mana = 0;
for(int slot = 0; slot < MAX_TOTEM; ++slot) for(int slot = 0; slot < MAX_TOTEM; ++slot)
{ {
if(!m_caster->m_TotemSlot[slot]) if(!m_caster->m_TotemSlot[slot])
@ -6167,13 +6167,16 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/)
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id);
if(spellInfo) if(spellInfo)
mana += spellInfo->manaCost * damage / 100; {
uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100;
mana += manacost * damage / 100;
}
((Totem*)totem)->UnSummon(); ((Totem*)totem)->UnSummon();
} }
} }
int32 gain = m_caster->ModifyPower(POWER_MANA,int32(mana)); if (mana)
m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA); m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true);
} }
void Spell::EffectDurabilityDamage(uint32 i) void Spell::EffectDurabilityDamage(uint32 i)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7788" #define REVISION_NR "7789"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__