Page 1 of 1

item drop like adena

Posted: Wed Nov 09, 2011 3:10 am
by gmakhs
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 5069:
L2JDP Revision 8518:

hello everyone im trying to set some items share in party like adena .
i tryed use search in forum and i found some nice posts but they just helped me to get the idea how to do it.y.java

i opened L2Party.java
and i edited this line

Code: Select all

if (item.getItemId() == 57 
and i edited like this

Code: Select all

 if (item.getItemId() == 57 && (item.getItemId() ==6393 && (item.getItemId() ==3483 && (item.getItemId() ==6673 && (item.getItemId() ==9143 && (item.getItemId() ==6393))))))
i did a lot of test i even searched google so i tryed with == or with != but nothing worked... with == none of items shared in party not event adena with != only adena shared like normal.... can anyone help me?


google says it must look like this

Code: Select all

if (x == 2 && y != 2) {  System.out.println("Both conditions are true.");}

Re: item drop like adena

Posted: Wed Nov 09, 2011 3:49 am
by Zoey76
I already did and share this months ago: viewtopic.php?f=73&t=21266

Re: item drop like adena

Posted: Wed Nov 09, 2011 9:22 am
by Zoey76
In order to answer your question:
Think in the English phrase that describe what you want to do:
"if Item Id equals 57 or Item Id equals Other Id or Item Id equals Some other Id then do something."

This is translated to Java as:

Code: Select all

 if (itemId == 57 || itemId == otherId ||itemId == someOtherId)    doSomething(); 
You want the item Id to be one of them, not all at the same time, you can easily see why that won't make sense:
If x equals 3 and x equals 4 then do something.
You cannot request a variable to have the two different values at the same time.

I hope this help you out getting a bit of boolean logic. :wink:

Re: item drop like adena

Posted: Wed Nov 09, 2011 1:32 pm
by gmakhs
ok now i understand a little bit :) i saw your share during search bit i was wanna try it alone and without use confing ffiles:) now i have another problem
if i can understand right this code gets item id and appears the massage like you gain xxx adena or you gain xxx this item
after i used your suggestion party loot is working but whatever you pick up from this items appear as adena if this code gets the item id where is the mistake?

Code: Select all

if (item.getCount() > 1)        {            SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.C1_OBTAINED_S3_S2);            msg.addString(target.getName());            msg.addItemName(item);            msg.addItemNumber(item.getCount());            broadcastToPartyMembers(target, msg);        }

Re: item drop like adena

Posted: Tue Oct 16, 2012 2:59 pm
by alexiszero
I can finally show me how he did it????

Re: item drop like adena

Posted: Sat Sep 14, 2013 6:36 pm
by TeNaCiOuS
ty ^^_