Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use
viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Punisher
Posts: 45 Joined: Tue Sep 01, 2009 6:59 pm
Post
by Punisher » 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 :
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; }}
This is when you click on the item It apears an Html code.... But where it is wrong :S
XavierElf
Posts: 92 Joined: Wed May 14, 2008 3:39 am
Location: Russia
Post
by XavierElf » Sat Oct 10, 2009 7:18 pm
And what's wrong? What does not work?
Sry for my bad english...
Punisher
Posts: 45 Joined: Tue Sep 01, 2009 6:59 pm
Post
by Punisher » Sat Oct 10, 2009 9:48 pm
it doesnt open html
Probe
Posts: 915 Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:
Post
by Probe » Sat Oct 10, 2009 10:02 pm
I really have no idea if this will work...
I think it won't because you need an
NPC Object Id to send this packet...
Code: Select all
if (itemId == 8868){ String path = "data/html/menu.htm"; NpcHtmlMessage infoHtml = new NpcHtmlMessage(item.getObjectId(),""); infoHtml.setFile(path); activeChar.sendPacket(infoHtml);}
but you could also try this I guess...
Code: Select all
if (itemId == 8868){ String path = "data/html/menu.htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); TuturialShowHtml infoHtml = new TutorialShowHtml(htmContent); activeChar.sendPacket(infoHtml);}