From c44e1bde0aeee86197ba6c91dfcd070a893e4c65 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 17:28:28 -0700 Subject: [PATCH] feat: fire UPDATE_FACTION, QUEST_ACCEPTED, and QUEST_LOG_UPDATE events Fire UPDATE_FACTION when reputation standings change (SMSG_SET_FACTION_STANDING). Fire QUEST_ACCEPTED with quest ID when a new quest is added to the log. Fire QUEST_LOG_UPDATE on both quest acceptance and quest completion. Enables reputation tracking and quest log addons. --- src/game/game_handler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0d1253d4..47e07e77 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -4156,6 +4156,8 @@ void GameHandler::handlePacket(network::Packet& packet) { addSystemChatMessage(buf); watchedFactionId_ = factionId; if (repChangeCallback_) repChangeCallback_(name, delta, standing); + if (addonEventCallback_) + addonEventCallback_("UPDATE_FACTION", {}); } LOG_DEBUG("SMSG_SET_FACTION_STANDING: faction=", factionId, " standing=", standing); } @@ -5289,6 +5291,7 @@ void GameHandler::handlePacket(network::Packet& packet) { } } } + if (addonEventCallback_) addonEventCallback_("QUEST_LOG_UPDATE", {}); // Re-query all nearby quest giver NPCs so markers refresh if (socket) { for (const auto& [guid, entity] : entityManager.getEntities()) { @@ -21052,6 +21055,10 @@ void GameHandler::addQuestToLocalLogIfMissing(uint32_t questId, const std::strin entry.title = title.empty() ? ("Quest #" + std::to_string(questId)) : title; entry.objectives = objectives; questLog_.push_back(std::move(entry)); + if (addonEventCallback_) { + addonEventCallback_("QUEST_ACCEPTED", {std::to_string(questId)}); + addonEventCallback_("QUEST_LOG_UPDATE", {}); + } } bool GameHandler::resyncQuestLogFromServerSlots(bool forceQueryMetadata) {