Jump to content
  • 0

[Help] l2j Gracia Final hero status item


Question

Posted

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.

 

 

Recommended Posts

  • 0
Posted

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.

  • 0
Posted

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

 

  • 0
Posted

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 ;)

 

  • 0
Posted

Yes, you can do it by Eclipse (if you dont know how - check guides about compiling and Eclipse)

 

 

  • 0
Posted

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.

  • 0
Posted

Use this:

 

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

 

and it for message:

 

activeChar.sendMessage("put message here");
  • 0
Posted
      {

 

         activeChar.setHero(true);

 

         activeChar.broadcastUserInfo();

         //Sennd Message

         activeChar.sendMessage("put message here");

         //Destroy Item after use

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

 

      }

 

  }

  • 0
Posted

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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..