From 0901a4c2ac2168ce03a0cb10114d453994bc9425 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 21 Oct 2010 01:55:21 +0400 Subject: [PATCH] [10634] Include non-percent mana cost in EffectDestroyAllTotems mana return. Also small speedup for no-return spells. --- src/game/SpellEffects.cpp | 11 +++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index cf4041baf..891a0ee30 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -7621,11 +7621,14 @@ void Spell::EffectDestroyAllTotems(SpellEffectIndex /*eff_idx*/) { if (Totem* totem = m_caster->GetTotem(TotemSlot(slot))) { - uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); - if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id)) + if (damage) { - uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100; - mana += manacost * damage / 100; + uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); + if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id)) + { + uint32 manacost = spellInfo->manaCost + m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100; + mana += manacost * damage / 100; + } } totem->UnSummon(); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 410358dd7..915ec9769 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10633" + #define REVISION_NR "10634" #endif // __REVISION_NR_H__