feat: add spell power and healing bonus to WotLK character stats

Tracks PLAYER_FIELD_MOD_DAMAGE_DONE_POS (7 schools at field 1171) and
PLAYER_FIELD_MOD_HEALING_DONE_POS (field 1192) from server update fields.

getSpellPower() returns the max damage bonus across magic schools 1-6.
getHealingPower() returns the raw healing bonus.

Both values displayed in the character screen Combat section alongside
the previously added attack power, dodge, parry, crit, and rating fields.
This commit is contained in:
Kelsi 2026-03-13 08:37:55 -07:00
parent c0ffca68f2
commit 2b79f9d121
6 changed files with 45 additions and 4 deletions

View file

@ -314,6 +314,18 @@ public:
int32_t getMeleeAttackPower() const { return playerMeleeAP_; }
int32_t getRangedAttackPower() const { return playerRangedAP_; }
// Server-authoritative spell damage / healing bonus (WotLK: PLAYER_FIELD_MOD_*).
// getSpellPower returns the max damage bonus across magic schools 1-6 (Holy/Fire/Nature/Frost/Shadow/Arcane).
// Returns -1 if not yet received.
int32_t getSpellPower() const {
int32_t sp = -1;
for (int i = 1; i <= 6; ++i) {
if (playerSpellDmgBonus_[i] > sp) sp = playerSpellDmgBonus_[i];
}
return sp;
}
int32_t getHealingPower() const { return playerHealBonus_; }
// Server-authoritative combat chance percentages (WotLK: PLAYER_* float fields).
// Returns -1.0f if not yet received.
float getDodgePct() const { return playerDodgePct_; }
@ -2820,6 +2832,8 @@ private:
// WotLK secondary combat stats (-1 = not yet received)
int32_t playerMeleeAP_ = -1;
int32_t playerRangedAP_ = -1;
int32_t playerSpellDmgBonus_[7] = {-1,-1,-1,-1,-1,-1,-1}; // per school 0-6
int32_t playerHealBonus_ = -1;
float playerDodgePct_ = -1.0f;
float playerParryPct_ = -1.0f;
float playerBlockPct_ = -1.0f;