From ca6c55a5e706458d183365b84810fe8fab20d65b Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Tue, 15 Sep 2026 08:05:42 -0500 Subject: [PATCH] Give every [cc:type] its own exact DBC mechanic stun matched mechanics 12, 14 and 30 at once through CCMechanicGroups, so [cc:stun] fired on a gouged or sapped target and there was no way to ask about any of the three on its own. Name each mechanic instead: knockout (14) and sap (30) join the table, with fumble (6), turn (23) and interrupt (26) filling the remaining gaps, and grip stays as an alias of fumble so existing macros keep working. The group indirection had no entries left afterwards, so it and its lookup branch are gone; aliases in CCMechanics already cover every name that shares a mechanic. CCTypesLossOfControl is untouched, so bare [cc] and [cc:any] still span the whole loss-of-control set. --- Conditionals.lua | 39 +++++++++++++-------------------------- Utility.lua | 25 +++++++++++++------------ 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index 01c8840..5474b65 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -4847,7 +4847,8 @@ end -- ============================================================================ -- Maps CC type names to mechanic constants (matches DBC mechanic IDs) --- Note: Some types map to multiple mechanics via CCMechanicGroups below +-- One name, one mechanic: [cc:type] follows the exact DBC mechanic. Several +-- names may share a mechanic as aliases, but no name spans two mechanics. CleveRoids.CCMechanics = { -- Movement/control impairment charm = 1, -- Mind Control, Seduction @@ -4856,31 +4857,30 @@ CleveRoids.CCMechanics = { disarm = 3, -- Disarm, Riposte disarm distract = 4, -- Distract (Rogue ability) fear = 5, -- Fear, Psychic Scream, Howl of Terror - grip = 6, -- Grip effects + fumble = 6, -- DBC Fumble mechanic + grip = 6, -- Legacy alias for fumble root = 7, -- Entangling Roots, Frost Nova, Improved Hamstring pacify = 8, -- Pacify effects silence = 9, -- Silence, Kick, Counterspell (lockout) sleep = 10, -- Hibernate, Wyvern Sting sleep snare = 11, -- Hamstring, Wing Clip, Crippling Poison slow = 11, -- Alias for snare - stun = 12, -- Consolidated: Stun(12) + Knockout(14) + Sap(30) - freeze = 13, -- Freeze effects (Frost Nova freeze) + stun = 12, -- Stun (Cheap Shot, Kidney Shot, Hammer of Justice) + freeze = 13, -- Freeze effects + knockout = 14, -- Knockout (Gouge, Repentance) bleed = 15, -- Rend, Garrote, Deep Wounds polymorph = 17, -- Polymorph (all variants) banish = 18, -- Banish (Warlock) shackle = 20, -- Shackle Undead + turn = 23, -- Turn effects horror = 24, -- Death Coil (Warlock), Intimidating Shout (horror) + interrupt = 26, -- Interrupt mechanic daze = 27, -- Dazed effects -} - --- Mechanic groups: CC types that check multiple DBC mechanics --- Used when a single conditional should match several related effects -CleveRoids.CCMechanicGroups = { - stun = {12, 14, 30}, -- Stun(12), Knockout/Gouge(14), Sap(30) + sap = 30, -- Sap/Sapped mechanic } -- CC types that count as "crowd controlled" (loss of control) --- Note: Mechanics 12, 14, 30 are all consolidated under "stun" for conditionals +-- Individual DBC mechanics remain distinct; this table only powers [cc]/[cc:any]. CleveRoids.CCTypesLossOfControl = { [1] = true, -- charm [2] = true, -- disoriented @@ -4889,12 +4889,12 @@ CleveRoids.CCTypesLossOfControl = { [10] = true, -- sleep [12] = true, -- stun (Cheap Shot, Kidney Shot, etc.) [13] = true, -- freeze - [14] = true, -- knockout/gouge (now part of stun group) + [14] = true, -- knockout/gouge [17] = true, -- polymorph [18] = true, -- banish [20] = true, -- shackle [24] = true, -- horror - [30] = true, -- sap (now part of stun group) + [30] = true, -- sap } -- Check if BuffLib is available with full mechanic support @@ -4961,19 +4961,6 @@ function CleveRoids.ValidateUnitCC(unit, ccType) return CleveRoids.ValidateUnitAnyCrowdControl(unit) end - -- Check if this CC type maps to a group of mechanics - local mechanicGroup = CleveRoids.CCMechanicGroups[ccTypeLower] - if mechanicGroup then - -- Check all mechanics in the group (e.g., stun checks 12, 14, 30) - for _, mechanic in ipairs(mechanicGroup) do - if CleveRoids.ValidateUnitCCSingleMechanic(unit, mechanic) then - return true - end - end - return false - end - - -- Single mechanic lookup local mechanic = CleveRoids.CCMechanics[ccTypeLower] if not mechanic then return false end diff --git a/Utility.lua b/Utility.lua index 545a285..4ba368c 100644 --- a/Utility.lua +++ b/Utility.lua @@ -6025,6 +6025,7 @@ local CC_IMMUNITY_TYPES = { shackle = true, -- Shackle Undead horror = true, -- Death Coil disorient = true, -- Scatter Shot, Blind + daze = true, -- Daze mechanic snare = true, -- Hamstring, Wing Clip } @@ -6051,19 +6052,19 @@ local MECHANIC_TO_CC_TYPE = { [10] = "sleep", [11] = "snare", [12] = "stun", - [13] = "stun", -- freeze → stun (similar effect) - [14] = "stun", -- knockout/gouge → stun + [13] = "freeze", + [14] = "knockout", [17] = "polymorph", [18] = "banish", [20] = "shackle", [24] = "horror", - [27] = "disorient", -- daze → disorient - [30] = "stun", -- sap → stun + [27] = "daze", + [30] = "sap", } --- Mechanic-precise mapping used only for learned NPC immunity. Do not use --- CCMechanicGroups here: Vanilla can distinguish Stun (12), Freeze (13), --- Knockout (14), and Sap (30) immunities independently. +-- Mechanic-precise mapping used only for learned NPC immunity. Keep it +-- one-to-one: Vanilla can distinguish Stun (12), Freeze (13), Knockout (14) +-- and Sap (30) immunities independently, so never fold them together here. local MECHANIC_TO_IMMUNITY_TYPE = { [1] = "charm", [2] = "disorient", @@ -6079,7 +6080,7 @@ local MECHANIC_TO_IMMUNITY_TYPE = { [18] = "banish", [20] = "shackle", [24] = "horror", - [27] = "disorient", -- Preserve existing daze handling for now + [27] = "daze", [30] = "sap", } @@ -7737,7 +7738,7 @@ function CleveRoids.ListCCImmunities(ccType) local key = "cc_" .. ccType if not CC_IMMUNITY_TYPES[ccType] then - CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, snare") + CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, daze, snare") return end @@ -7788,7 +7789,7 @@ function CleveRoids.ClearCCImmunities(ccType) local key = "cc_" .. ccType if not CC_IMMUNITY_TYPES[ccType] then - CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, snare") + CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, daze, snare") return end @@ -7811,13 +7812,13 @@ end function CleveRoids.AddCCImmunity(npcName, ccType, buffName) if not npcName or not ccType then CleveRoids.Print("Usage: /cleveroid addccimmune [buff name]") - CleveRoids.Print("CC Types: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, snare") + CleveRoids.Print("CC Types: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, daze, snare") return end ccType = NormalizeCCImmunityType(ccType) if not CC_IMMUNITY_TYPES[ccType] then - CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, snare") + CleveRoids.Print("Invalid CC type. Use: stun, freeze, knockout, sap, fear, root, silence, sleep, charm, polymorph, banish, shackle, horror, disorient, daze, snare") return end