Bypass Handler tweak ;)

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Bypass Handler tweak ;)

Post 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 :)
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: Bypass Handler tweak ;)

Post 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
Image
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Re: Bypass Handler tweak ;)

Post by papadkostas »

yeah boss :D
i didnt knew where that fit to posted :D
thank you so much :mrgreen:
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Re: Bypass Handler tweak ;)

Post 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:
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: Bypass Handler tweak ;)

Post 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
Image
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Re: Bypass Handler tweak ;)

Post 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?
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: Bypass Handler tweak ;)

Post by BiggBoss »

you may use the InstanceType enum check (preferred) or the instanceof check
Image
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Bypass Handler tweak ;)

Post by JIV »

InstanceType enum check is slower than instanceof
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Re: Bypass Handler tweak ;)

Post 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:
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Bypass Handler tweak ;)

Post by _DS_ »

Code: Select all

@Overridepublic boolean isWarehouse(){return true;} 
Add it to the L2VillageMasterInstance.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
papadkostas
Posts: 128
Joined: Fri Jul 02, 2010 8:34 am
Location: Greece
Contact:

Re: Bypass Handler tweak ;)

Post by papadkostas »

tested and worked :D
Spasiba to all :)
..btw spasiba mean thanks 8)
I'm learning as fast..as roadrunner - Beeep Beeeep
Image
Post Reply