diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bb758337d..8d7e81ebc 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1290,6 +1290,7 @@ public: InventoryResult CanUseItem(Item* pItem, bool not_loading = true) const; [[nodiscard]] bool HasItemTotemCategory(uint32 TotemCategory) const; bool IsTotemCategoryCompatiableWith(ItemTemplate const* pProto, uint32 requiredTotemCategoryId) const; + InventoryResult BotCanUseItem(ItemTemplate const* pItem) const; InventoryResult CanUseItem(ItemTemplate const* pItem) const; [[nodiscard]] InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 4dde1cc16..dd587b639 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -906,6 +906,31 @@ bool Player::IsTotemCategoryCompatiableWith(ItemTemplate const* pProto, uint32 r return true; } +InventoryResult Player::BotCanUseItem(ItemTemplate const* proto) const +{ + if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_IDOL && !IsClass(CLASS_DRUID, CLASS_CONTEXT_EQUIP_RELIC)) + { + return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + } + + if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_TOTEM && !IsClass(CLASS_SHAMAN, CLASS_CONTEXT_EQUIP_RELIC)) + { + return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + } + + if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_LIBRAM && !IsClass(CLASS_PALADIN, CLASS_CONTEXT_EQUIP_RELIC)) + { + return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + } + + if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_SIGIL && !IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_EQUIP_RELIC)) + { + return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + } + + return CanUseItem(proto); +} + InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const { Item* pItem2 = GetItemByPos(bag, slot); @@ -2296,26 +2321,6 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; } - if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_IDOL && !IsClass(CLASS_DRUID, CLASS_CONTEXT_EQUIP_RELIC)) - { - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; - } - - if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_TOTEM && !IsClass(CLASS_SHAMAN, CLASS_CONTEXT_EQUIP_RELIC)) - { - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; - } - - if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_LIBRAM && !IsClass(CLASS_PALADIN, CLASS_CONTEXT_EQUIP_RELIC)) - { - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; - } - - if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass == ITEM_SUBCLASS_ARMOR_SIGIL && !IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_EQUIP_RELIC)) - { - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; - } - if (proto->RequiredSkill != 0) { if (GetSkillValue(proto->RequiredSkill) == 0)