Jump to content
  • 0

[Help] l2j Gracia Final hero status item


JustLikeMe

Question

How can i make an item e.g. gold dragon to give hero status?

I've made this:

 

<?xml version="1.0" encoding="UTF-8"?>

<list>

<item id="3481" name="Gold Dragon">

<a action="bypass -h admin_manualhero"></a>

</item>

</list>

 

its at gameserver\data\stats\etcitem  i dont think this works

I dunno where to find this item so i made this. How can i do this?

 

Edit:3481 is gold dragon's id.

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

How can i make an item e.g. gold dragon to give hero status?

I've made this:

 

<?xml version="1.0" encoding="UTF-8"?>

<list>

<item id="3481" name="Gold Dragon">

<a action="bypass -h admin_manualhero"></a>

</item>

</list>

 

its at gameserver\data\stats\etcitem  i dont think this works

I dunno where to find this item so i made this. How can i do this?

 

Edit:3481 is gold dragon's id.

 

 

 

You cant do it as you thought (by skill) You have to create new ITEM HANDLER, check CoŏŁΐŠ link.

Link to comment
Share on other sites

  • 0

i checked your link cooli, look this http://www.maxcheaters.com/forum/index.php?topic=34266.msg862969#msg862969 i have errors with HeroItem.java . Its

import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
from HeroItem.java ,

ItemHandler.getInstance().registerItemHandler(new HeroItem());
from MasterHandler.java ,

public class HeroItem implements IItemHandler
from HeroItem.java and

public void useItem(L2PlayableInstance playable, L2ItemInstance item)
from HeroItem.java

I use l2j Gracia Final, i think in gracia its different code plz check it.

Edit: Here the errors:

 

aaaaaaeg.jpg

 

Link to comment
Share on other sites

  • 0

Sury, i will help you. First of all, everything is explained in this error, ok but i will help you anyway. Download Eclipse, import there your Sources and open this handler java file, and you can check your mistakes and also this eclipse should tell you few tips about how to fix it. And here is my advice.

 

You have to fix imports patch in your new handler java file.

 

Because here you have for example:

 

import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance

 

and on latest L2JFiles it should be:

 

import com.l2jserver.gameserver.model.actor.instance.L2PlayableInstance

 

Im not sure but:

 

Check it.

 

Note: Next time read carefully your error logs and try to interpret them ;)

 

Link to comment
Share on other sites

  • 0

Ok here it is, thanks to janii from l2jserver forums.

 

HeroItem.java

/*

 

* This program is free software: you can redistribute it and/or modify it under

 

* the terms of the GNU General Public License as published by the Free Software

 

* Foundation, either version 3 of the License, or (at your option) any later

 

* version.

 

*

 

* This program is distributed in the hope that it will be useful, but WITHOUT

 

* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

 

* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more

 

* details.

 

*

 

* You should have received a copy of the GNU General Public License along with

 

* this program. If not, see <http://www.gnu.org/licenses/>.

 

*/

 

package handlers.itemhandlers;

 

 

 

import net.sf.l2j.gameserver.handler.IItemHandler;

 

import net.sf.l2j.gameserver.model.L2ItemInstance;

 

import net.sf.l2j.gameserver.model.actor.L2Playable;

 

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

 

 

 

 

 

/**

 

*

 

* @author HanWik

 

*/

 

public class HeroItem implements IItemHandler

 

{

 

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

 

 

 

  public void useItem(L2Playable playable, L2ItemInstance item)

 

  {

 

     if (!(playable instanceof L2PcInstance))

 

        return;

 

     L2PcInstance activeChar = (L2PcInstance)playable;

 

      int itemId = item.getItemId();

 

 

 

      if (itemId == 3481) // Item to become hero

 

      {

 

         activeChar.setHero(true);

 

         activeChar.broadcastUserInfo();

 

      }

 

  }

 

 

 

  /**

 

   * @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds()

 

   */

 

  public int[] getItemIds()

 

  {

 

     return ITEM_IDS;

 

  }

 

}

 

The only problem is that when you use the gold dragon it doesnt dissapear from inventory it.

Also how can it sends a message to the player "You will remain hero until restart" and how to set some effect like white light on your character, like other servers.

Link to comment
Share on other sites

  • 0

Use this:

 

playable.destroyItem("Consume", item.getObjectId(), 1, null, false);

 

and it for message:

 

activeChar.sendMessage("put message here");
Link to comment
Share on other sites

  • 0
      {

 

         activeChar.setHero(true);

 

         activeChar.broadcastUserInfo();

         //Sennd Message

         activeChar.sendMessage("put message here");

         //Destroy Item after use

         playable.destroyItem("Consume", item.getObjectId(), 1, null, false);

 

      }

 

  }

Link to comment
Share on other sites

  • 0

Thanks for fast reply. One more thing, can you add another 1 piece of code to set some lighting effect like other servers when someone uses the item?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...