fix: handle OBS_MOD_POWER and PERIODIC_ENERGIZE aura types in SMSG_PERIODICAURALOG

Add PERIODIC_ENERGIZE (91) and OBS_MOD_POWER (46) handling so mana/energy/rage
restore ticks from common WotLK auras (Replenishment, Mana Spring Totem, Divine
Plea, etc.) appear as ENERGIZE in floating combat text. Also handle PERIODIC_MANA_LEECH
(98) to properly consume its 12 bytes instead of halting mid-event parse.
This commit is contained in:
Kelsi 2026-03-11 02:25:42 -07:00
parent a67feb6d93
commit c4b2089d31

View file

@ -3438,6 +3438,25 @@ void GameHandler::handlePacket(network::Packet& packet) {
/*uint32_t over=*/ packet.readUInt32();
addCombatText(CombatTextEntry::PERIODIC_HEAL, static_cast<int32_t>(heal),
spellId, isPlayerCaster);
} else if (auraType == 46 || auraType == 91) {
// OBS_MOD_POWER / PERIODIC_ENERGIZE: miscValue(powerType) + amount
// Common in WotLK: Replenishment, Mana Spring Totem, Divine Plea, etc.
if (packet.getSize() - packet.getReadPos() < 8) break;
/*uint32_t powerType =*/ packet.readUInt32();
uint32_t amount = packet.readUInt32();
if ((isPlayerVictim || isPlayerCaster) && amount > 0)
addCombatText(CombatTextEntry::ENERGIZE, static_cast<int32_t>(amount),
spellId, isPlayerCaster);
} else if (auraType == 98) {
// PERIODIC_MANA_LEECH: miscValue(powerType) + amount + float multiplier
if (packet.getSize() - packet.getReadPos() < 12) break;
/*uint32_t powerType =*/ packet.readUInt32();
uint32_t amount = packet.readUInt32();
/*float multiplier =*/ packet.readUInt32(); // read as raw uint32 (float bits)
// Show as periodic damage from victim's perspective (mana drained)
if (isPlayerVictim && amount > 0)
addCombatText(CombatTextEntry::PERIODIC_DAMAGE, static_cast<int32_t>(amount),
spellId, false);
} else {
// Unknown/untracked aura type — stop parsing this event safely
packet.setReadPos(packet.getSize());