Jump to content
  • 0

Question

11 answers to this question

Recommended Posts

  • 0
Posted

Create an class that implements the IItemHandler interface, then create the methods required by the interface.

When you do this, create an array of items that you want to register as a lucky chests, and put the logic for extracting into the useItem method..

 

This is the basic code that your itemhandler must contains:

package com.l2jfrozen.gameserver.handler.itemhandlers;

import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;

public class HandlerName implements IItemHandler
{
	private static final int[] ITEM_IDS =
	{
		// Items list
	};
	
	@Override
	public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
	{
		// Logic
	}
	
	@Override
	public int[] getItemIds()
	{
		return ITEM_IDS;
	}
}

You can take a look into the itemhandlers directory, there are many examples of how to extract items.

  • 0
Posted

Create an class that implements the IItemHandler interface, then create the methods required by the interface.

When you do this, create an array of items that you want to register as a lucky chests, and put the logic for extracting into the useItem method..

 

This is the basic code that your itemhandler must contains:

package com.l2jfrozen.gameserver.handler.itemhandlers;

import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;

public class HandlerName implements IItemHandler
{
	private static final int[] ITEM_IDS =
	{
		// Items list
	};
	
	@Override
	public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
	{
		// Logic
	}
	
	@Override
	public int[] getItemIds()
	{
		return ITEM_IDS;
	}
}

You can take a look into the itemhandlers directory, there are many examples of how to extract items.

i ll try it thnx tessa 

  • 0
Posted

Erm, you got ExtractableItem, normally. If L2JFrozen doesn't suck that much.

Well, they have actually :lol:

Guest
This topic is now closed to further replies.


×
×
  • Create New...