WoW:API GetShapeshiftForm: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API GetShapeshiftForm to API GetShapeshiftForm without leaving a redirect)
 
(17 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Retrieves 0-based index of current Shapeshiftform or Stance.
index = GetShapeshiftForm(flag);


stance = GetShapeshiftForm(unknown);
== Parameters ==


----
<big>'''Arguments'''</big>
;''Arguments''
:(Boolean unknown)


:;type : One of the following:
:; flag: Boolean (Optional) - True if return value is to be compared to a macro's conditional statement. This makes it always return zero for Presences and Auras. False or nil returns an index based on which button to highlight on the shapeshift/stance bar left to right starting at 1.
:::; unknown : the only argument Blizzard sends to this function is boolean 'true'.


----
<big>'''Returns'''</big>
;''Returns''
:;index : Number - one of following:


:; stance: One of the following:
:
::;Any class
::;Any class
::*0 = human form
:::*0 = humanoid form
 
::;Death Knight (only when arg1 is nil)
:::*1 = Blood Presence
:::*2 = Frost Presence
:::*3 = Unholy Presence
 
::;Druid
::;Druid
::*1 = Bear/Dire Bear Form
:::*1 = Bear/Dire Bear Form
::*2 = Aquatic Form
:::*2 = Aquatic Form
::*3 = Cat Form
:::*3 = Cat Form
::*4 = Travel Form
:::*4 = Travel Form
::*5 = Moonkin Form (and maybe tree form, need to be checked by resto druid).
:::*5 = Moonkin Form (balance) / Flight Form (resto/feral/guardian)
:
:::*6 = Flight Form (balance) / Tree Form (resto)
::;Rogue
 
::*1 = Stealth
::;Paladin (only when arg1 is nil)
:
:::*1 = Seal of Truth
:::*2 = Seal of Righteousness
:::*3 = Seal of Insight - Seal of Justice if retribution
:::*4 = Seal of Insight if retribution
::: In 3.3.5a it appears the function returns the currently active Paladin Aura:
:::* 0 - No paladin aura active
:::* 1 - Devotion Aura
:::* 2 - Retribution Aura
:::* 3 - Concentration Aura
:::* ....
 
::;Priest
:::* 1 = Chakra: Chastise or Shadowform
:::* 2 = Chakra: Sanctuary
:::* 3 = Chakra: Serenity
:::* 4 = Spirit of Redemption
 
::; Rogue
:::*1 = Stealth (3.1 - If the player has ''not'' learned the Shadow Dance talent, 1 is returned while in Stealth)
:::*2 = Stealth (3.1 - If the player has learned the Shadow Dance talent, 2 is returned while in Stealth instead of 1)
:::*3 = Shadow Dance (3.1 - This is used while Shadow Dance is active)
:::Note: This seems to have changed again in 3.2. It seems now that 1 is always stealth, and 3 is Shadow Dance. I have not done thorough testing to prove this though, so I'm leaving the 3.1 info.
 
::;Shaman
:::*1 = Ghost Wolf
 
::;Warrior
::;Warrior
::*1 = Battle Stance
:::*1 = Battle Stance
::*2 = Defensive Stance
:::*2 = Defensive Stance
::*3 = Beserker Stance
:::*3 = Berserker Stance
 
== Example ==
local nStance = GetShapeshiftForm();


----
== Notes ==
;''Example''
For some classes the return value is nil during the loading process. You need to wait until UPDATE_SHAPESHIFT_FORMS fires to get correct return values.
nStance = GetShapeshiftForm(true);

Latest revision as of 04:46, 15 August 2023

WoW API < GetShapeshiftForm

index = GetShapeshiftForm(flag);

Parameters[edit]

Arguments

flag
Boolean (Optional) - True if return value is to be compared to a macro's conditional statement. This makes it always return zero for Presences and Auras. False or nil returns an index based on which button to highlight on the shapeshift/stance bar left to right starting at 1.

Returns

index
Number - one of following:
Any class
  • 0 = humanoid form
Death Knight (only when arg1 is nil)
  • 1 = Blood Presence
  • 2 = Frost Presence
  • 3 = Unholy Presence
Druid
  • 1 = Bear/Dire Bear Form
  • 2 = Aquatic Form
  • 3 = Cat Form
  • 4 = Travel Form
  • 5 = Moonkin Form (balance) / Flight Form (resto/feral/guardian)
  • 6 = Flight Form (balance) / Tree Form (resto)
Paladin (only when arg1 is nil)
  • 1 = Seal of Truth
  • 2 = Seal of Righteousness
  • 3 = Seal of Insight - Seal of Justice if retribution
  • 4 = Seal of Insight if retribution
In 3.3.5a it appears the function returns the currently active Paladin Aura:
  • 0 - No paladin aura active
  • 1 - Devotion Aura
  • 2 - Retribution Aura
  • 3 - Concentration Aura
  • ....
Priest
  • 1 = Chakra: Chastise or Shadowform
  • 2 = Chakra: Sanctuary
  • 3 = Chakra: Serenity
  • 4 = Spirit of Redemption
Rogue
  • 1 = Stealth (3.1 - If the player has not learned the Shadow Dance talent, 1 is returned while in Stealth)
  • 2 = Stealth (3.1 - If the player has learned the Shadow Dance talent, 2 is returned while in Stealth instead of 1)
  • 3 = Shadow Dance (3.1 - This is used while Shadow Dance is active)
Note: This seems to have changed again in 3.2. It seems now that 1 is always stealth, and 3 is Shadow Dance. I have not done thorough testing to prove this though, so I'm leaving the 3.1 info.
Shaman
  • 1 = Ghost Wolf
Warrior
  • 1 = Battle Stance
  • 2 = Defensive Stance
  • 3 = Berserker Stance

Example[edit]

local nStance = GetShapeshiftForm();

Notes[edit]

For some classes the return value is nil during the loading process. You need to wait until UPDATE_SHAPESHIFT_FORMS fires to get correct return values.