From c4b2089d3107d9fbfb8c47225ea733726fe8164b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 02:25:42 -0700 Subject: [PATCH] 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. --- src/game/game_handler.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 525f2aba..0fd1afd8 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -3438,6 +3438,25 @@ void GameHandler::handlePacket(network::Packet& packet) { /*uint32_t over=*/ packet.readUInt32(); addCombatText(CombatTextEntry::PERIODIC_HEAL, static_cast(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(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(amount), + spellId, false); } else { // Unknown/untracked aura type — stop parsing this event safely packet.setReadPos(packet.getSize());