Jump to content
  • 0

i need sb good in java developing


removed_001

Question

1st : i want to create a skill

2nd : i want an item that when u press it, it will automatically gives u that skill

 

sb do that for me plz?

and no do that just show me how or tell me the code plz!

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

first : skill guides can be found if you use search

second: you can use this code

 

 

/**

* @author eKo

*

*/

public class ViP implements IItemHandler

{

  private static final int[] ITEM_IDS = { itemID };

 

  public void useItem(L2PlayableInstance playable, L2ItemInstance item)

    {

        if (!(playable instanceof L2PcInstance))

            return;

        L2PcInstance activeChar = (L2PcInstance)playable;

          int itemId = item.getItemId();

       

      if (itemId == itemID)

      {

 

blabla add here skill code.

 

      }

    }

 

     

 

    public int[] getItemIds()

    {

      return ITEM_IDS;

    }

 

the code to add skills you should find out yourself.

 

 

 

Link to comment
Share on other sites

  • 0

  if (itemId == itemID)  <----- look this

 

its for items not for skills :/ plz if u can help me a little more cause i am new in java developing

 

its for the item code if you use xy item you get skills....grr read some guides

Link to comment
Share on other sites

  • 0

to get the skill use

L2Skill sk  = SkillTable.getInstance().getInfo(/*skill id*/, /*skill lvl*/);

activeChar.addSkill(sk, true);

 

EDIT:

 

btw eKo, isnt better to use

     for(i= 0; i< ITEM_IDS.length; i++)
             if (ITEM_IDS[i] == itemid)
             {

                    blabla add here skill code.

              }

Link to comment
Share on other sites

  • 0

/**

* @author eKo

*

*/

public class ViP implements IItemHandler

{

  private static final int[] ITEM_IDS = { itemID };

 

  public void useItem(L2PlayableInstance playable, L2ItemInstance item)

   {

        if (!(playable instanceof L2PcInstance))

           return;

        L2PcInstance activeChar = (L2PcInstance)playable;

         int itemId = item.getItemId();

       

     if (itemId == itemID)

      {

 

  L2Skill sk  = SkillTable.getInstance().getInfo(/*skill id*/, /*skill lvl*/);

  activeChar.addSkill(sk, true);

 

      }

   }

 

   

 

   public int[] getItemIds()

   {

      return ITEM_IDS;

   }

}

 

so it would be like this... (if correct say it and lock the topic.) also (where do i put that code?)

Link to comment
Share on other sites

  • 0

first of all create the skill

go to data/stats/skills

and create a file named "10100-10199.xml" if it doesnt exist

edit it using http://www.l2jserver.com/wiki/Skills

if  you dont have time or dont want to read that all, just copy any skill done b4, and edit it

BTW use skill id 10100 coz i hope its not used yet

so change in the itemhandler's code " /*skill id*/ " with the skill id (10100) and " /*skill lvl*/ " with 1 if you just want to make 1 lvl of the skill

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...