mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
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:
parent
c0ffca68f2
commit
2b79f9d121
6 changed files with 45 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ enum class UF : uint16_t {
|
|||
PLAYER_EXPLORED_ZONES_START,
|
||||
PLAYER_CHOSEN_TITLE, // Active title index (-1 = no title)
|
||||
|
||||
// Player spell power / healing bonus (WotLK: PRIVATE — int32 per school)
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_POS, // Spell damage bonus (first of 7 schools)
|
||||
PLAYER_FIELD_MOD_HEALING_DONE_POS, // Healing bonus
|
||||
|
||||
// Player combat stats (WotLK: PRIVATE — float values)
|
||||
PLAYER_BLOCK_PERCENTAGE, // Block chance %
|
||||
PLAYER_DODGE_PERCENTAGE, // Dodge chance %
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue