Track player skills from update fields and display in character screen

Extract skill data from PLAYER_SKILL_INFO_1_1 update fields (636-1019), detect
skill increases with chat messages, and replace placeholder Skills tab with live
data grouped by category with progress bars.
This commit is contained in:
Kelsi 2026-02-07 14:21:50 -08:00
parent cc6fa12157
commit 5bfe4b61aa
3 changed files with 175 additions and 24 deletions

View file

@ -14,12 +14,19 @@
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
#include <map>
namespace wowee {
namespace network { class WorldSocket; class Packet; }
namespace game {
struct PlayerSkill {
uint32_t skillId = 0;
uint16_t value = 0;
uint16_t maxValue = 0;
};
/**
* Quest giver status values (WoW 3.3.5a)
*/
@ -343,6 +350,11 @@ public:
uint32_t getPlayerLevel() const { return serverPlayerLevel_; }
static uint32_t killXp(uint32_t playerLevel, uint32_t victimLevel);
// Player skills
const std::map<uint32_t, PlayerSkill>& getPlayerSkills() const { return playerSkills_; }
const std::string& getSkillName(uint32_t skillId) const;
uint32_t getSkillCategory(uint32_t skillId) const;
// World entry callback (online mode - triggered when entering world)
// Parameters: mapId, x, y, z (canonical WoW coordinates)
using WorldEntryCallback = std::function<void(uint32_t mapId, float x, float y, float z)>;
@ -804,6 +816,14 @@ private:
uint32_t serverPlayerLevel_ = 1;
static uint32_t xpForLevel(uint32_t level);
// ---- Player skills ----
std::map<uint32_t, PlayerSkill> playerSkills_;
std::unordered_map<uint32_t, std::string> skillLineNames_;
std::unordered_map<uint32_t, uint32_t> skillLineCategories_;
bool skillLineDbcLoaded_ = false;
void loadSkillLineDbc();
void extractSkillFields(const std::map<uint16_t, uint32_t>& fields);
NpcDeathCallback npcDeathCallback_;
NpcRespawnCallback npcRespawnCallback_;
MeleeSwingCallback meleeSwingCallback_;