feat: resolve random property/suffix names for item display

Load ItemRandomProperties.dbc and ItemRandomSuffix.dbc lazily to resolve
suffix names like "of the Eagle", "of the Monkey" etc. Add
getRandomPropertyName(id) callback on GameHandler wired through Application.
Append suffix to item names in SMSG_ITEM_PUSH_RESULT loot notifications
so items display as "Leggings of the Eagle" instead of just "Leggings".
This commit is contained in:
Kelsi 2026-03-20 19:18:30 -07:00
parent 23a7d3718c
commit 4b3e377add
3 changed files with 47 additions and 1 deletions

View file

@ -1978,7 +1978,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
/*uint32_t itemSlot =*/ packet.readUInt32();
uint32_t itemId = packet.readUInt32();
/*uint32_t suffixFactor =*/ packet.readUInt32();
/*int32_t randomProp =*/ static_cast<int32_t>(packet.readUInt32());
int32_t randomProp = static_cast<int32_t>(packet.readUInt32());
uint32_t count = packet.readUInt32();
/*uint32_t totalCount =*/ packet.readUInt32();
@ -1987,6 +1987,11 @@ void GameHandler::handlePacket(network::Packet& packet) {
if (const ItemQueryResponseData* info = getItemInfo(itemId)) {
// Item info already cached — emit immediately.
std::string itemName = info->name.empty() ? ("item #" + std::to_string(itemId)) : info->name;
// Append random suffix name (e.g., "of the Eagle") if present
if (randomProp != 0) {
std::string suffix = getRandomPropertyName(randomProp);
if (!suffix.empty()) itemName += " " + suffix;
}
uint32_t quality = info->quality;
std::string link = buildItemLink(itemId, quality, itemName);
std::string msg = "Received: " + link;