From 6075207d94ffc2268171e9000ec7e171b4694adb Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 16:53:00 -0700 Subject: [PATCH] fix: complete TBC item query parsing for itemLevel, spells, binding, description TBC parser was truncating item query response after armor/resistances, discarding itemLevel, requiredLevel, spell slots, bind type, and description. Now stores itemLevel/requiredLevel, reads AmmoType+RangedModRange, reads 5 spell slots into data.spells[], reads bindType and description cstring. Matches the Classic and WotLK parser fixes from the previous commits. --- src/game/packet_parsers_tbc.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/game/packet_parsers_tbc.cpp b/src/game/packet_parsers_tbc.cpp index d4cad578..65cdd913 100644 --- a/src/game/packet_parsers_tbc.cpp +++ b/src/game/packet_parsers_tbc.cpp @@ -906,8 +906,8 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery 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 @@ -963,6 +963,31 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery data.delayMs = packet.readUInt32(); } + // AmmoType + RangedModRange + if (packet.getSize() - packet.getReadPos() >= 8) { + packet.readUInt32(); // AmmoType + packet.readFloat(); // RangedModRange + } + + // 5 item spells + for (int i = 0; i < 5; i++) { + if (packet.getReadPos() + 24 > packet.getSize()) break; + data.spells[i].spellId = packet.readUInt32(); + data.spells[i].spellTrigger = packet.readUInt32(); + packet.readUInt32(); // SpellCharges + packet.readUInt32(); // SpellCooldown + packet.readUInt32(); // SpellCategory + packet.readUInt32(); // SpellCategoryCooldown + } + + // Bonding type + if (packet.getReadPos() + 4 <= packet.getSize()) + data.bindType = packet.readUInt32(); + + // Flavor/lore text + if (packet.getReadPos() < packet.getSize()) + data.description = packet.readString(); + data.valid = !data.name.empty(); LOG_DEBUG("[TBC] Item query: ", data.name, " quality=", data.quality, " invType=", data.inventoryType, " armor=", data.armor);