mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: enhance NPC tabard rendering with ItemDisplayInfo.dbc variant lookup
Look up tabard display ID from CreatureDisplayInfoExtra and map to geoset variant via ItemDisplayInfo.dbc to select correct tabard meshes. Falls back to hardcoded 1201 if DBC lookup unavailable. Improves NPC appearance variety with proper scope handling.
This commit is contained in:
parent
4be7910fdf
commit
6426bde7ea
1 changed files with 28 additions and 1 deletions
|
|
@ -6451,7 +6451,34 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x
|
|||
|
||||
// Show tabard mesh only when CreatureDisplayInfoExtra equips one.
|
||||
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 && itDisplayData != displayDataMap_.end() &&
|
||||
itDisplayData->second.extraDisplayId != 0) {
|
||||
auto itExtra = humanoidExtraMap_.find(itDisplayData->second.extraDisplayId);
|
||||
if (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 && idiL) {
|
||||
int32_t tabardIdx = itemDisplayDbc->findRecordById(tabardDisplayId);
|
||||
if (tabardIdx >= 0) {
|
||||
// Get geoset variant from ItemDisplayInfo GeosetGroup1 field
|
||||
const uint32_t ggField = (*idiL)["GeosetGroup1"];
|
||||
uint32_t tabardGG = itemDisplayDbc->getUInt32(static_cast<uint32_t>(tabardIdx), ggField);
|
||||
if (tabardGG > 0) {
|
||||
wantTabard = static_cast<uint16_t>(1200 + tabardGG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t tabardSid = pickFromGroup(wantTabard, 12);
|
||||
if (tabardSid != 0) normalizedGeosets.insert(tabardSid);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue