Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(added an new test macro , couldn't get the old to work)
m (fixing typo "our" should be "out")
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
  +
{{wowapi}}__NOTOC__
<center><b[[>API CastShapeshiftForm</b> - <i>Submitted by [[/User:Naliya|Naliya]]</i></center><br>
 
  +
{{protectedapi|2.0.1|For alternatives, try [[API_SecureTemplates|Secure Template]] or the new [[Conditional slash commands#/cast|/cast]].}}
<p>Casts Shapeshift on yourself. This is class dependant - not all classes have special abilites.
+
Casts Shapeshift on yourself. This is class dependent - not all classes have special abilities.
</p>
 
<pre>CastShapeshiftForm(#);</pre>
 
   
  +
CastShapeshiftForm(index);
----
 
<p><b><i>Arguments</i></b><br>
 
<br>(# in this case relates to the different forms)<br>
 
Druid<br>
 
*1 = Bear/Dire Bear Form<br>
 
*2 = Aquatic Form<br>
 
*3 = Cat Form<br>
 
*4 = Travel Form<br>
 
*5 = Moonkin Form<br><br>
 
Rogue<br>
 
*1 = Stealth<br><br>
 
Warrior<br>
 
*1 = Battle Stance<br>
 
*2 = Defensive Stance<br>
 
*3 = Beserker Stance<br>
 
</p>
 
   
  +
== Parameters ==
----
 
<p><b><i>Returns</i></b><br>
 
<br>
 
*Nil</p><br>
 
   
  +
=== Arguments ===
----
 
 
;index : relates to the different forms:
<p><b><i>Example</i></b><br>
 
<br><pre>CastShapeshiftForm(1);</pre><br>
 
<b><i>Result</i></b><br>
 
<br>Shapeshifts caster into Bear Form.<br></p>
 
<br>Note, casting the spell again changes back to caster form. So, for instance;<br>
 
<pre>if (GetNumShapeshiftForms()==1) then CastShapeshiftForm(1);end;</pre><br>
 
<b><i>Result</i></b><br>
 
<br>In this case, the script checks if you're in Bear/Dire Bear form, and if so, casts the spell to change you back to Caster form.
 
<br>It has the same restrictions as other casting spells in that the trigger event needs to involve a keystroke or mouse click.
 
   
 
:;Druid
 
:*1 = Bear/Dire Bear Form
 
:*2 = Aquatic Form
 
:*3 = Cat Form
 
:*4 = Travel Form
 
:*5 = Moonkin Form
  +
:
 
:;Rogue
 
:*1 = Stealth
  +
:
 
:;Warrior
 
:*1 = Battle Stance
 
:*2 = Defensive Stance
 
:*3 = Beserker Stance
   
// i could not get the above macro to work. it might be broken , if you have the same problem as me try the following macro
 
   
  +
=== Returns ===
"/script icon, name, active = GetShapeshiftFormInfo(X);if (active==1) then CastShapeshiftForm(1);end;"
 
   
  +
:'''nil'''
where X is the # of the shape (1 for bear)
 
   
   
  +
== Example ==
 
CastShapeshiftForm(1);
   
  +
=== Result ===
{{API/Uncategorized}}
 
 
Shapeshifts caster into Bear Form.
  +
  +
  +
== Note ==
 
Note, casting the spell again changes back to caster form. So, for instance;
 
if (GetNumShapeshiftForms()==1) then CastShapeshiftForm(1);end;
 
In this case, the script checks if you're in Bear/Dire Bear form, and if so, casts the spell to change you back to Caster form.
 
It has the same restrictions as other casting spells in that the trigger event needs to involve a keystroke or mouse click.
  +
  +
  +
To use a particular shape in a '''macro''' and avoiding error messages, use:
  +
 
/script icon, name, active = GetShapeshiftFormInfo('''index''');if (active==1) then CastShapeshiftForm('''index''');end;
  +
 
where '''index''' is the number of the shape as given above.
  +
  +
  +
  +
== Example ==
  +
This Example shows how to return to your human form out of any other form.
  +
for i=1, GetNumShapeshiftForms() do
  +
_, name, active = GetShapeshiftFormInfo(i);
  +
if( active ~= nil ) then
  +
DEFAULT_CHAT_FRAME:AddMessage("SQS: leaving '"..name.."'");
 
CastShapeshiftForm(i)
  +
break;
  +
end
  +
end

Revision as of 18:04, 16 May 2010

Casts Shapeshift on yourself. This is class dependent - not all classes have special abilities.

 CastShapeshiftForm(index);

Parameters

Arguments

index
relates to the different forms:
Druid
  • 1 = Bear/Dire Bear Form
  • 2 = Aquatic Form
  • 3 = Cat Form
  • 4 = Travel Form
  • 5 = Moonkin Form
Rogue
  • 1 = Stealth
Warrior
  • 1 = Battle Stance
  • 2 = Defensive Stance
  • 3 = Beserker Stance


Returns

nil


Example

 CastShapeshiftForm(1);

Result

Shapeshifts caster into Bear Form.


Note

Note, casting the spell again changes back to caster form. So, for instance;

 if (GetNumShapeshiftForms()==1) then CastShapeshiftForm(1);end;

In this case, the script checks if you're in Bear/Dire Bear form, and if so, casts the spell to change you back to Caster form. It has the same restrictions as other casting spells in that the trigger event needs to involve a keystroke or mouse click.


To use a particular shape in a macro and avoiding error messages, use:

 /script icon, name, active = GetShapeshiftFormInfo(index);if (active==1) then CastShapeshiftForm(index);end;

where index is the number of the shape as given above.


Example

This Example shows how to return to your human form out of any other form.

 for i=1, GetNumShapeshiftForms() do
    _, name, active = GetShapeshiftFormInfo(i);
    if( active ~= nil ) then
       DEFAULT_CHAT_FRAME:AddMessage("SQS: leaving '"..name.."'");
       CastShapeshiftForm(i)
       break;
    end
 end