Jump to content

Press On Item , And it show HTML Code !


Kràtos

Recommended Posts

Yes i got it but so much errors... need exemple for the hole code for exemple.

 

He is the hole file :

 

 

 

* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.handler;

import java.util.Map;

import javolution.util.FastMap;
import net.sf.l2j.gameserver.templates.item.L2EtcItem;

/**
* This class manages handlers of items
*
* @version $Revision: 1.1.4.3 $ $Date: 2005/03/27 15:30:09 $
*/
public class ItemHandler
{
private Map<String, IItemHandler> _datatable;

/**
 * Create ItemHandler if doesn't exist and returns ItemHandler
 * @return ItemHandler
 */
public static ItemHandler getInstance()
{
	return SingletonHolder._instance;
}

/**
 * Returns the number of elements contained in datatable
 * @return int : Size of the datatable
 */
public int size()
{
	return _datatable.size();
}

/**
 * Constructor of ItemHandler
 */
private ItemHandler()
{
	_datatable = new FastMap<String, IItemHandler>();
}

/**
 * Adds handler of item type in <I>datatable</I>.<BR><BR>
 * <B><I>Concept :</I></U><BR>
 * This handler is put in <I>datatable</I> Map <String ; IItemHandler > for each ID corresponding to an item type
 * (existing in classes of package itemhandlers) sets as key of the Map.
 * @param handler (IItemHandler)
 */

public void registerItemHandler(IItemHandler handler)
{
	_datatable.put(handler.getClass().getSimpleName().intern(), handler);
}

/**
 * Returns the handler of the item
 * @param itemId : int designating the itemID
 * @return IItemHandler
 */
public IItemHandler getItemHandler(L2EtcItem item)
{
	if (item == null)
		return null;
	return _datatable.get(item.getHandlerName());
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final ItemHandler _instance = new ItemHandler();
}
}

 

 

I added :

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.handler;

import java.util.Map;

import javolution.util.FastMap;
import net.sf.l2j.gameserver.templates.item.L2EtcItem;

/**
* This class manages handlers of items
*
* @version $Revision: 1.1.4.3 $ $Date: 2005/03/27 15:30:09 $
*/
public class ItemHandler
{
private Map<String, IItemHandler> _datatable;

/**
 * Create ItemHandler if doesn't exist and returns ItemHandler
 * @return ItemHandler
 */
public static ItemHandler getInstance()
{
	return SingletonHolder._instance;
}

/**
 * Returns the number of elements contained in datatable
 * @return int : Size of the datatable
 */
public int size()
{
	return _datatable.size();
}

/**
 * Constructor of ItemHandler
 */
private ItemHandler()
{
	_datatable = new FastMap<String, IItemHandler>();
}

/**
 * Adds handler of item type in <I>datatable</I>.<BR><BR>
 * <B><I>Concept :</I></U><BR>
 * This handler is put in <I>datatable</I> Map <String ; IItemHandler > for each ID corresponding to an item type
 * (existing in classes of package itemhandlers) sets as key of the Map.
 * @param handler (IItemHandler)
 */

public void registerItemHandler(IItemHandler handler)
{
	_datatable.put(handler.getClass().getSimpleName().intern(), handler);
}

/**
 * Returns the handler of the item
 * @param itemId : int designating the itemID
 * @return IItemHandler
 */
public IItemHandler getItemHandler(L2EtcItem item)
{
	if (item == null)
		return null;
	return _datatable.get(item.getHandlerName());
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final ItemHandler _instance = new ItemHandler();
}
               public void registerItemHandler(new Balloni());
{
}

 

But nothing work...

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

i cant get this working on l2j epilogue... ive tryed to addapt the handers but... with no sucess, where have i to put the registerItemHandler(new Balloni()); to make it work? this can make me call a multisell via bypass? anyone gimme a hand here please :) ill apreciate any help

Link to comment
Share on other sites

Hope this works T.T

 

I made this for l2jfreya....

 

