API 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. You may use 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.