From 8cac557f8694e2ad0124716a5fef2615a773ae11 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 07:42:40 -0700 Subject: [PATCH] feat: notify player when dungeon difficulty changes --- src/game/game_handler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 15093fd0..800bdcf0 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -14716,6 +14716,7 @@ void GameHandler::handleInstanceDifficulty(network::Packet& packet) { // MSG_SET_DUNGEON_DIFFICULTY: uint32 difficulty[, uint32 isInGroup, uint32 savedBool] (4 or 12 bytes) auto rem = [&]() { return packet.getSize() - packet.getReadPos(); }; if (rem() < 4) return; + uint32_t prevDifficulty = instanceDifficulty_; instanceDifficulty_ = packet.readUInt32(); if (rem() >= 4) { uint32_t secondField = packet.readUInt32(); @@ -14734,6 +14735,15 @@ void GameHandler::handleInstanceDifficulty(network::Packet& packet) { instanceIsHeroic_ = (instanceDifficulty_ == 1); } LOG_INFO("Instance difficulty: ", instanceDifficulty_, " heroic=", instanceIsHeroic_); + + // Announce difficulty change to the player (only when it actually changes) + // difficulty values: 0=Normal, 1=Heroic, 2=25-Man Normal, 3=25-Man Heroic + if (instanceDifficulty_ != prevDifficulty) { + static const char* kDiffLabels[] = {"Normal", "Heroic", "25-Man Normal", "25-Man Heroic"}; + const char* diffLabel = (instanceDifficulty_ < 4) ? kDiffLabels[instanceDifficulty_] : nullptr; + if (diffLabel) + addSystemChatMessage(std::string("Dungeon difficulty set to ") + diffLabel + "."); + } } // ---------------------------------------------------------------------------