GetSpellInfo

From Wowpedia
Jump to: navigation, search
Game Flavors
Links
Patch
Added in 2.4.0 / 1.13.2

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

  • Battle for Azeroth Patch 8.0.1 / API (2018-07-17): The rank return value is now always nil.[1]
  • Warlords of Draenor Patch 6.0.2 / API (2014-10-14): Removed cost, isFunnel, and powerType return values

References