aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-02-21 16:58:09 +0100
committerShauren <shauren.trinity@gmail.com>2015-02-21 16:58:09 +0100
commitea9eccae8596d440c372b0d9709d4def4b46e648 (patch)
treef240e8bd8e6ff0857b215d46c130e8859e481270 /src/server/game/Spells/Spell.cpp
parentd2396fb897a4a2f21a4b43f8c37f3a87c4285f2c (diff)
Core/Spells: Restored totem category check
Revert "Core/Totems: In cata totem items are no longer needed" This reverts commit 45e0cae7beedd84a6e71cf99d356e836476c1e4a
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp20
1 files changed, 20 insertions, 0 deletions
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