WoW:API IsUsableSpell: Difference between revisions

m
Move page script moved page API IsUsableSpell to WoW:API IsUsableSpell without leaving a redirect
(→‎Returns: language)
m (Move page script moved page API IsUsableSpell to WoW:API IsUsableSpell without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Determines whether a spell can be used by the player character.
Determines whether a spell can be used by the player character.


  usable, nomana = IsUsableSpell("spellName" or spellIndex[, "bookType"]);
  usable, nomana = IsUsableSpell("spellName" or spellID or spellIndex[, "bookType"]);


==Arguments==
==Arguments==
;spellName : String: name of the spell to check.
;spellName : String: name of the spell to check.
;spellIndex : Number: index of a spell in the player's (or pet's) spellbook.
;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).
;bookType: String: does the spellIndex refer to the player's spellbook (BOOKTYPE_SPELL constant, default), or the pet's spellbook (BOOKTYPE_PET constant).


Line 21: Line 22:
   if (not usable) then
   if (not usable) then
   if (not nomana) then
   if (not nomana) then
     message("The spell can not be cast");
     message("The spell cannot be cast");
   else
   else
     message("You do not have enough mana to cast the spell");
     message("You do not have enough mana to cast the spell");
Anonymous user