Fix quest item loot parsing and quest item progress tracking

- add SMSG_QUESTUPDATE_ADD_ITEM logical opcode mapping (0x197)
- handle quest item progress updates in GameHandler
- parse quest-item section in SMSG_LOOT_RESPONSE (regular + quest items)
- add quest item progress storage in quest log entries
- show tracked kill/item progress in Quest Log UI
This commit is contained in:
Kelsi 2026-02-18 04:06:14 -08:00
parent d3b04640f3
commit 98212a3f91
7 changed files with 79 additions and 1 deletions

View file

@ -1456,6 +1456,30 @@ void GameHandler::handlePacket(network::Packet& packet) {
}
break;
}
case Opcode::SMSG_QUESTUPDATE_ADD_ITEM: {
// Quest item count update: itemId + count
if (packet.getSize() - packet.getReadPos() >= 8) {
uint32_t itemId = packet.readUInt32();
uint32_t count = packet.readUInt32();
queryItemInfo(itemId, 0);
std::string itemLabel = "item #" + std::to_string(itemId);
if (const ItemQueryResponseData* info = getItemInfo(itemId)) {
if (!info->name.empty()) itemLabel = info->name;
}
bool updatedAny = false;
for (auto& quest : questLog_) {
if (quest.complete) continue;
quest.itemCounts[itemId] = count;
updatedAny = true;
}
addSystemChatMessage("Quest item: " + itemLabel + " (" + std::to_string(count) + ")");
LOG_INFO("Quest item update: itemId=", itemId, " count=", count,
" trackedQuestsUpdated=", updatedAny);
}
break;
}
case Opcode::SMSG_QUESTUPDATE_COMPLETE: {
// Quest objectives completed - mark as ready to turn in
uint32_t questId = packet.readUInt32();