Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Returns spell info.

name, rank, icon, castTime, minRange, maxRange, spellID, originalIcon
    = GetSpellInfo(spell)
    = GetSpellInfo(index, bookType)

Arguments[]

spell
number|string - Spell ID or Name. When passing a name requires the spell to be in your Spellbook.
Spellbook args  
index
number - Spellbook slot index, ranging from 1 through the total number of spells across all tabs and pages.
bookType
string - BOOKTYPE_SPELL or BOOKTYPE_PET depending on if you wish to query the player or pet spellbook.
Internally the game only tests if this is equal to "pet" and treats any other string value as "spell".
Constant Value Description
BOOKTYPE_SPELL "spell" The General, Class, Specs and Professions tabs[1]
BOOKTYPE_PET "pet" The Pet tab

Returns[]

name
string - The localized name of the spell.
rank
string - Always returns nil. Refer to GetSpellSubtext() for retrieving the rank of spells on Classic.
icon
number : FileID - The spell icon texture.
castTime
number - Cast time in milliseconds, or 0 for instant spells.
minRange
number - Minimum range of the spell, or 0 if not applicable.
maxRange
number - Maximum range of the spell, or 0 if not applicable.
spellID
number - The ID of the spell.
originalIcon
number : FileID - The original icon texture for this spell.

Details[]

  • The player's form or stance may affect return values on relevant spells, such as a warlock's Corruption spell transforming to Doom while Metamorphosis is active.
  • When dealing with base spells that have been overridden by another spell, the icon return will represent the icon of the overriding spell, and originalIcon the icon of the base spell.
    • For example, if a Rogue has learned Ability ironmaidens convulsiveshadows [Gloomblade] then any queries for Ability backstab [Backstab] will yield Gloomblades' icon as the icon return, and the original icon for Backstab would be exposed through the originalIcon return value.

Example[]

/dump GetSpellInfo(2061) -- "Flash Heal", nil, 135907, 1352, 0, 40, 2061

Some spell data - such as subtext and description - are load on demand. You can use SpellMixin:ContinueOnSpellLoad() to asynchronously query the data.

local spell = Spell:CreateFromSpellID(139)

spell:ContinueOnSpellLoad(function()
	local name = spell:GetSpellName()
	local desc = spell:GetSpellDescription()
	print(name, desc) -- "Renew", "Fill the target with faith in the light, healing for 295 over 15 sec."
end)

Patch changes[]

Dragonflight Patch 10.0.0 (2022-10-25): Added originalIcon return value.
Battle for Azeroth Patch 8.0.1 (2018-07-17): The rank return value is now always nil.[1]
Warlords of Draenor Patch 6.0.2 (2014-10-14): Removed cost, isFunnel, powerType return values.

References[]

Advertisement