Page 1 of 1

Check if Player has Pet summoned (Gracia 2.1)

Posted: Mon Jun 07, 2010 1:26 pm
by alehawk
Hi!
I want to check if the player has summoned a pet or not.
Does anybody done something like this or knows how to do it?
I managed to give buffs to a summon using st.getPlayer().getPet() but if player doesnt got a pet summoned it will return a python error.
How can I get if player got or not a summoned pet?
Tnx!!!

Re: Check if Player has Pet summoned (Gracia 2.1)

Posted: Mon Jun 07, 2010 1:36 pm
by janiii
you could just check e.g. the quest for a hatchling or wolf, how they check the pet summoned.. (421_LittleWingAdventures, 422_RepentYourSins, ...)

in java:

Code: Select all

if (st.getPlayer().getPet() != null) {    // do something if player has pet summoned}
in jython:

Code: Select all

pet = st.getPlayer().getPet()if pet :    // do something if player has pet summoned, you can use the variable pet as the pet to get pet data or do something with the pet

Re: Check if Player has Pet summoned (Gracia 2.1)

Posted: Fri Jun 11, 2010 2:20 pm
by alehawk
thank you!!