WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to know if Druid is in cat form? (Classic) (https://www.wowinterface.com/forums/showthread.php?t=57429)

Zam89 09-05-19 12:59 AM

How to know if Druid is in cat form? (Classic)
 
Hi,

hope someone can help me.

How can I get the Info the the Druid is in cat Form or not in classic?

In retail I used for this GetShapeshiftFormId() but this ruction does not exist in classic.

zork 09-05-19 02:43 AM

Have you tried GetShapeshiftForm?
https://wow.gamepedia.com/API_GetShapeshiftForm

Zam89 09-05-19 08:22 AM

Thanks, I will try this.

At the Moment I use this:
Code:

local s = nil
        for i = 1, GetNumShapeshiftForms() do
            if select(3, GetShapeshiftFormInfo(i)) then
                s = i
            end
        end

And check if i is 3 because on the site https://wowwiki.fandom.com/wiki/API_...eshiftFormInfo it Said that CAT is 3 and on your Site it should be 2.

Any ideas?

Thrumbar 09-05-19 03:08 PM

You should note that Wiki is out of date info. Nane was removed for GetShapshifeFormInfo. It is currently

icon, isActive, isCastable, sID = GetShapeshiftFormInfo...

You would need to change the 3 to 2 to detect the active form of the player..


API GetShapeshiftFormInfo

Retrieves information about an available shapeshift form or similar ability.
icon, active, castable, spellID = GetShapeshiftFormInfo(index);


Arguments

index
Number - index, ascending from 1 to GetNumShapeshiftForms()


Returns

icon
String - Path to icon texture

active
Flag - 1 if this shapeshift is currently active, nil otherwise

castable
Flag - 1 if this shapeshift form may be entered, nil otherwise

spellID
Number - ID of the spell that activates this ability

Notes

As well as druid shapeshifting, warrior stances, paladin auras, hunter aspects, death knight presences, and shadowform use this API.


Quote:

Originally Posted by Zam89 (Post 333597)
Thanks, I will try this.

At the Moment I use this:
Code:

local s = nil
        for i = 1, GetNumShapeshiftForms() do
            if select(3, GetShapeshiftFormInfo(i)) then
                s = i
            end
        end

And check if i is 3 because on the site https://wowwiki.fandom.com/wiki/API_...eshiftFormInfo it Said that CAT is 3 and on your Site it should be 2.

Any ideas?


Zam89 09-05-19 03:36 PM

Thanks that was it :)

myrroddin 09-05-19 11:11 PM

Quote:

Originally Posted by Thrumbar (Post 333613)

Returns

icon
String - Path to icon texture

That will need to be updated, assuming you got that from Wowpedia.org's Interface documentation. Icon should be a fileID, which is a number, not a string.

Better double-check.

FYI, instead of WowWiki, please use this instead: https://wow.gamepedia.com/Wowpedia:I..._customization at least for retail.


All times are GMT -6. The time now is 03:56 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI