aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-11-19 15:51:57 +0100
committerShauren <shauren.trinity@gmail.com>2016-11-19 15:51:57 +0100
commit28fd8a424d828f36a2b05ed016b12c4b8cf2607c (patch)
treef2adcb6b77f31bab32499f10cff03b42740f9484 /src
parentd64da044d87dd8c792dd3e8dc1be53e81c701273 (diff)
Core/Spells: Updated spell required items check, EquippedItemInventoryTypeMask should only be used for enchantments
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Item/Item.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 4b117792ba0..5c018966f0a 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1143,13 +1143,11 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
{
ItemTemplate const* proto = GetTemplate();
+ bool isEnchantSpell = spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC);
if (spellInfo->EquippedItemClass != -1) // -1 == any item class
{
- // Special case - accept vellum for armor/weapon requirements
- if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR ||
- spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON) && proto->IsVellum())
- if (spellInfo->IsAbilityOfSkillType(SKILL_ENCHANTING)) // only for enchanting spells
- return true;
+ if (isEnchantSpell && proto->GetFlags3() & ITEM_FLAG3_CAN_STORE_ENCHANTS)
+ return true;
if (spellInfo->EquippedItemClass != int32(proto->GetClass()))
return false; // wrong item class
@@ -1161,7 +1159,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
}
}
- if (spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
+ if (isEnchantSpell && spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
{
// Special case - accept weapon type for main and offhand requirements
if (proto->GetInventoryType() == INVTYPE_WEAPON &&