Check if Player has Pet summoned (Gracia 2.1)

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
alehawk
Posts: 50
Joined: Wed Mar 24, 2010 10:42 pm

Check if Player has Pet summoned (Gracia 2.1)

Post 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!!!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

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

Post 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
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
alehawk
Posts: 50
Joined: Wed Mar 24, 2010 10:42 pm

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

Post by alehawk »

thank you!!
Post Reply