Add XP tracking with level-up, kill XP formula, and server-compatible SMSG_LOG_XPGAIN support

This commit is contained in:
Kelsi 2026-02-05 12:07:58 -08:00
parent ed5d10ec01
commit 78442f8aea
7 changed files with 249 additions and 0 deletions

View file

@ -1052,6 +1052,23 @@ bool SpellHealLogParser::parse(network::Packet& packet, SpellHealLogData& data)
return true;
}
// ============================================================
// XP Gain
// ============================================================
bool XpGainParser::parse(network::Packet& packet, XpGainData& data) {
data.victimGuid = packet.readUInt64();
data.totalXp = packet.readUInt32();
data.type = packet.readUInt8();
if (data.type == 0) {
// Kill XP: has group bonus float (unused) + group bonus uint32
packet.readFloat();
data.groupBonus = packet.readUInt32();
}
LOG_INFO("XP gain: ", data.totalXp, " xp (type=", static_cast<int>(data.type), ")");
return data.totalXp > 0;
}
// ============================================================
// Phase 3: Spells, Action Bar, Auras
// ============================================================