[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

@ -7620,13 +7620,16 @@ void Spell::EffectDestroyAllTotems(SpellEffectIndex /*eff_idx*/)
for(int slot = 0; slot < MAX_TOTEM_SLOT; ++slot) for(int slot = 0; slot < MAX_TOTEM_SLOT; ++slot)
{ {
if (Totem* totem = m_caster->GetTotem(TotemSlot(slot))) if (Totem* totem = m_caster->GetTotem(TotemSlot(slot)))
{
if (damage)
{ {
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id)) if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id))
{ {
uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100; uint32 manacost = spellInfo->manaCost + m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100;
mana += manacost * damage / 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__