Page 1 of 1

Bypass Handler tweak ;)

Posted: Tue Jan 04, 2011 3:40 pm
by papadkostas
Hello every body.. :D
Today i realized that on my Service's Npc that is instance of L2VillageMaster,
On clan's warehouse option that i made..when i try to deposit/widthdraw from clan's warehouse..
nothings happens when i press ok..
What i mean?
The windows just dissapears and nothing goes out/in clan's warehouse!
But if i use admin character..it works perfect!
This is the edited bypass handler of ClanWarehouse.java line:46

Code: Select all

 if (!(target instanceof L2WarehouseInstance) && !(target instanceof L2ClanHallManagerInstance) && !(target instanceof L2VillageMasterInstance))            return false; 
And here the bypass handler of ClanWarehouse.java line:46 non edited.

Code: Select all

 if (!(target instanceof L2WarehouseInstance) && !(target instanceof L2ClanHallManagerInstance))            return false; 
I'm pretty sure that i forgot something ..but my knowledge on L2j is just so tiny..
I tryed enough to find it by my self..but after 2 hours of searching i gave up :x
Thanks for your time :)

Re: Bypass Handler tweak ;)

Posted: Tue Jan 04, 2011 5:17 pm
by BiggBoss
/trunk/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/SendWareHouseDepositList.java

Code: Select all

         final L2Npc manager = player.getLastFolkNPC();        if ((manager == null                || !manager.isWarehouse()                || !manager.canInteract(player)) && !player.isGM())            return; 
/trunk/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/SendWareHouseWithDrawList.java

Code: Select all

         final L2Npc manager = player.getLastFolkNPC();        if ((manager == null                || !manager.isWarehouse()                || !manager.canInteract(player)) && !player.isGM())            return;  
btw, wrong section :P

Re: Bypass Handler tweak ;)

Posted: Tue Jan 04, 2011 6:19 pm
by papadkostas
yeah boss :D
i didnt knew where that fit to posted :D
thank you so much :mrgreen:

Re: Bypass Handler tweak ;)

Posted: Tue Jan 04, 2011 10:56 pm
by papadkostas
wow..boss,i removed
"&& !player.isGM()"
but again..when i use wh
and select items to deposit or widtdraw
when i press confirm :arrow: window dissapear and its like nothing hapened :roll:

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 12:22 am
by BiggBoss
is not to remove the gm condition, but about to increase the scope of

Code: Select all

 !manager.isWarehouse() 
prolly, your npc isnt a warehouse. You may add a || condition to accept also your kind of npc

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 1:14 am
by papadkostas

Code: Select all

         final L2Npc manager = player.getLastFolkNPC();if ((manager == null                 || !manager.isWarehouse()                 || !manager.isVillageMaster()                  || !manager.canInteract(player)) && !player.isGM())return; 
hell yeah .. jk this this is wrong.. :lol:
in L2Npc doesnt exist a public boolean for VillageMaster :mrgreen:
..or i'm wrong?

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 1:33 am
by BiggBoss
you may use the InstanceType enum check (preferred) or the instanceof check

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 9:49 am
by JIV
InstanceType enum check is slower than instanceof

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 10:29 am
by papadkostas

Code: Select all

        if ((manager == null                || !manager.isWarehouse()                || !(manager instanceof L2VillageMasterInstance)                || !manager.canInteract(player)) && !player.isGM())            return;
i think this gonna work :D
going to try :wink:

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 1:01 pm
by _DS_

Code: Select all

@Overridepublic boolean isWarehouse(){return true;} 
Add it to the L2VillageMasterInstance.

Re: Bypass Handler tweak ;)

Posted: Wed Jan 05, 2011 3:57 pm
by papadkostas
tested and worked :D
Spasiba to all :)
..btw spasiba mean thanks 8)