feat: track UNIT_FIELD_STAT0-4 from server update fields for accurate character stats

Add UNIT_FIELD_STAT0-4 (STR/AGI/STA/INT/SPI) to the UF enum and wire up
per-expansion indices in all four expansion JSON files (WotLK: 84-88,
Classic/Turtle: 138-142, TBC: 159-163). Read the values in both CREATE
and VALUES player update handlers and store in playerStats_[5].

renderStatsPanel now uses the server-authoritative totals when available,
falling back to the previous 20+level estimate only if the server hasn't
sent UNIT_FIELD_STAT* yet. Item-query bonuses are still shown as (+N)
alongside the server total for both paths.
This commit is contained in:
Kelsi 2026-03-10 23:08:15 -07:00
parent d95abfb607
commit 99de1fa3e5
10 changed files with 115 additions and 30 deletions

View file

@ -37,6 +37,11 @@ static const UFNameEntry kUFNames[] = {
{"UNIT_NPC_FLAGS", UF::UNIT_NPC_FLAGS},
{"UNIT_DYNAMIC_FLAGS", UF::UNIT_DYNAMIC_FLAGS},
{"UNIT_FIELD_RESISTANCES", UF::UNIT_FIELD_RESISTANCES},
{"UNIT_FIELD_STAT0", UF::UNIT_FIELD_STAT0},
{"UNIT_FIELD_STAT1", UF::UNIT_FIELD_STAT1},
{"UNIT_FIELD_STAT2", UF::UNIT_FIELD_STAT2},
{"UNIT_FIELD_STAT3", UF::UNIT_FIELD_STAT3},
{"UNIT_FIELD_STAT4", UF::UNIT_FIELD_STAT4},
{"UNIT_END", UF::UNIT_END},
{"PLAYER_FLAGS", UF::PLAYER_FLAGS},
{"PLAYER_BYTES", UF::PLAYER_BYTES},