Mpstark39365@legacy41559303 (talk | contribs) No edit summary |
m (restrictedapi note) Tag: WoW API docs |
||
(15 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{wowapi}} {{restrictedapi|protected|note=The "pet" action type of [[SecureActionButtonTemplate]] can be used to call this function.}} |
||
− | <center>'''CastPetAction''' </center> |
||
− | |||
Cast the corresponding pet skill. |
Cast the corresponding pet skill. |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | :;index:{{apitype|number}} - pet action bar slot index, ascending from 1. |
||
− | |||
+ | :;target:{{apitype|string?}} : [[UnitId]] - The unit to cast the action on; defaults to "target". |
||
− | ---- |
||
⚫ | |||
− | |||
− | : (index) |
||
− | :; index : Number - The index of the pet skill for query. |
||
− | |||
− | ---- |
||
− | ;''Returns'' |
||
− | |||
− | : nil |
||
− | |||
− | ---- |
||
− | ;''Example'' |
||
− | Cast by specified action name |
||
− | |||
− | for i=1, NUM_PET_ACTION_SLOTS, 1 do |
||
− | local name, subtext, texture, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(i); |
||
− | if ( name == "Sacrifice" ) then |
||
− | CastPetAction(i); |
||
− | end |
||
− | end |
||
− | |||
− | Please notice that this exemple will only works if the sacrifice skill is named "Sacrifice" in the client locale. |
||
− | |||
− | ---- |
||
− | ;''Description'' |
||
− | |||
− | : Cast the corresponding pet skill. Requires a button press. |
||
− | |||
+ | ==Patch changes== |
||
− | ---- |
||
+ | {{Patch 2.0.1|note=Protected.}} |
||
− | {{WoW API}} |
Latest revision as of 07:29, 24 August 2023
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
This function is restricted.
|
Cast the corresponding pet skill.
CastPetAction(index[, target])
Arguments
- index
- number - pet action bar slot index, ascending from 1.
- target
- string? : UnitId - The unit to cast the action on; defaults to "target".
Patch changes
Patch 2.0.1 (2006-12-05): Protected.