ariss100 Posted January 10, 2015 Posted January 10, 2015 How do I creat an item like a lucky chest it will contain items and there will be a chance to take some kind of items ..
0 ariss100 Posted January 10, 2015 Author Posted January 10, 2015 By creating an itemhandler for it. is there a guide (how to ? )
0 Tessa Posted January 10, 2015 Posted January 10, 2015 is there a guide (how to ? ) Which server pack you use?
0 ariss100 Posted January 10, 2015 Author Posted January 10, 2015 Which server pack you use? i use l2j frozen
0 Tessa Posted January 10, 2015 Posted January 10, 2015 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 ariss100 Posted January 10, 2015 Author Posted January 10, 2015 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 Tryskell Posted January 11, 2015 Posted January 11, 2015 Erm, you got ExtractableItem, normally. If L2JFrozen doesn't suck that much.
0 Tessa Posted January 11, 2015 Posted January 11, 2015 Erm, you got ExtractableItem, normally. If L2JFrozen doesn't suck that much. Well, they have actually :lol:
0 SweeTs Posted January 11, 2015 Posted January 11, 2015 Check the "Reagent Punch" item and do the same with your new item :)
Question
ariss100
How do I creat an item like a lucky chest it will contain items and there will be a chance to take some kind of items ..
11 answers to this question
Recommended Posts