Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API IsUsableSpell
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} Determines whether a spell can be used by the player character. usable, nomana = IsUsableSpell("spellName" or spellID or spellIndex[, "bookType"]); ==Arguments== ;spellName : String: name of the spell to check. ;spellIndex : Number: index of a spell in the player's (or pet's) spellbook. ;spellID : Number: SpellID of a spell to check. ;bookType: String: does the spellIndex refer to the player's spellbook (BOOKTYPE_SPELL constant, default), or the pet's spellbook (BOOKTYPE_PET constant). ==Returns== ;usable :Boolean : 1 (true) if the spell is usable, nil otherwise. A spell is not usable if any of the following conditions apply: :* The player hasn't learned the spell :* The player lacks required mana or reagents. :* Reactive conditions haven't been met. ;nomana : Boolean : 1 (true) if the spell can not be cast due to low mana, nil otherwise. ==Example== usable, nomana = IsUsableSpell("Curse of Elements"); if (not usable) then if (not nomana) then message("The spell cannot be cast"); else message("You do not have enough mana to cast the spell"); end else message("The spell may be cast"); end usable, nomana = IsUsableSpell(20, BOOKTYPE_SPELL); print(GetSpellName(20, BOOKTYPE_SPELL) .. " is " .. (usable and "" or "not ") .. " usable.");
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)