Page 1 of 1
Do something on player start
Posted: Fri Jan 28, 2011 2:11 pm
by igoooor
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision
4488:
L2JDP Revision
7761:
Hi, I start to try to understand .java files ...
Now I can for example, do something when a player double clic on an item I defined (with itemhandlers).
Well, now I would like to be able to do something on a player when he connect to the server.
How can I do that ? What files do I need to use ?
If you want more infos, it's just to check if a player got an item in his inventory when he connects
Re: Do something on player start
Posted: Fri Jan 28, 2011 3:37 pm
by SolidSnake
Enterworld.java, anyway why do you want to know if a player has an item?
Code: Select all
// Check if player has item id ID if (activeChar.getInventory().getItemByItemId(ID) != null) { What? }
Re: Do something on player start
Posted: Fri Jan 28, 2011 5:39 pm
by igoooor
That was what I'm looking for thanks,
I want to sethero a char if he has an item, but I'm ok with that part, now it totally works, thank you =)
Re: Do something on player start
Posted: Fri Jan 28, 2011 5:43 pm
by igoooor
One more thing.
As I said, I'm new in all that files, and if I only modify files that are in com.l2jserver.gameserver and I compile,
do I need to replace all the new compiled files or just the l2jserver.jar ?
Re: Do something on player start
Posted: Fri Jan 28, 2011 6:05 pm
by SolidSnake
Only l2jserver.jar
Re: Do something on player start
Posted: Fri Jan 28, 2011 6:09 pm
by igoooor
\o/ nice ^^
Re: Do something on player start
Posted: Fri Jan 28, 2011 6:35 pm
by igoooor
I can put an handler on an etcitem, but not on a equip item, is that normal ?
Look :
Code: Select all
<item id="6673" type="EtcItem" name="Festival Adena"> <set name="icon" val="icon.etc_coin_of_fair_i00" /> <set name="immediate_effect" val="1" /> <set name="material" val="steel" /> <set name="is_tradable" val="false" /> <set name="is_dropable" val="false" /> <set name="is_sellable" val="false" /> <set name="is_depositable" val="false" /> <set name="is_stackable" val="true" /> <set name="handler" val="NoblesseItem" /> </item>
This one works
Code: Select all
<item id="20780" type="Armor" name="Agathion Seal Bracelet - Opera - Sword of Life - 30 day limited period"> <set name="icon" val="BranchSys.icon.br_aga_redblue_pekingopera_i00" /> <set name="default_action" val="equip" /> <set name="bodypart" val="lbracelet" /> <set name="immediate_effect" val="1" /> <set name="material" val="silver" /> <set name="weight" val="150" /> <set name="is_tradable" val="false" /> <set name="is_dropable" val="false" /> <set name="is_sellable" val="false" /> <set name="is_depositable" val="false" /> <set name="is_premium" val="true" /> <set name="is_oly_restricted" val="true" /> <set name="unequip_skill" val="3267-1" /> <set name="item_skill" val="3267-1;21147-1;23132-1;23164-1" /> <set name="time" val="43200" /> <set name="handler" val="NoblesseItem" /> </item>
This one doesn't work.
Do I need to do it with a skill ? I saw i can put handler on skills (with L2SkillType),then put the skill id in item_skill, is that the right way ?
Re: Do something on player start
Posted: Fri Jan 28, 2011 7:59 pm
by igoooor
Just to be sure, are those things true :
Itemhandlers is for etcitem ?
Skillhandlers is for active skill ?
Item_skill (in stats/items/*.XML) is for equipable items only (no etcitems) ?