• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Help wih check

Myth

Freebooter
Good afternoon. I need your help again. But this time I need help with game scripts.

1) It is necessary if in the animation of the character there is an animation "sit", then plant it. Otherwise put in the location. The condition for checking a specific animation does not suit me, I need to check the contents of the animation.
2) I know that you can get the total number of Hero's items, but I need to get the number of a certain object and make a check on it.

Thank you.
 
This will get equipped item.id: string sID = GetCharacterEquipByGroup(pchar,BLADE_ITEM_TYPE);

If you further want the index of that, use: int nItem = GetItemIndex(sID);

There is not currently a way to query/investigate if the character has the animation defined. Since Poklon is called with the function bool CharacterPlayAction(ref character, string actionName) from characters_ia.c, you could call it and see if it returns true/false for success/fail. Then if it fails, you know the character doesn't have it, then maybe play something else?

if(!CharacterPlayAction(chr, "poklon"))
CharacterPlayAction(chr, "dialog_stay" + (rand(8)+1));
 
Back
Top