mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: add [raid], [noraid], and [spec:N] macro conditionals
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.
This commit is contained in:
parent
a6fe5662c8
commit
22742fedb8
1 changed files with 13 additions and 1 deletions
|
|
@ -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<uint8_t>(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]",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue