Este Mod abre uma janela de Chat ao usar o item ( O mesmo não some ). Serve para todas as plataformas.
Para alterar a HTML a abrir, altere o destaque em vermelho.
Para alterar o item, altere o destaque em azul.
Vá em gameserver/handler/itemhandler e crie o arquivo Item.java
Código:
package com.l2jfree.gameserver.handler.itemhandlers;
import com.l2jfree.Config;
import com.l2jfree.gameserver.handler.IItemHandler;
import com.l2jfree.gameserver.GameServer;
import com.l2jfree.gameserver.cache.HtmCache;
import com.l2jfree.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfree.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfree.gameserver.handler.IItemHandler;
import com.l2jfree.gameserver.model.L2ItemInstance;
import com.l2jfree.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfree.gameserver.model.actor.instance.L2PlayableInstance;
import com.l2jfree.gameserver.handler.itemhandlers.Item;
/**
* @author Cobra
*
*/
public class Item implements IItemHandler
{
private static final int[] ITEM_IDS = { 10639 };
public void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
if (!(playable instanceof L2PcInstance))
return;
L2PcInstance activeChar = (L2PcInstance)playable;
int itemId = item.getItemId();
if (itemId == 10639)
{
String htmFile = "data/html/Teleport/myhtm.htm";
String htmContent = HtmCache.getInstance().getHtm(htmFile);
NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
infoHtml.setHtml(htmContent);
activeChar.sendPacket(infoHtml);
}
}
public int[] getItemIds()
{
return ITEM_IDS;
}
}
Vá no arquivo gameserver/handler/ItemHandler.java
Código:
registerItemHandler(new SummonItems());
registerItemHandler(new TransformationItems());
registerItemHandler(new WorldMap());
+ registerItemHandler(new Item());
Creditos : Cobra.