Pets gain XP from far away, is this normal ?

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Trev
Posts: 60
Joined: Tue Aug 23, 2011 5:20 pm

Pets gain XP from far away, is this normal ?

Post 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.
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

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

Post 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.
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

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

Post by MELERIX »

radius in retail is 1000 (party radius)
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

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

Post 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.
User avatar
Szponiasty
Advanced User
Advanced User
Posts: 557
Joined: Mon Apr 21, 2008 1:31 pm
Location: Eastern Poland

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

Post 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 ;)
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

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

Post 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.
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

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

Post 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.
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

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

Post 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.
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

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

Post 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).
Post Reply