WoW:API GetSpellInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Updated return values for 6.0)
m (1 revision)
Line 10: Line 10:
== Arguments ==
== Arguments ==
<!-- List each argument, together with its type -->
<!-- List each argument, together with its type -->
:(spellId or spellName or spellLink
:spellId or spellName or spellLink


:;spellId : Integer - The global spell number, found on wowhead or through [[API_COMBAT_LOG_EVENT|COMBAT_LOG_EVENT]].
:;spellId : Integer - The global spell number, found on wowhead or through [[API_COMBAT_LOG_EVENT|COMBAT_LOG_EVENT]].
Line 20: Line 20:
: name, rank, icon, castTime, minRange, maxRange
: name, rank, icon, castTime, minRange, maxRange


:; name : String - The name of the spell.
; name : String - The name of the spell.
:; rank : String - The rank of the spell. Returns as an empty string if there is no rank.
; rank : String - The rank line from the tooltip of the spell, e.g. "Rank 2". Returns some other classification (like "Summon" for a summoning spell) or an empty string if there is no rank.
{{cata-inline}}Returns a list of stances for warrior abilities.
; icon : String - The interface path to the icon texture.
:; icon : String - The interface path to the icon texture.
; castTime : Number - The cast time, in milliseconds.
:; castTime : Number - The cast time, in milliseconds.
; minRange : Number - The minimum range of the spell.
:; minRange : Number - The minimum range of the spell.
; maxRange : Number - The maximum range of the spell.
:; maxRange : Number - The maximum range of the spell.
 


== Details ==
== Details ==

Revision as of 22:27, 15 May 2020

WoW API < GetSpellInfo

Get information about a spell.

name, rank, icon, castTime, minRange, maxRange 
= GetSpellInfo(spellId or spellName or spellLink)


Arguments

spellId or spellName or spellLink
spellId
Integer - The global spell number, found on wowhead or through COMBAT_LOG_EVENT.
spellName
String - The Name of the spell.
spellLink
String - The formatted link to the spell [Note: this appears to be broken, see Discussion page]


Returns

name, rank, icon, castTime, minRange, maxRange
name
String - The name of the spell.
rank
String - The rank line from the tooltip of the spell, e.g. "Rank 2". Returns some other classification (like "Summon" for a summoning spell) or an empty string if there is no rank.
icon
String - The interface path to the icon texture.
castTime
Number - The cast time, in milliseconds.
minRange
Number - The minimum range of the spell.
maxRange
Number - The maximum range of the spell.

Details

cost, powerType, and isFunnel was removed in 6.0

Arguments

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.