mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Add [equipset]/[noequipset] conditionals for equipment sets
Checks whether a saved ClassicAPI equipment set is currently equipped, via C_EquipmentSet.GetEquipmentSetInfo's isEquipped flag (wrapped as ClassicAPI.IsEquipmentSetEquipped). Named [equipset] rather than [set] to avoid colliding with the existing tier/item-set piece-count conditional. Supports OR-lists ([equipset:Raid/Farm]) and negation ([noequipset:PvP]). Pairs with the conditional /equipset command: swap with one, branch on the other.
This commit is contained in:
@@ -155,6 +155,25 @@ function API.GetItemSetInfo(setID)
|
||||
return C_Item.GetItemSetInfo(setID)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Equipment Set
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- True if the saved equipment set named `name` is currently equipped -- every
|
||||
-- resolvable item in its target slot (a missing bank-stored piece doesn't
|
||||
-- disqualify, matching C_EquipmentSet.GetEquipmentSetInfo's isEquipped). Name is
|
||||
-- an exact, case-sensitive match per GetEquipmentSetID. Returns false for an
|
||||
-- unknown name or a client without the EquipmentSet API. Powers [equipset]/
|
||||
-- [noequipset]; the swap side is the reclaimed /equipset command.
|
||||
function API.IsEquipmentSetEquipped(name)
|
||||
if not name or name == "" then return false end
|
||||
if type(C_EquipmentSet) ~= "table" then return false end
|
||||
local setID = C_EquipmentSet.GetEquipmentSetID(name)
|
||||
if not setID then return false end
|
||||
local _, _, _, isEquipped = C_EquipmentSet.GetEquipmentSetInfo(setID)
|
||||
return isEquipped and true or false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Spell
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user