FANDOM


(addded second parameter (see SecureTemplates.lua l. 228 for reference))
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
{{wowapi}}
 
<center>'''CastPetAction''' </center>
 
<center>'''CastPetAction''' </center>
   
 
Cast the corresponding pet skill.
 
Cast the corresponding pet skill.
   
CastPetAction(index);
+
CastPetAction(index, [unit]);
   
 
----
 
----
Line 10: Line 11:
 
: (index)
 
: (index)
 
:; index : Number - The index of the pet skill for query.
 
:; index : Number - The index of the pet skill for query.
  +
  +
: (unit)
  +
:; unit : [[UnitId]] - Optional UnitId
   
 
----
 
----
Line 18: Line 22:
 
----
 
----
 
;''Example''
 
;''Example''
cast by specified action name
+
Cast by specified action name
   
 
for i=1, NUM_PET_ACTION_SLOTS, 1 do
 
for i=1, NUM_PET_ACTION_SLOTS, 1 do
Line 26: Line 30:
 
end
 
end
 
end
 
end
  +
  +
Please notice that this exemple will only works if the sacrifice skill is named "Sacrifice" in the client locale.
   
 
----
 
----
 
;''Description''
 
;''Description''
   
: Cast the corresponding pet skill.
+
: Cast the corresponding pet skill. Requires a button press.
 
----
 
{{Template:WoW API}}
 
[[Category:API Pet Functions|CastPetAction]]
 

Latest revision as of 19:11, February 6, 2007

WoW API < CastPetAction
CastPetAction

Cast the corresponding pet skill.

CastPetAction(index, [unit]);

Arguments
(index)
index 
Number - The index of the pet skill for query.
(unit)
unit 
UnitId - Optional UnitId

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.
Community content is available under CC-BY-SA unless otherwise noted.