Page 1 of 1

Pets gain XP from far away, is this normal ?

Posted: Mon Oct 03, 2011 8:12 pm
by Trev
Hi.
I tryed search, no luck, i tryed search google, no luck either, lots of topics but no one talking about this.

Wolfs and pets gain xp of the player, even if they are so far away you cant see them.

For example, you leave pet in giran, and you run all the way to dion, and kill there, pet will recieve xp.

I dont know if its a bug or if its ok like this.

Anyone knows ? thanks in advance.

Re: Pets gain XP from far away, is this normal ?

Posted: Fri Oct 07, 2011 6:28 pm
by Tryskell
PcStat.java

Code: Select all

public boolean addExpAndSp(long addToExp, int addToSp, boolean useBonuses)
Edit that section to add a isInsideRadius( check :

Code: Select all

            if (!pet.isDead())                pet.addExpAndSp((long) (addToExp * (1 - ratioTakenByPlayer)), (int) (addToSp * (1 - ratioTakenByPlayer)));
Added to that I must add a summon (in L2OFF) which is too far is automatically teleported to you after a while (around 10secs). No clue about pets, to be honest.

Re: Pets gain XP from far away, is this normal ?

Posted: Fri Oct 07, 2011 7:17 pm
by MELERIX
radius in retail is 1000 (party radius)

Re: Pets gain XP from far away, is this normal ?

Posted: Sat Oct 08, 2011 2:29 am
by Tryskell
MELERIX wrote:radius in retail is 1000 (party radius)

Code: Select all

if (!pet.isDead() && pet.isInsideRadius(activeChar, 1000, true, false))        pet.addExpAndSp((long) (addToExp * (1 - ratioTakenByPlayer)), (int) (addToSp * (1 - ratioTakenByPlayer)));
First boolean (true) check Z too (to avoid exploits at ToI or such vertical places).
Second boolean (false) will check >= 1000 instead of > 1000.

Untested, but -1 reason it doesn't work.

Re: Pets gain XP from far away, is this normal ?

Posted: Sat Oct 29, 2011 4:23 am
by Szponiasty
Tryskell wrote:
MELERIX wrote:radius in retail is 1000 (party radius)

Code: Select all

if (!pet.isDead() && pet.isInsideRadius(activeChar, 1000, true, false))        pet.addExpAndSp((long) (addToExp * (1 - ratioTakenByPlayer)), (int) (addToSp * (1 - ratioTakenByPlayer)));
First boolean (true) check Z too (to avoid exploits at ToI or such vertical places).
Second boolean (false) will check >= 1000 instead of > 1000.

Untested, but -1 reason it doesn't work.
isInsideRadius does not check geodata los. so 1000 radius up/down, through walls, cellings, floors ;)

Re: Pets gain XP from far away, is this normal ?

Posted: Mon Nov 07, 2011 3:20 am
by Tryskell
Szponiasty wrote:
Tryskell wrote:
MELERIX wrote:radius in retail is 1000 (party radius)

Code: Select all

if (!pet.isDead() && pet.isInsideRadius(activeChar, 1000, true, false))        pet.addExpAndSp((long) (addToExp * (1 - ratioTakenByPlayer)), (int) (addToSp * (1 - ratioTakenByPlayer)));
First boolean (true) check Z too (to avoid exploits at ToI or such vertical places).
Second boolean (false) will check >= 1000 instead of > 1000.

Untested, but -1 reason it doesn't work.
isInsideRadius does not check geodata los. so 1000 radius up/down, through walls, cellings, floors ;)
What would you need a LoS check on that ? It's exactly as party experience system share. There is no geodata stuff involved, lol. So yeah, 1k radius through anything :P.

Re: Pets gain XP from far away, is this normal ?

Posted: Mon Nov 07, 2011 4:08 am
by MELERIX
Tryskell wrote:First boolean (true) check Z too (to avoid exploits at ToI or such vertical places).
that is not retail like, these things don't have geo check in retail.

Re: Pets gain XP from far away, is this normal ?

Posted: Mon Nov 07, 2011 7:23 am
by Tryskell
MELERIX wrote:
Tryskell wrote:First boolean (true) check Z too (to avoid exploits at ToI or such vertical places).
that is not retail like, these things don't have geo check in retail.
Put false then, I explained the whole method :P.

And you can say whatever you want, current L2J check Z axis. The 4 times it is used, it checks Z axis. It's like smashing your own face with your hand because of wind.

Code: Select all

if (!Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, ddealer, true))
public static boolean checkIfInRange(int range, L2Object obj1, L2Object obj2, boolean includeZAxis)

I agree anyway the check wasn't the best, but still, following current L2J implementation, we got :

Code: Select all

if (!pet.isDead() && Util.checkIfInRange(1000, activeChar, pet, true))        pet.addExpAndSp((long) (addToExp * (1 - ratioTakenByPlayer)), (int) (addToSp * (1 - ratioTakenByPlayer)));
If Z axis mustn't be on, put it false for this one and the 4 existing over the project.

Re: Pets gain XP from far away, is this normal ?

Posted: Mon Nov 07, 2011 4:22 pm
by MELERIX
well I just telling it, because I remember in retail party range don't care about walls/floor (no idea how is working currently in L2J).