Do something on player start

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Do something on player start

Post 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
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Do something on player start

Post 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?       }
Image
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Re: Do something on player start

Post 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 =)
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Re: Do something on player start

Post 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 ?
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Do something on player start

Post by SolidSnake »

Only l2jserver.jar
Image
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Re: Do something on player start

Post by igoooor »

\o/ nice ^^
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Re: Do something on player start

Post 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 ?
igoooor
Posts: 31
Joined: Fri Aug 03, 2007 11:40 am

Re: Do something on player start

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