Reference › Function reference › Conditions

Conditions.common.Widget_GetSpellId

public

Call as

addon:Widget_GetSpellId(spellid, ranked)

Available directly through addon; no dependency is needed.

What it does

Resolve the spell identifier stored by a condition. With exact rank enabled the supplied ID is retained; otherwise ranked Classic clients resolve the currently known rank through the spell catalog. Returns nil and an availability reason if resolution cannot be completed.

Arguments

NameTypeWhat it does
selfRMAddonRotation Master addon instance (implicit with colon calls).
spellidnumberStored spell ID to resolve.
rankedboolean | nilTrue to require this exact rank; false or nil follows the available rank.

Returns

1number | nilResolved spell ID, or nil when unavailable.
2string | nilAvailability reason when resolution fails; nil on success.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

and 17 more: Pet Spell Available (evaluate), Pet Spell Charges (evaluate), Pet Spell Cooldown (evaluate), Pet Spell Cast History (evaluate), Pet Spell Cast History Time (evaluate), Pet Spell In Range (evaluate), Pet Spell Recharge Time (evaluate), Spell Active or Pending (evaluate), Spell Auto-Repeat Active (evaluate), Spell Available (evaluate), Spell Charges (evaluate), Spell Cooldown (evaluate), Spell Proc Glow (evaluate), Spell Cast History (evaluate), Spell Cast History Time (evaluate), Spell In Range (evaluate), Spell Recharge Time (evaluate)

Dependencies

Source

Conditions/common.lua, line 37. Read only in game; Duplicate makes an editable copy.

Conditions.common.Widget_GetSpellId(self, spellid, ranked)
    if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
        if not ranked then
            local resolved, reason = SpellData:GetSpellId(spellid)
            return resolved, reason or (not resolved and "spell-data-unavailable" or nil)
        end
    end
    return spellid

Back to Function reference