[10634] Include non-percent mana cost in EffectDestroyAllTotems mana return.

Also small speedup for no-return spells.
This commit is contained in:
VladimirMangos 2010-10-21 01:55:21 +04:00
parent bf2b256720
commit 0901a4c2ac
2 changed files with 8 additions and 5 deletions

View file

@ -7621,11 +7621,14 @@ void Spell::EffectDestroyAllTotems(SpellEffectIndex /*eff_idx*/)
{ {
if (Totem* totem = m_caster->GetTotem(TotemSlot(slot))) if (Totem* totem = m_caster->GetTotem(TotemSlot(slot)))
{ {
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); if (damage)
if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id))
{ {
uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100; uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
mana += manacost * damage / 100; if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id))
{
uint32 manacost = spellInfo->manaCost + m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100;
mana += manacost * damage / 100;
}
} }
totem->UnSummon(); totem->UnSummon();
} }

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 "10633" #define REVISION_NR "10634"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__