diff --git a/include/game/inventory.hpp b/include/game/inventory.hpp index 8dcd4ce2..88b7db38 100644 --- a/include/game/inventory.hpp +++ b/include/game/inventory.hpp @@ -48,6 +48,8 @@ struct ItemDef { uint32_t sellPrice = 0; uint32_t curDurability = 0; uint32_t maxDurability = 0; + uint32_t itemLevel = 0; + uint32_t requiredLevel = 0; }; struct ItemSlot { diff --git a/include/game/world_packets.hpp b/include/game/world_packets.hpp index eaf1fd2f..03fdef5c 100644 --- a/include/game/world_packets.hpp +++ b/include/game/world_packets.hpp @@ -1552,6 +1552,8 @@ struct ItemQueryResponseData { int32_t intellect = 0; int32_t spirit = 0; uint32_t sellPrice = 0; + uint32_t itemLevel = 0; + uint32_t requiredLevel = 0; std::string subclassName; // Item spells (up to 5) struct ItemSpell { diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index a79ab584..85fc56b5 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -10758,6 +10758,8 @@ void GameHandler::rebuildOnlineInventory() { def.agility = infoIt->second.agility; def.intellect = infoIt->second.intellect; def.spirit = infoIt->second.spirit; + def.itemLevel = infoIt->second.itemLevel; + def.requiredLevel = infoIt->second.requiredLevel; } else { def.name = "Item " + std::to_string(def.itemId); queryItemInfo(def.itemId, guid); @@ -10798,6 +10800,8 @@ void GameHandler::rebuildOnlineInventory() { def.agility = infoIt->second.agility; def.intellect = infoIt->second.intellect; def.spirit = infoIt->second.spirit; + def.itemLevel = infoIt->second.itemLevel; + def.requiredLevel = infoIt->second.requiredLevel; } else { def.name = "Item " + std::to_string(def.itemId); queryItemInfo(def.itemId, guid); @@ -10873,6 +10877,8 @@ void GameHandler::rebuildOnlineInventory() { def.agility = infoIt->second.agility; def.intellect = infoIt->second.intellect; def.spirit = infoIt->second.spirit; + def.itemLevel = infoIt->second.itemLevel; + def.requiredLevel = infoIt->second.requiredLevel; def.bagSlots = infoIt->second.containerSlots; } else { def.name = "Item " + std::to_string(def.itemId); @@ -10915,6 +10921,8 @@ void GameHandler::rebuildOnlineInventory() { def.agility = infoIt->second.agility; def.intellect = infoIt->second.intellect; def.spirit = infoIt->second.spirit; + def.itemLevel = infoIt->second.itemLevel; + def.requiredLevel = infoIt->second.requiredLevel; def.sellPrice = infoIt->second.sellPrice; def.bagSlots = infoIt->second.containerSlots; } else { @@ -10998,6 +11006,8 @@ void GameHandler::rebuildOnlineInventory() { def.agility = infoIt->second.agility; def.intellect = infoIt->second.intellect; def.spirit = infoIt->second.spirit; + def.itemLevel = infoIt->second.itemLevel; + def.requiredLevel = infoIt->second.requiredLevel; def.sellPrice = infoIt->second.sellPrice; def.bagSlots = infoIt->second.containerSlots; } else { diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index 95b518f0..beb98e6c 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -2449,8 +2449,8 @@ bool ItemQueryResponseParser::parse(network::Packet& packet, ItemQueryResponseDa packet.readUInt32(); // AllowableClass packet.readUInt32(); // AllowableRace - packet.readUInt32(); // ItemLevel - packet.readUInt32(); // RequiredLevel + data.itemLevel = packet.readUInt32(); + data.requiredLevel = packet.readUInt32(); packet.readUInt32(); // RequiredSkill packet.readUInt32(); // RequiredSkillRank packet.readUInt32(); // RequiredSpell diff --git a/src/ui/inventory_screen.cpp b/src/ui/inventory_screen.cpp index 49ff82ba..54d8abab 100644 --- a/src/ui/inventory_screen.cpp +++ b/src/ui/inventory_screen.cpp @@ -1714,6 +1714,9 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I ImVec4 qColor = getQualityColor(item.quality); ImGui::TextColored(qColor, "%s", item.name.c_str()); + if (item.itemLevel > 0) { + ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.7f), "Item Level %u", item.itemLevel); + } if (item.itemId == 6948 && gameHandler_) { uint32_t mapId = 0; @@ -1819,6 +1822,9 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I if (!bonusLine.empty()) { ImGui::TextColored(green, "%s", bonusLine.c_str()); } + if (item.requiredLevel > 1) { + ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.5f, 1.0f), "Requires Level %u", item.requiredLevel); + } if (item.maxDurability > 0) { float durPct = static_cast(item.curDurability) / static_cast(item.maxDurability); ImVec4 durColor;