API GetSpellInfo

From Wowpedia
Jump to: navigation, search

Returns information about a spell.

name, rank, icon, castTime, minRange, maxRange, spellId = GetSpellInfo(spellId or "spellName"[, "spellRank"])

Arguments

One of the following can be used to specify a spell to query:

spellId 
Number - A spell ID to query.

or

spellName 
String - A spell name known to the player character.
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 name of the spell.
rank
Since 8.0, this return value is always nil. 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.
minRange 
Number - The minimum range of the spell.
maxRange 
Number - The maximum range of the spell.
spellId 
Number - The spell's unique ID.

Details

  • Using spellId as the argument will always return the info. Using spellName or spellLink will only return the info if the spell is in your spellbook. Otherwise it will return nil. The values returned by this function are affected by the player's form or stance on relevant spells, such as a warlock's Corruption spell transforming to Doom when Metamorphosis is active.

Patch changes

Battle for Azeroth Patch 8.0.1 (2018-07-17): The rank return value is now always nil.