diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 00b6ac48..3832eb39 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2160,6 +2160,14 @@ void GameHandler::handlePacket(network::Packet& packet) { if (auto* unit = dynamic_cast(entity.get())) { unit->setHealth(hp); } + if (addonEventCallback_ && guid != 0) { + std::string unitId; + if (guid == playerGuid) unitId = "player"; + else if (guid == targetGuid) unitId = "target"; + else if (guid == focusGuid) unitId = "focus"; + if (!unitId.empty()) + addonEventCallback_("UNIT_HEALTH", {unitId}); + } break; } case Opcode::SMSG_POWER_UPDATE: { @@ -2177,6 +2185,14 @@ void GameHandler::handlePacket(network::Packet& packet) { if (auto* unit = dynamic_cast(entity.get())) { unit->setPowerByType(powerType, value); } + if (addonEventCallback_ && guid != 0) { + std::string unitId; + if (guid == playerGuid) unitId = "player"; + else if (guid == targetGuid) unitId = "target"; + else if (guid == focusGuid) unitId = "focus"; + if (!unitId.empty()) + addonEventCallback_("UNIT_POWER", {unitId}); + } break; }