### Eclipse Workspace Patch 1.0
#P L2J_DataPackUpdate14-03-2011
Index: data/scripts/handlers/itemhandlers/balloni.java
===================================================================
--- data/scripts/handlers/itemhandlers/balloni.java	(revision 0)
+++ data/scripts/handlers/itemhandlers/balloni.java	(revision 0)
@@ -0,0 +1,46 @@
+package handlers.itemhandlers;
+
+import com.l2jserver.gameserver.cache.HtmCache;
+import com.l2jserver.gameserver.handler.IItemHandler;
+import com.l2jserver.gameserver.model.L2ItemInstance;
+import com.l2jserver.gameserver.model.actor.L2Playable;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+
+
+
+
+/**
+ * @author Cobra
+ *
+ */
+public class balloni implements IItemHandler
+{
+	private static final int[] ITEM_IDS = { 10639 };
+	
+	public void useItem(L2Playable playable, L2ItemInstance item,boolean forceUse)
+    {
+	      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;
+    }
+}
Index: data/scripts/handlers/MasterHandler.java
===================================================================
--- data/scripts/handlers/MasterHandler.java	(revision 7827)
+++ data/scripts/handlers/MasterHandler.java	(working copy)
@@ -154,6 +154,7 @@
import handlers.itemhandlers.BeastSpiritShot;
import handlers.itemhandlers.BlessedSpiritShot;
import handlers.itemhandlers.Book;
+import handlers.itemhandlers.balloni;
import handlers.itemhandlers.Disguise;
import handlers.itemhandlers.Elixir;
import handlers.itemhandlers.EnchantAttribute;
@@ -447,6 +448,7 @@
		ItemHandler.getInstance().registerItemHandler(new EnchantScrolls());
		ItemHandler.getInstance().registerItemHandler(new ExtractableItems());
		ItemHandler.getInstance().registerItemHandler(new Book());
+		ItemHandler.getInstance().registerItemHandler(new balloni());
		ItemHandler.getInstance().registerItemHandler(new SevenSignsRecord());
		ItemHandler.getInstance().registerItemHandler(new ItemSkills());
		ItemHandler.getInstance().registerItemHandler(new ItemSkillsTemplate());

Link to comment
Share on other sites

