From 71597c9a03183524c2a52a3da338d10271e241f7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 10:37:41 -0700 Subject: [PATCH] feat: enhance NPC tabard rendering to use ItemDisplayInfo.dbc variants Reads equipped tabard display ID from CreatureDisplayInfoExtra (slot 9) and looks up the corresponding geoset group in ItemDisplayInfo.dbc to select the correct tabard variant. Falls back to hardcoded 1201 if DBC unavailable. Improves NPC appearance variety without risky features. --- src/core/application.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index 7c1355ab..d117b46a 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6450,8 +6450,32 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x } // Show tabard mesh only when CreatureDisplayInfoExtra equips one. + // Use ItemDisplayInfo.dbc to get the correct tabard geoset variant. if (hasGroup12 && hasEquippedTabard) { - uint16_t tabardSid = pickFromGroup(1201, 12); + uint16_t wantTabard = 1201; // Default fallback + + // Try to read tabard geoset variant from ItemDisplayInfo.dbc (slot 9) + if (hasHumanoidExtra && itExtra != humanoidExtraMap_.end()) { + uint32_t tabardDisplayId = itExtra->second.equipDisplayId[9]; + if (tabardDisplayId != 0) { + auto itemDisplayDbc = assetManager->loadDBC("ItemDisplayInfo.dbc"); + const auto* idiL = pipeline::getActiveDBCLayout() + ? pipeline::getActiveDBCLayout()->getLayout("ItemDisplayInfo") : nullptr; + if (itemDisplayDbc) { + int32_t tabardIdx = itemDisplayDbc->findRecordById(tabardDisplayId); + if (tabardIdx >= 0) { + // Get geoset group variant from ItemDisplayInfo (group 1) + const uint32_t ggField = idiL ? (*idiL)["GeosetGroup1"] : 7; + uint32_t tabardGG = itemDisplayDbc->getUInt32(static_cast(tabardIdx), ggField); + if (tabardGG > 0) { + wantTabard = static_cast(1200 + tabardGG); + } + } + } + } + } + + uint16_t tabardSid = pickFromGroup(wantTabard, 12); if (tabardSid != 0) normalizedGeosets.insert(tabardSid); }