From ea9eccae8596d440c372b0d9709d4def4b46e648 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 21 Feb 2015 16:58:09 +0100 Subject: Core/Spells: Restored totem category check Revert "Core/Totems: In cata totem items are no longer needed" This reverts commit 45e0cae7beedd84a6e71cf99d356e836476c1e4a --- src/server/game/Spells/Spell.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/server/game/Spells/Spell.cpp') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 61315062b10..ed7ba3b788c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6146,8 +6146,28 @@ SpellCastResult Spell::CheckItems() else totems -= 1; } + if (totems != 0) return SPELL_FAILED_TOTEMS; + + // Check items for TotemCategory (items presence in inventory) + uint32 totemCategory = 2; + for (uint8 i = 0; i < 2; ++i) + { + if (m_spellInfo->TotemCategory[i] != 0) + { + if (player->HasItemTotemCategory(m_spellInfo->TotemCategory[i])) + { + totemCategory -= 1; + continue; + } + } + else + totemCategory -= 1; + } + + if (totemCategory != 0) + return SPELL_FAILED_TOTEM_CATEGORY; } // special checks for spell effects -- cgit v1.2.3