Where it is wrong?
Posted: Sat Oct 10, 2009 3:19 pm
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
I have this code :
This is when you click on the item It apears an Html code.... But where it is wrong :S
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
I have this code :
Code: Select all
package handlers.itemhandlers; import net.sf.l2j.gameserver.handler.IItemHandler;import net.sf.l2j.gameserver.cache.HtmCache;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;import net.sf.l2j.gameserver.model.L2ItemInstance;import net.sf.l2j.gameserver.model.actor.L2Playable; public class MagicGemOfLight implements IItemHandler{ private static final int[] ITEM_IDS = {8868}; public void useItem(L2Playable playable, L2ItemInstance item) { if (!(playable instanceof L2PcInstance)) return; L2PcInstance activeChar = (L2PcInstance)playable; int itemId = item.getItemId(); if (itemId == 8868) { String htmFile = "data/html/menu.htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); NpcHtmlMessage infoHtml = new NpcHtmlMessage(1); infoHtml.setHtml(htmContent); activeChar.sendPacket(infoHtml); } } public int[] getItemIds() { return ITEM_IDS; }}