diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4dfa6208a..4502722e2 100644 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -201,7 +201,7 @@ uint32 Bag::GetItemCount(uint32 item, Item* eItem) const for (uint32 i = 0; i < GetBagSize(); ++i) { pItem = m_bagslot[i]; - if (pItem && pItem != eItem && pItem->GetTemplate()->Socket[0].Color) + if (pItem && pItem != eItem && pItem->HasSocket()) count += pItem->GetGemCountWithID(item); } } diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 9aea0ea74..2dc3047e2 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1014,8 +1014,11 @@ bool Item::HasSocket() const uint8 Item::GetGemCountWithID(uint32 GemID) const { uint8 count = 0; - for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot) + for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot) { + if (enchant_slot == BONUS_ENCHANTMENT_SLOT) + continue; + uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; @@ -1033,8 +1036,11 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const { uint8 count = 0; - for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot) + for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot) { + if (enchant_slot == BONUS_ENCHANTMENT_SLOT) + continue; + uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6dc714337..756ed7826 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13913,8 +13913,11 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi return res; // check unique-equipped on gems - for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + 3; ++enchant_slot) + for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot) { + if (enchant_slot == BONUS_ENCHANTMENT_SLOT) + continue; + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 63039c01c..62fc2df4a 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -347,7 +347,7 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + if (pItem != skipItem && pItem->HasSocket()) count += pItem->GetGemCountWithID(item); if (inBankAlso) @@ -365,7 +365,7 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + if (pItem != skipItem && pItem->HasSocket()) count += pItem->GetGemCountWithID(item); } @@ -754,7 +754,7 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ continue; Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetTemplate()->Socket[0].Color) + if (pItem && pItem->HasSocket()) { tempcount += pItem->GetGemCountWithID(item); if (tempcount >= count)