Skip to content

Commit

Permalink
[10634] Include non-percent mana cost in EffectDestroyAllTotems mana …
Browse files Browse the repository at this point in the history
…return.

Also small speedup for no-return spells.
  • Loading branch information
VladimirMangos committed Oct 20, 2010
1 parent 91dba67 commit 0222af2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10633"
#define REVISION_NR "10634"
#endif // __REVISION_NR_H__

0 comments on commit 0222af2

Please sign in to comment.