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.
This commit is contained in:
Brues
2026-09-15 08:05:42 -05:00
parent c1a7bdb51b
commit ca6c55a5e7
2 changed files with 26 additions and 38 deletions
+13 -26
View File
@@ -4847,7 +4847,8 @@ end
-- ============================================================================ -- ============================================================================
-- Maps CC type names to mechanic constants (matches DBC mechanic IDs) -- 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 = { CleveRoids.CCMechanics = {
-- Movement/control impairment -- Movement/control impairment
charm = 1, -- Mind Control, Seduction charm = 1, -- Mind Control, Seduction
@@ -4856,31 +4857,30 @@ CleveRoids.CCMechanics = {
disarm = 3, -- Disarm, Riposte disarm disarm = 3, -- Disarm, Riposte disarm
distract = 4, -- Distract (Rogue ability) distract = 4, -- Distract (Rogue ability)
fear = 5, -- Fear, Psychic Scream, Howl of Terror 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 root = 7, -- Entangling Roots, Frost Nova, Improved Hamstring
pacify = 8, -- Pacify effects pacify = 8, -- Pacify effects
silence = 9, -- Silence, Kick, Counterspell (lockout) silence = 9, -- Silence, Kick, Counterspell (lockout)
sleep = 10, -- Hibernate, Wyvern Sting sleep sleep = 10, -- Hibernate, Wyvern Sting sleep
snare = 11, -- Hamstring, Wing Clip, Crippling Poison snare = 11, -- Hamstring, Wing Clip, Crippling Poison
slow = 11, -- Alias for snare slow = 11, -- Alias for snare
stun = 12, -- Consolidated: Stun(12) + Knockout(14) + Sap(30) stun = 12, -- Stun (Cheap Shot, Kidney Shot, Hammer of Justice)
freeze = 13, -- Freeze effects (Frost Nova freeze) freeze = 13, -- Freeze effects
knockout = 14, -- Knockout (Gouge, Repentance)
bleed = 15, -- Rend, Garrote, Deep Wounds bleed = 15, -- Rend, Garrote, Deep Wounds
polymorph = 17, -- Polymorph (all variants) polymorph = 17, -- Polymorph (all variants)
banish = 18, -- Banish (Warlock) banish = 18, -- Banish (Warlock)
shackle = 20, -- Shackle Undead shackle = 20, -- Shackle Undead
turn = 23, -- Turn effects
horror = 24, -- Death Coil (Warlock), Intimidating Shout (horror) horror = 24, -- Death Coil (Warlock), Intimidating Shout (horror)
interrupt = 26, -- Interrupt mechanic
daze = 27, -- Dazed effects daze = 27, -- Dazed effects
} sap = 30, -- Sap/Sapped mechanic
-- 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)
} }
-- CC types that count as "crowd controlled" (loss of control) -- 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 = { CleveRoids.CCTypesLossOfControl = {
[1] = true, -- charm [1] = true, -- charm
[2] = true, -- disoriented [2] = true, -- disoriented
@@ -4889,12 +4889,12 @@ CleveRoids.CCTypesLossOfControl = {
[10] = true, -- sleep [10] = true, -- sleep
[12] = true, -- stun (Cheap Shot, Kidney Shot, etc.) [12] = true, -- stun (Cheap Shot, Kidney Shot, etc.)
[13] = true, -- freeze [13] = true, -- freeze
[14] = true, -- knockout/gouge (now part of stun group) [14] = true, -- knockout/gouge
[17] = true, -- polymorph [17] = true, -- polymorph
[18] = true, -- banish [18] = true, -- banish
[20] = true, -- shackle [20] = true, -- shackle
[24] = true, -- horror [24] = true, -- horror
[30] = true, -- sap (now part of stun group) [30] = true, -- sap
} }
-- Check if BuffLib is available with full mechanic support -- Check if BuffLib is available with full mechanic support
@@ -4961,19 +4961,6 @@ function CleveRoids.ValidateUnitCC(unit, ccType)
return CleveRoids.ValidateUnitAnyCrowdControl(unit) return CleveRoids.ValidateUnitAnyCrowdControl(unit)
end 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] local mechanic = CleveRoids.CCMechanics[ccTypeLower]
if not mechanic then return false end if not mechanic then return false end
+13 -12
View File
@@ -6025,6 +6025,7 @@ local CC_IMMUNITY_TYPES = {
shackle = true, -- Shackle Undead shackle = true, -- Shackle Undead
horror = true, -- Death Coil horror = true, -- Death Coil
disorient = true, -- Scatter Shot, Blind disorient = true, -- Scatter Shot, Blind
daze = true, -- Daze mechanic
snare = true, -- Hamstring, Wing Clip snare = true, -- Hamstring, Wing Clip
} }
@@ -6051,19 +6052,19 @@ local MECHANIC_TO_CC_TYPE = {
[10] = "sleep", [10] = "sleep",
[11] = "snare", [11] = "snare",
[12] = "stun", [12] = "stun",
[13] = "stun", -- freeze → stun (similar effect) [13] = "freeze",
[14] = "stun", -- knockout/gouge → stun [14] = "knockout",
[17] = "polymorph", [17] = "polymorph",
[18] = "banish", [18] = "banish",
[20] = "shackle", [20] = "shackle",
[24] = "horror", [24] = "horror",
[27] = "disorient", -- daze → disorient [27] = "daze",
[30] = "stun", -- sap → stun [30] = "sap",
} }
-- Mechanic-precise mapping used only for learned NPC immunity. Do not use -- Mechanic-precise mapping used only for learned NPC immunity. Keep it
-- CCMechanicGroups here: Vanilla can distinguish Stun (12), Freeze (13), -- one-to-one: Vanilla can distinguish Stun (12), Freeze (13), Knockout (14)
-- Knockout (14), and Sap (30) immunities independently. -- and Sap (30) immunities independently, so never fold them together here.
local MECHANIC_TO_IMMUNITY_TYPE = { local MECHANIC_TO_IMMUNITY_TYPE = {
[1] = "charm", [1] = "charm",
[2] = "disorient", [2] = "disorient",
@@ -6079,7 +6080,7 @@ local MECHANIC_TO_IMMUNITY_TYPE = {
[18] = "banish", [18] = "banish",
[20] = "shackle", [20] = "shackle",
[24] = "horror", [24] = "horror",
[27] = "disorient", -- Preserve existing daze handling for now [27] = "daze",
[30] = "sap", [30] = "sap",
} }
@@ -7737,7 +7738,7 @@ function CleveRoids.ListCCImmunities(ccType)
local key = "cc_" .. ccType local key = "cc_" .. ccType
if not CC_IMMUNITY_TYPES[ccType] then 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 return
end end
@@ -7788,7 +7789,7 @@ function CleveRoids.ClearCCImmunities(ccType)
local key = "cc_" .. ccType local key = "cc_" .. ccType
if not CC_IMMUNITY_TYPES[ccType] then 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 return
end end
@@ -7811,13 +7812,13 @@ end
function CleveRoids.AddCCImmunity(npcName, ccType, buffName) function CleveRoids.AddCCImmunity(npcName, ccType, buffName)
if not npcName or not ccType then if not npcName or not ccType then
CleveRoids.Print("Usage: /cleveroid addccimmune <npc name> <cctype> [buff name]") CleveRoids.Print("Usage: /cleveroid addccimmune <npc name> <cctype> [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 return
end end
ccType = NormalizeCCImmunityType(ccType) ccType = NormalizeCCImmunityType(ccType)
if not CC_IMMUNITY_TYPES[ccType] then 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 return
end end