It dosent works for me :( 2 Errors on the console,  zero on eclipse

 

The method getHtlm(String) from the Tipe HtlmCache is not visible

 

and another one with master handler.java...

 

maybe is because im using epilogue...

 

I wanna make one item that calls a multisell store, can somebody gimme a hand on this? tnx in advance XD

Link to comment
Share on other sites

It dosent works for me :( 2 Errors on the console,  zero on eclipse

 

The method getHtlm(String) from the Tipe HtlmCache is not visible

 

and another one with master handler.java...

 

maybe is because im using epilogue...

 

I wanna make one item that calls a multisell store, can somebody gimme a hand on this? tnx in advance XD

 

boh you want all things ready....

 

===================================================================

--- java/com/l2jserver/gameserver/cache/HtmCache.java (revision 4514)

+++ java/com/l2jserver/gameserver/cache/HtmCache.java (working copy)

@@ -208,7 +208,7 @@

return content;

}

 

- private String getHtm(String path)

+ public String getHtm(String path)

Link to comment
Share on other sites

im still getting errors :S sorry if im not doing this easy... im very new at java yet...

 

Im getting this error on console:

 

error at balloni.java

public class balloni implements IItemHandler

 

The public class balloni must implement the inherited abstract method IItemHandler.useItem(L2Playable, L2ItemInstance)

 

 

PD: ive fallowed the instructions manually, STEP BY STEP, no missing imports, no mising lines

Link to comment
Share on other sites

  • 2 weeks later...

Hope this works T.T

 

I made this for l2jfreya....

 

### Eclipse Workspace Patch 1.0
#P L2J_DataPackUpdate14-03-2011
Index: data/scripts/handlers/itemhandlers/balloni.java
===================================================================
--- data/scripts/handlers/itemhandlers/balloni.java	(revision 0)
+++ data/scripts/handlers/itemhandlers/balloni.java	(revision 0)
@@ -0,0 +1,46 @@
+package handlers.itemhandlers;
+
+import com.l2jserver.gameserver.cache.HtmCache;
+import com.l2jserver.gameserver.handler.IItemHandler;
+import com.l2jserver.gameserver.model.L2ItemInstance;
+import com.l2jserver.gameserver.model.actor.L2Playable;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+
+
+
+
+/**
+ * @author Cobra
+ *
+ */
+public class balloni implements IItemHandler
+{
+	private static final int[] ITEM_IDS = { 10639 };
+	
+	public void useItem(L2Playable playable, L2ItemInstance item,boolean forceUse)
+    {
+	      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;
+    }
+}
Index: data/scripts/handlers/MasterHandler.java
===================================================================
--- data/scripts/handlers/MasterHandler.java	(revision 7827)
+++ data/scripts/handlers/MasterHandler.java	(working copy)
@@ -154,6 +154,7 @@
import handlers.itemhandlers.BeastSpiritShot;
import handlers.itemhandlers.BlessedSpiritShot;
import handlers.itemhandlers.Book;
+import handlers.itemhandlers.balloni;
import handlers.itemhandlers.Disguise;
import handlers.itemhandlers.Elixir;
import handlers.itemhandlers.EnchantAttribute;
@@ -447,6 +448,7 @@
		ItemHandler.getInstance().registerItemHandler(new EnchantScrolls());
		ItemHandler.getInstance().registerItemHandler(new ExtractableItems());
		ItemHandler.getInstance().registerItemHandler(new Book());
+		ItemHandler.getInstance().registerItemHandler(new balloni());
		ItemHandler.getInstance().registerItemHandler(new SevenSignsRecord());
		ItemHandler.getInstance().registerItemHandler(new ItemSkills());
		ItemHandler.getInstance().registerItemHandler(new ItemSkillsTemplate());

 

Thank you Cobra.

Looking for balloni.htm file.

How to make this htm file?

Thanks again^^ And I'm Korean Too.

 

Link to comment
Share on other sites

  • 3 months later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • Is there any free on market programm to hide my ip (connect to a server tat has a dual box max with more boxes)
    • Hello! We would really appreciate it if you tried our proxies cause we have 4G mobile proxies too! Unfortunately the trial version is not available at the moment, but our knowledge base will help you gain valuable experience using Asocks! https://faq.asocks.com/faq/topic/user-guide
    • Hello Friends . I would like to introduce that i have found a method to avoid league hwid ban ( van 152 ) you will get perma ban when detected only at the account you are using like before vanguard release with the method you can script or use the tools you want at many accs as you wish unstoppable without caring about headache or wasting time and energy of flashing bios reset your pc installing fresh windows and using spoofer to change your hardware infos to unlock the hwid ban i have tested it on 5 accs i got them perma banned for using third party tools but not a hwid ban at all hint : ppl regulary get hwid ban in 2nd ban after got banned once before as vanguard working like that only 1 chance free then hwid ban. its so easy to achieve if you are interested dm for details
    • Trustworthy person; hope you find what you're looking for!
    • Customs being added to systextures/animation/texture influences the increase in virtual ram by a very small amount, which means you won't have a headache in the future with critical error issues, unless it's a dubious custom, there are 2 custom weapon packs available for H5 that are "compromised", they didn't make a very good adaptation, one of the packages is the weapons from the goddess of destruction for H5, another is the hero weapons from the goddess of destruction for H5, avoid these customs for your H5 server if you see it on any forum.   Now coming back to your question; one thing that the NCSoft developers never did was add files to their system, probably because they were aware of what could happen when doing that, now think about one thing: the game's system retail itself is no more than 70MB, every time there was an update made by NCSoft they always added the equipment/items/cloaks etc. in their folders intended for that, so why do we do this? I still have my client containing a system with almost 1GB, 1-2h online is the time I can stay online before the ram memory limit, but I have already redone my entire client with customs being destined for textures/systexture/animations, almost all the customs that I had on that client containing a 1GB system I have on my current server, with the difference that I removed everything from the system and critical error is now nothing more than legends, my current server has a total of 220MB in the system folder And theoretically speaking, based on what I've seen, especially on many forums, I believe that the heavier the system folder is, the faster we accelerate the consumption of the client's virtual ram memory, causing countless different types of critical error in one short period of time, in many forums that I've seen on topics involving critical, the solution that stands out the most is about downloading a new clean "system"
  • Topics

×
×
  • Create New...