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
| Name | Type | What it does |
|---|---|---|
self | RMAddon | Rotation Master addon instance (implicit with colon calls). |
spellid | number | Stored spell ID to resolve. |
ranked | boolean | nil | True to require this exact rank; false or nil follows the available rank. |
Returns
| 1 | number | nil | Resolved spell ID, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Availability 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
- Any Spell Available (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, value.ranked) - Any Spell Charges (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, value.ranked) - Any Spell Cooldown (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, value.ranked) - Any Spell In Range (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, value.ranked) - Any Spell Recharge Time (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, value.ranked) - Assisted Combat Rotation Spell (evaluate)
local spellid, why = addon:Widget_GetSpellId(value.spell, value.ranked) - Assisted Combat Suggestion (evaluate)
local spellid, why = addon:Widget_GetSpellId(value.spell, value.ranked) - Pet Spell Active or Pending (evaluate)
local spellid, reason = addon:Widget_GetSpellId(value.spell, false)
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
SpellData(builtin:Conditions/common.lua:SpellData)
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