Jump to content

Recommended Posts

Posted

Well i was working on this .... and finaly i made it ....!!

 

You can add any item You want ... and wen the player press on it ... it show you some HTML , like Buffer ,teleport etc you can choose :)

 

Well let's start , This code made at l2jfree ... well you can make it and for other packs tested on l2j and work ..:) Just change the imports!

 

Go to gameserver/handler/itemhandlers and create one file like balloni.java  (ppl From Greece Don't Laugh :P )

 

And put this code inside of file ;

 

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;



/**
* @author Cobra
*
*/
public class Balloni 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/Balloni.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       }
    }



    public int[] getItemIds()
    {
    	return ITEM_IDS;
    }
}   

 

Well those done ... now we need to regist those to gameserver/handler ItemHandler.java open it and regist the Balloni like registerItemHandler(new Balloni());

 

Compile Your core and you are done ...!!

 

I have put the mouse coin for this but feel free to change it :P

 

I think is useful for some ppl ... more thinks with java = - your lags on server :)

 

Well cye in next java Modify!

 

Best Regards Cobra!

 

 

 

 

Posted

PS : im talking about your title it's html code not htlm ^^

 

Oh thanks for the correction :P

 

LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL

 

Amazing Share !

 

+1 Karma For This By Me!

 

i will test it soon ! and i add this on my pack :D

 

Thanks Cobra You Are The Best !

 

Well thanks for the karma also we need more java modify .. no lags :)

Posted

When server loading i get this error:

Exception in thread "main" java.lang.NullPointerException
        at com.l2jfree.gameserver.handler.ItemHandler.registerItemHandler(ItemHa
ndler.java:122)
        at com.l2jfree.gameserver.handler.ItemHandler.<init>(ItemHandler.java:10
4)
        at com.l2jfree.gameserver.handler.ItemHandler.getInstance(ItemHandler.ja
va:45)
        at com.l2jfree.gameserver.GameServer.<init>(GameServer.java:352)
        at com.l2jfree.gameserver.GameServer.main(GameServer.java:444)

Posted

When server loading i get this error:

Exception in thread "main" java.lang.NullPointerException
        at com.l2jfree.gameserver.handler.ItemHandler.registerItemHandler(ItemHa
ndler.java:122)
        at com.l2jfree.gameserver.handler.ItemHandler.<init>(ItemHandler.java:10
4)
        at com.l2jfree.gameserver.handler.ItemHandler.getInstance(ItemHandler.ja
va:45)
        at com.l2jfree.gameserver.GameServer.<init>(GameServer.java:352)
        at com.l2jfree.gameserver.GameServer.main(GameServer.java:444)

 

Check  if you have register the Balloni at gameserver/handler ItemHandler.java

 

Like registerItemHandler(new Balloni()); Maybe for that reason it give you this error!

Posted

Check  if you have register the Balloni at gameserver/handler ItemHandler.java

 

Like registerItemHandler(new Balloni()); Maybe for that reason it give you this error!

Yes, i registered it.

EDIT:

Anyway i got working code. Thanks to Vaness11 from l2jfree forum.

package com.l2jfree.gameserver.handler.itemhandlers;

import com.l2jfree.gameserver.handler.IItemHandler;
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.model.L2ItemInstance;
import com.l2jfree.gameserver.model.actor.instance.L2PlayableInstance;


/**
* @author Cobra
*
*/
public class Balloni 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/Balloni.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       }
    }



    public int[] getItemIds()
    {
    	return ITEM_IDS;
    }
}  

But with this item you can't teleport. The bypass -h npc_%objectid%_goto doesnt work with items. So any solution?

Posted

the prob with all this is ..

 

all is dead (links), u must create new event handler for items at

 

requesttobypasstoserver.java

 

for links only (dont work for tp/bufer/gmshop) only to go next page

 

make this

 

after this

else if (_command.startsWith("player_help "))
		{
			playerHelp(activeChar, _command.substring(12));

 

Put This

 

else if (_command.startsWith("player_Balloni "))
		{
			playerBalloni(activeChar, _command.substring(12));

 

After go Down and after this

 

private void playerHelp(L2PcInstance activeChar, String path)
{
        if (path.indexOf("..") != -1)
            return;
        
        StringTokenizer st = new StringTokenizer(path);
        String[] cmd = st.nextToken().split("#");
        
        if (cmd.length > 1)
        {
        	int itemId = 0;
        	itemId = Integer.parseInt(cmd[1]);
        	String filename = "data/html/help/"+cmd[0];
        	NpcHtmlMessage html = new NpcHtmlMessage(1,itemId);
        	html.setFile(filename);
        	activeChar.sendPacket(html);
        }
        else
        {
        	String filename = "data/html/help/"+path;
        	NpcHtmlMessage html = new NpcHtmlMessage(1);
        	html.setFile(filename);
        	activeChar.sendPacket(html);
        }
}

 

ADD THIS

 

private void playerBalloni(L2PcInstance activeChar, String path)
{
        if (path.indexOf("..") != -1)
            return;
        
        StringTokenizer st = new StringTokenizer(path);
        String[] cmd = st.nextToken().split("#");
        
        if (cmd.length > 1)
        {
        	int itemId = 0;
        	itemId = Integer.parseInt(cmd[1]);
        	String filename = "data/html/Teleport/"+cmd[0];
        	NpcHtmlMessage html = new NpcHtmlMessage(1,itemId);
        	html.setFile(filename);
        	activeChar.sendPacket(html);
        }
        else
        {
        	String filename = "data/html/Teleport/"+path;
        	NpcHtmlMessage html = new NpcHtmlMessage(1);
        	html.setFile(filename);
        	activeChar.sendPacket(html);
        }
}

 

at HTML file as action put this

 

<a action="bypass -h player_Balloni name.htm#name">

 

Remember: This is only link for next html page nothing more u cant teleport/takebuff/gmshop

Posted

Yes, i registered it.

EDIT:

Anyway i got working code. Thanks to Vaness11 from l2jfree forum.

package com.l2jfree.gameserver.handler.itemhandlers;

import com.l2jfree.gameserver.handler.IItemHandler;
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.model.L2ItemInstance;
import com.l2jfree.gameserver.model.actor.instance.L2PlayableInstance;


/**
* @author Cobra
*
*/
public class Balloni 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/Balloni.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       }
    }



    public int[] getItemIds()
    {
    	return ITEM_IDS;
    }
}  

But with this item you can't teleport. The bypass -h npc_%objectid%_goto doesnt work with items. So any solution?

 

You need to create a bypass HTLM like  <a action="bypass -h npc_%objectId%_Balloni">Teleport</a>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Hey everyone, I’m thrilled to introduce our upcoming server, Dragon‑Network, built on the powerful Interlude+ chronicle and crafted for serious PvP, balanced progression and community fun. Below you’ll find all the key details — rates, features, event structure, and why this will be your next home for Lineage 2. 📅 Grand Opening November 21, 2025 — mark the date, rally your friends, prepare your gear. The realm opens, and the wars begin. ⚙️ Rates & Server Setup XP: 10× Chronicle: Interlude+ (expanded from our previous server) PvP-focused content, daily events, and reward-rich systems These core settings ensure you’ll feel progress and power, without losing the depth of classic Interlude. 🎯 Features & Highlights Based on our features page: Alternative class change quests: skip the lengthy standard quests by collecting tradable items dropped by monsters. Dragon-Network Full Interlude+ content: Kamaloka, Labyrinth, Pailaka quests, Hellbound Island, S80 items, Attribute system, Isle of Prayer hunting zone, siegeable fortresses and more. Dragon-Network Daily Team vs Team (TvT) events: prove your worth, climb the ranks and earn valuable rewards. Dragon-Network Balanced PvP mechanics: custom sub-stack features, armor mastery rules, optimized skill effects — all to keep the fight fair and skill-based. Dragon-Network Other extras: Raid Bosses with defined respawn times, rich loot systems, improved QOL features like improved buffs, combo songs/dances, tattoo system, etc. Dragon-Network 🎮 Why This Server Matters You’re playing Interlude+, but with modern enhancements — classic content with new mechanics, not a simple resurrect of the old. PvP and events are daily and structured, so you don’t wait weeks to engage. We’ve designed progression to be meaningful: rewards, class changes, content unlocks all move you forward without feeling pay-to-win. Community-first: Whether you enter solo or with friends, you’ll find team action, clans forming, and events where everyone has a chance to shine. 🗺 What to Do Next Visit our website: dragon-network.eu (check out the “Features” tab for full details) Prepare your Master Account, get your clan or buddies ready. On launch day (Nov 21), log in early, grab your spot, participate in the first TvT, and start building your legacy. Get ready — the gates open soon. The grind begins. The battles await. Will you rise to become legend on Dragon-Network? 🐉 Feel free to ask any questions below or share this post with your friends. Let’s make this launch one to remember.
    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Wts adena 1kk = 10$  discord - GODDARDSHOP 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock