castable

Returns true if the spell sent can in fact be cast, false if not.

castable(spellID, unitID / object) : boolean
  1. SpellID from the class spellbooks
  2. See Wowpedia for more information on WoW Unit IDs.
  3. use of object is also supported for unit.

Example

if castable(Frostbolt, 'target') then
return cast(Frostbolt, 'target')
end

Note

The following is reviewed when calling this function:

resolveSpellID(dpellID)
IsSpellKnown(spellID)
UnitExists(unit / object)
distanceCheck(unit, spellID) -- checks spell range from player to target
canSee(unit)
channeling('player')
IsUsableSpell(spellID)
cooldown(spellID)