From 28fd8a424d828f36a2b05ed016b12c4b8cf2607c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 19 Nov 2016 15:51:57 +0100 Subject: Core/Spells: Updated spell required items check, EquippedItemInventoryTypeMask should only be used for enchantments --- src/server/game/Entities/Item/Item.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') 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 && -- cgit v1.2.3