mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: parse and display StartQuest field from item query response
Items that begin a quest (like quest starter drop items) now show "Begins a Quest" in the tooltip. All three expansion parsers (WotLK/TBC/Classic) now read the PageText/LanguageID/PageMaterial/StartQuest fields after Description. startQuestId is propagated through all 5 inventory rebuild paths and stored in ItemDef.
This commit is contained in:
parent
5fcf71e3ff
commit
62b7622f75
7 changed files with 36 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ struct ItemDef {
|
|||
// Generic stat pairs for non-primary stats (hit, crit, haste, AP, SP, etc.)
|
||||
struct ExtraStat { uint32_t statType = 0; int32_t statValue = 0; };
|
||||
std::vector<ExtraStat> extraStats;
|
||||
uint32_t startQuestId = 0; // Non-zero: item begins a quest
|
||||
};
|
||||
|
||||
struct ItemSlot {
|
||||
|
|
|
|||
|
|
@ -1566,6 +1566,7 @@ struct ItemQueryResponseData {
|
|||
// Generic stat pairs for non-primary stats (hit, crit, haste, AP, SP, etc.)
|
||||
struct ExtraStat { uint32_t statType = 0; int32_t statValue = 0; };
|
||||
std::vector<ExtraStat> extraStats;
|
||||
uint32_t startQuestId = 0; // Non-zero: item begins a quest
|
||||
bool valid = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10763,6 +10763,7 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.startQuestId = infoIt->second.startQuestId;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
|
|
@ -10811,6 +10812,7 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.startQuestId = infoIt->second.startQuestId;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
|
|
@ -10894,6 +10896,7 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.startQuestId = infoIt->second.startQuestId;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
|
|
@ -10943,6 +10946,7 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.startQuestId = infoIt->second.startQuestId;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
|
|
@ -11034,6 +11038,7 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.sellPrice = infoIt->second.sellPrice;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.startQuestId = infoIt->second.startQuestId;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
|
|
|
|||
|
|
@ -1331,6 +1331,14 @@ bool ClassicPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQ
|
|||
if (packet.getReadPos() < packet.getSize())
|
||||
data.description = packet.readString();
|
||||
|
||||
// Post-description: PageText, LanguageID, PageMaterial, StartQuest
|
||||
if (packet.getReadPos() + 16 <= packet.getSize()) {
|
||||
packet.readUInt32(); // PageText
|
||||
packet.readUInt32(); // LanguageID
|
||||
packet.readUInt32(); // PageMaterial
|
||||
data.startQuestId = packet.readUInt32(); // StartQuest
|
||||
}
|
||||
|
||||
data.valid = !data.name.empty();
|
||||
LOG_DEBUG("[Classic] Item query response: ", data.name, " (quality=", data.quality,
|
||||
" invType=", data.inventoryType, " stack=", data.maxStack, ")");
|
||||
|
|
|
|||
|
|
@ -991,6 +991,14 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery
|
|||
if (packet.getReadPos() < packet.getSize())
|
||||
data.description = packet.readString();
|
||||
|
||||
// Post-description: PageText, LanguageID, PageMaterial, StartQuest
|
||||
if (packet.getReadPos() + 16 <= packet.getSize()) {
|
||||
packet.readUInt32(); // PageText
|
||||
packet.readUInt32(); // LanguageID
|
||||
packet.readUInt32(); // PageMaterial
|
||||
data.startQuestId = packet.readUInt32(); // StartQuest
|
||||
}
|
||||
|
||||
data.valid = !data.name.empty();
|
||||
LOG_DEBUG("[TBC] Item query: ", data.name, " quality=", data.quality,
|
||||
" invType=", data.inventoryType, " armor=", data.armor);
|
||||
|
|
|
|||
|
|
@ -2529,6 +2529,14 @@ bool ItemQueryResponseParser::parse(network::Packet& packet, ItemQueryResponseDa
|
|||
if (packet.getReadPos() < packet.getSize())
|
||||
data.description = packet.readString();
|
||||
|
||||
// Post-description fields: PageText, LanguageID, PageMaterial, StartQuest
|
||||
if (packet.getReadPos() + 16 <= packet.getSize()) {
|
||||
packet.readUInt32(); // PageText
|
||||
packet.readUInt32(); // LanguageID
|
||||
packet.readUInt32(); // PageMaterial
|
||||
data.startQuestId = packet.readUInt32(); // StartQuest
|
||||
}
|
||||
|
||||
data.valid = !data.name.empty();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1918,6 +1918,11 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I
|
|||
}
|
||||
}
|
||||
|
||||
// "Begins a Quest" line (shown in yellow-green like the game)
|
||||
if (item.startQuestId != 0) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.82f, 0.0f, 1.0f), "Begins a Quest");
|
||||
}
|
||||
|
||||
// Flavor / lore text (italic yellow in WoW, just yellow here)
|
||||
if (!item.description.empty()) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.9f, 0.5f, 0.9f), "\"%s\"", item.description.c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue