diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index ad404b95..dc92abfc 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -508,6 +508,10 @@ public: const std::vector& getPlayerAuras() const { return playerAuras; } const std::vector& getTargetAuras() const { return targetAuras; } + // Completed quests (populated from SMSG_QUERY_QUESTS_COMPLETED_RESPONSE) + bool isQuestCompleted(uint32_t questId) const { return completedQuests_.count(questId) > 0; } + const std::unordered_set& getCompletedQuests() const { return completedQuests_; } + // NPC death callback (for animations) using NpcDeathCallback = std::function; void setNpcDeathCallback(NpcDeathCallback cb) { npcDeathCallback_ = std::move(cb); } diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 2a833627..214d438b 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -5238,7 +5238,15 @@ void GameHandler::handleLoginVerifyWorld(network::Packet& packet) { pendingQuestQueryIds_.clear(); pendingLoginQuestResync_ = true; pendingLoginQuestResyncTimeout_ = 10.0f; + completedQuests_.clear(); LOG_INFO("Queued quest log resync for login (from server quest slots)"); + + // Request completed quest IDs from server (populates completedQuests_ when response arrives) + if (socket) { + network::Packet cqcPkt(wireOpcode(Opcode::CMSG_QUERY_QUESTS_COMPLETED)); + socket->send(cqcPkt); + LOG_INFO("Sent CMSG_QUERY_QUESTS_COMPLETED"); + } } }