WoW:API CastSpell: Difference between revisions
Jump to navigation
Jump to search
(Caveat) |
(→Note) |
||
Line 20: | Line 20: | ||
Use "spell" or SpellBookFrame.booktype as the spellbookType for any non-pet spell. The id is counted from 1 through all spell types (tabs on the right side of SpellBookFrame). Pet spells also start from 1. (See example above). The CastSpell function can not be used outside Blizzard-signed code. | Use "spell" or SpellBookFrame.booktype as the spellbookType for any non-pet spell. The id is counted from 1 through all spell types (tabs on the right side of SpellBookFrame). Pet spells also start from 1. (See example above). The CastSpell function can not be used outside Blizzard-signed code. | ||
It was previous claimed that this could still be used to open craft windows and activate lock picking, but opening craft windows with an unprotected call is no longer possible. Lock picking is as of yet unconfirmed. |
Revision as of 11:40, 4 September 2008
This function is PROTECTED, and can only be called from Blizzard code.
|
Casts a specificed spell
CastSpell(spellID, spellbookType);
Arguments
- spellID
- Integer - Spell ID.
- spellbookType
- String - Spellbook type. Valid values are "spell" (BOOKTYPE_SPELL) and "pet" (BOOKTYPE_PET). All players use "spell". Hunters and Warlocks may have additional tabs on the bottom when pets are summoned. Warlocks have Demon, which corresponnds to "pet" spellbook type.
Example
CastSpell(1, "spell");
- Result
-
- Casts the first spell listed in the spellbook (usually Alchemy or Attack).
Note
Use "spell" or SpellBookFrame.booktype as the spellbookType for any non-pet spell. The id is counted from 1 through all spell types (tabs on the right side of SpellBookFrame). Pet spells also start from 1. (See example above). The CastSpell function can not be used outside Blizzard-signed code.
It was previous claimed that this could still be used to open craft windows and activate lock picking, but opening craft windows with an unprotected call is no longer possible. Lock picking is as of yet unconfirmed.