package calypso;
import javolution.util.FastList;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
import scripts.items.IItemHandler;
import scripts.items.ItemHandler;
//ну вроде, но тут хз
import net.sf.l2j.gameserver.datatables.ItemTable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
public class donateItem1 implements IItemHandler {
// ид сундука
private static final int[] ITEM = { 19052 };
private static final FastList<Integer[]> ITEMS = new FastList<Integer[]>();
static {
// список итемов,
// ид, кол-во
ITEMS.add(new Integer[] {20005, 1});
ITEMS.add(new Integer[] {20006, 1});
ITEMS.add(new Integer[] {20007, 1});
ITEMS.add(new Integer[] {20008, 1});
ITEMS.add(new Integer[] {20009, 1});
ITEMS.add(new Integer[] {10000, 1});
ITEMS.add(new Integer[] {10001, 1});
ITEMS.add(new Integer[] {10002, 1});
ITEMS.add(new Integer[] {10003, 1});
ITEMS.add(new Integer[] {10004, 1});
ITEMS.add(new Integer[] {19012, 1});
ITEMS.add(new Integer[] {20192, 1});
ITEMS.add(new Integer[] {30002, 1});
ITEMS.add(new Integer[] {11510, 1});
ITEMS.add(new Integer[] {11503, 1});
}
@Override
public int[] getItemIds() {
return ITEM;
}
@Override
public void useItem(L2PlayableInstance user, L2ItemInstance item, boolean ctrl) {
if (!user.isPlayer() || !user.destroyItemByItemId("chest_open", ITEM[0], 1, user, true))
return;
L2PcInstance player = user.getPlayer();
for(Integer[] pair : ITEMS)
{
item_reward = ItemTable.getInstance().createItem("chest_open", pair[0], pair[1], user, true);
player.getInventory().addItem(item_reward);
item_reward.setEnchantLevel(80);
}
}
public static void main(String[] args) {
ItemHandler.getInstance().registerItemHandler(new donateItem1());
}
}