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

@ -34,6 +34,11 @@ enum class UF : uint16_t {
UNIT_NPC_FLAGS,
UNIT_DYNAMIC_FLAGS,
UNIT_FIELD_RESISTANCES, // Physical armor (index 0 of the resistance array)
UNIT_FIELD_STAT0, // Strength (effective base, includes items)
UNIT_FIELD_STAT1, // Agility
UNIT_FIELD_STAT2, // Stamina
UNIT_FIELD_STAT3, // Intellect
UNIT_FIELD_STAT4, // Spirit
UNIT_END,
// Player fields