GetSpellInfo
Returns information about a spell
name, rank, icon, castTime, minRange, maxRange, spellId = GetSpellInfo(spellId or "spellName"[, "spellRank"])
Arguments
The first argument has two forms, affecting how the function behaves (see details):
- spellId
- Number - Any valid unique spell ID
- spellName
- String - A spell name known to the player character
The optional second argument may accompany either form:
- spellRank
- String - Rank (or subtext) of a spell known to the player character, e.g. "Pig" for pig-transforming variant of
[Polymorph].
Returns
- name
- String - The localized name of the spell.
- rank
- Since 8.0, this return value is always nil.[1] You may use GetSpellSubtext to retrieve the rank of cached spells.
- icon
- Number - (fileID) The spell's icon texture.
- castTime
- Number - The spell's cast time in milliseconds, or 0 for instant spells
- minRange
- Number - The minimum range of the spell, or 0 if not applicable
- maxRange
- Number - The maximum range of the spell, or 0 if not applicable
- spellId
- Number - The spell's unique ID.
Details
- Using spellId as the argument will return info for any valid spellId:
- Spells castable by any player
- Spells castable by any NPC
- Buffs and debuffs regardless if the source was a 'spell', such as Well Fed from eating food.
- Using spellName or spellLink only returns the info if the spell is in your spellbook; otherwise it returns nil.
- The player's form or stance affects return values on relevant spells, such as a warlock's Corruption spell transforming to Doom while Metamorphosis is active.
Patch changes
Patch 8.0.1 (2018-07-17): The
rank
return value is now alwaysnil
.[1]Patch 6.0.2 (2014-10-14): Removed
cost
,isFunnel
, andpowerType
return values
References
- ^ a b Battle for Azeroth Addon Changes forum blue post by Ythisens, 24 Apr 2018