From 22742fedb836ce8038239c7501e7e1100a2726f1 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 06:42:43 -0700 Subject: [PATCH] feat: add [raid], [noraid], and [spec:N] macro conditionals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add commonly-used WoW macro conditionals: - [raid]/[noraid] — checks if the player is in a raid group (groupType == 1) vs a regular party. Used for conditional healing/targeting in raid content. - [spec:1]/[spec:2] — checks the active talent spec (1-based index). Used for dual-spec macros that swap gear sets or use different rotations per spec. Updated /macrohelp to list the new conditionals. --- src/ui/game_screen.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index aa46605b..cbbd9acf 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -5796,6 +5796,17 @@ static std::string evaluateMacroConditionals(const std::string& rawArg, if (c == "group" || c == "party") return gameHandler.isInGroup(); if (c == "nogroup") return !gameHandler.isInGroup(); + // raid / noraid — player is in a raid group (groupType == 1) + if (c == "raid") return gameHandler.isInGroup() && gameHandler.getPartyData().groupType == 1; + if (c == "noraid") return !gameHandler.isInGroup() || gameHandler.getPartyData().groupType != 1; + + // spec:N — active talent spec (1-based: spec:1 = primary, spec:2 = secondary) + if (c.rfind("spec:", 0) == 0) { + uint8_t wantSpec = 0; + try { wantSpec = static_cast(std::stoul(c.substr(5))); } catch (...) {} + return wantSpec > 0 && gameHandler.getActiveTalentSpec() == (wantSpec - 1); + } + // noform / nostance — player is NOT in a shapeshift/stance if (c == "noform" || c == "nostance") { for (const auto& a : gameHandler.getPlayerAuras()) @@ -6151,7 +6162,8 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) { "--- Macro Conditionals ---", "Usage: /cast [cond1,cond2] Spell1; [cond3] Spell2; Default", "State: [combat] [mounted] [swimming] [flying] [stealthed]", - " [channeling] [pet] [group] [indoors] [outdoors]", + " [channeling] [pet] [group] [raid] [indoors] [outdoors]", + "Spec: [spec:1] [spec:2] (active talent spec, 1-based)", " (prefix no- to negate any condition)", "Target: [harm] [help] [exists] [noexists] [dead] [nodead]", " [target=focus] [target=pet] [target=player]",