Jump to content

Recommended Posts

Posted

http://img266.imageshack.us/img266/3457/itembufferzn6.jpg

 

I found it on l2j forum premaded to l2jfree core hellbaund.

 

1.Aplly patch

Patch:

Index: src/main/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 2)
+++ src/main/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 7)
@@ -26,5 +26,7 @@
import net.sf.l2j.gameserver.datatables.ClanTable;
import net.sf.l2j.gameserver.handler.AdminCommandHandler;
+import net.sf.l2j.gameserver.handler.CustomCommandHandler;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.handler.ICustomCommandHandler;
import net.sf.l2j.gameserver.instancemanager.games.Trivia;
import net.sf.l2j.gameserver.model.GMAudit;
@@ -254,4 +256,17 @@
                     activeChar.processQuestEvent(p.substring(0, idx), p.substring(idx).trim());
             }
+			else if (_command.startsWith("Custom "))
+			{
+				String command = _command.split(" ")[1];
+
+				ICustomCommandHandler ach = CustomCommandHandler.getInstance().getCustomCommandHandler(command);
+				
+				if (ach == null)
+					return;
+				
+				//remove the "Custom" at the beginning
+				command = _command.replace("Custom ", "");
+				ach.useCustomCommand(command, activeChar);
+			}
		else if (_command.startsWith("trivia "))
		{
Index: src/main/java/net/sf/l2j/gameserver/handler/customcommandhandlers/buffItem.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/customcommandhandlers/buffItem.java (revision 7)
+++src/main/java/net/sf/l2j/gameserver/handler/customcommandhandlers/buffItem.java (revision 7)
@@ -0,0 +1,72 @@
+/*
+ * 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.customcommandhandlers;
+
+import java.util.Iterator;
+
+import javolution.text.TextBuilder;
+import net.sf.l2j.gameserver.cache.HtmCache;
+import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.handler.ICustomCommandHandler;
+import net.sf.l2j.gameserver.model.L2Skill;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
+
+/**
+ *
+ *
+ */
+public class buffItem implements ICustomCommandHandler
+{
+    private static final String[] CUSTOM_COMMANDS = {"doBuff"};
+
+	/**
+     * @see net.sf.l2j.gameserver.handler.ICustomCommandHandler#useCustomCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance)
+     */
+    @Override
+    public boolean useCustomCommand(String command, L2PcInstance activeChar)
+    {
+    	if(command.startsWith("doBuff"))
+	    {
+	    	String actualCommand = command.split(" ")[0]; //will not be used :P
+	    	int skillId = Integer.parseInt(command.split(" ")[1]);   
+	    	int skillLevel = Integer.parseInt(command.split(" ")[2]);  
+	    	
+	    	L2Skill skillToCast = SkillTable.getInstance().getInfo(skillId, skillLevel);
+	    	if(skillToCast != null)
+	    	{
+		    	skillToCast.getEffects(activeChar, activeChar);	
+	    	}else
+	    	{
+	    		//lol unknown buff? XD
+	    		//skills can also be added to database for some security....
+	    	}    	
+	    	
+			String content = HtmCache.getInstance().getHtm("data/html/itemBuffer/buffList.html");
+	        NpcHtmlMessage customReply = new NpcHtmlMessage(1);
+	        customReply.setHtml(content);
+	        activeChar.sendPacket(customReply);
+			activeChar.sendPacket( ActionFailed.STATIC_PACKET );
+	    }
+	    return false;
+    }
+
+    public String[] getCustomCommandList()
+    {
+        return CUSTOM_COMMANDS;
+    }
+
+}
Index: src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java (revision 7)
+++ src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java (revision 7)
@@ -0,0 +1,37 @@
+/*
+ * 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 net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * This class ...
+ *
+ * @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:30:09 $
+ */
+public interface ICustomCommandHandler
+{
+	/**
+	 * @param activeChar
+	 * @param command
+	 */
+	public boolean useCustomCommand(String command, L2PcInstance activeChar);
+
+	/**
+	 * this method is called at initialization to register all the item ids automatically
+	 * @return all known itemIds
+	 */
+	public String[] getCustomCommandList();
+}
Index: src/main/java/net/sf/l2j/gameserver/handler/ItemHandler.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 2)
+++ src/main/java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 7)
@@ -28,4 +28,5 @@
import net.sf.l2j.gameserver.handler.itemhandlers.BlessedSpiritShot;
import net.sf.l2j.gameserver.handler.itemhandlers.Book;
+import net.sf.l2j.gameserver.handler.itemhandlers.BuffItems;
import net.sf.l2j.gameserver.handler.itemhandlers.CharChangePotions;
import net.sf.l2j.gameserver.handler.itemhandlers.ChestKey;
@@ -102,4 +103,5 @@
		registerItemHandler(new BeastSoulShot());
		registerItemHandler(new BeastSpice());
+		registerItemHandler(new BuffItems());
		registerItemHandler(new BeastSpiritShot());
		registerItemHandler(new BlessedSpiritShot());
Index: src/main/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/GameServer.java (revision 2)
+++src/main/java/net/sf/l2j/gameserver/GameServer.java (revision 7)
@@ -64,4 +64,5 @@
import net.sf.l2j.gameserver.handler.AdminCommandHandler;
import net.sf.l2j.gameserver.handler.ChatHandler;
+import net.sf.l2j.gameserver.handler.CustomCommandHandler;
import net.sf.l2j.gameserver.handler.ItemHandler;
import net.sf.l2j.gameserver.handler.SkillHandler;
@@ -334,4 +335,5 @@
		UserCommandHandler.getInstance();
		VoicedCommandHandler.getInstance();
+		CustomCommandHandler.getInstance();
		ChatHandler.getInstance();

2.Crate folder in html folder named "itemBuffer" and create html called "buffList"

insert this code:

<html><title>Buffer</title>
<body>
<center>
<td align=center><button value="Noblesse Blessing" action="bypass -h Custom doBuff 1323 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
<table width=230>
</tr>
<tr>
<td align=center><button value="Focus" action="bypass -h Custom doBuff 7041 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Death Whisper" action="bypass -h Custom doBuff 7042 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Haste" action="bypass -h Custom doBuff 7043 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Guidance" action="bypass -h Custom doBuff 7044 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
</tr>
<tr>
<td align=center><button value="Agility" action="bypass -h Custom doBuff 7047 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Acumen" action="bypass -h Custom doBuff 7048 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Decrease Weight" action="bypass -h Custom doBuff 7049 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Might" action="bypass -h Custom doBuff 7050 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Shield" action="bypass -h Custom doBuff 7051 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Magic Barrier" action="bypass -h Custom doBuff 7052 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Vampiric Rage" action="bypass -h Custom doBuff 7053 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Empower" action="bypass -h Custom doBuff 7054 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Wind Walk" action="bypass -h Custom doBuff 7055 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Berserker Spirit" action="bypass -h Custom doBuff 7056 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Greater Might" action="bypass -h Custom doBuff 7057 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Greater Shield" action="bypass -h Custom doBuff 7058 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Wild Magic" action="bypass -h Custom doBuff 7059 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Clarity" action="bypass -h Custom doBuff 7060 1" width=130 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<tr><td></td></tr>
</table>
<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
<br>Midnex(c)
</center>
</body>
</html>

 

 

Posted

O.O that is friking cool mate :^D Nice start

 

Keep up , Btw now i am woundering how to do shop or buffer whit item (is there any guide in mxc?)

Posted
Index: src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java (revision 7)
+++ src/main/java/net/sf/l2j/gameserver/handler/ICustomCommandHandler.java (revision 7)
@@ -0,0 +1,37 @@
+/*
+ * 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 net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * This class ...
+ *
+ * @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:30:09 $
+ */
+public interface ICustomCommandHandler
+{
+	/**
+	 * @param activeChar
+	 * @param command
+	 */
+	public boolean useCustomCommand(String command, L2PcInstance activeChar);
+
+	/**
+	 * this method is called at initialization to register all the item ids automatically
+	 * @return all known itemIds
+	 */
+	public String[] getCustomCommandList();
+}

Posted

Using l2j server interlude latest rev.

Only 1 problem:

My itemhandler.java not look like this,

i mean there isnt any line like thesE:

import net.sf.l2j.gameserver.handler.AdminCommandHandler;

import net.sf.l2j.gameserver.handler.ChatHandler;

import net.sf.l2j.gameserver.handler.ItemHandler;

import net.sf.l2j.gameserver.handler.SkillHandler;

 

registerItemHandler(new BeastSoulShot());

registerItemHandler(new BeastSpice());

registerItemHandler(new BeastSpiritShot());

registerItemHandler(new BlessedSpiritShot());

What Should i do?

My itemhandler.java looks like:

/*

* 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 2, 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, write to the Free Software

* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

* 02111-1307, USA.

*

* http://www.gnu.org/copyleft/gpl.html

*/

package net.sf.l2j.gameserver.handler;

 

import java.util.Map;

import java.util.TreeMap;

 

/**

* This class manages handlers of items

*

* @version $Revision: 1.1.4.3 $ $Date: 2005/03/27 15:30:09 $

*/

public class ItemHandler

{

//private static Logger _log = Logger.getLogger(ItemHandler.class.getName());

 

private static ItemHandler _instance;

 

private Map<Integer, IItemHandler> _datatable;

 

/**

* Create ItemHandler if doesn't exist and returns ItemHandler

* @return ItemHandler

*/

public static ItemHandler getInstance()

{

if (_instance == null)

{

_instance = new ItemHandler();

}

return _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 TreeMap<Integer, 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 <Integer ; 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)

{

// Get all ID corresponding to the item type of the handler

int[] ids = handler.getItemIds();

// Add handler for each ID found

for (int i = 0; i < ids.length; i++)

{

_datatable.put(new Integer(ids), handler);

}

}

 

/**

* Returns the handler of the item

* @param itemId : int designating the itemID

* @return IItemHandler

*/

public IItemHandler getItemHandler(int itemId)

{

return _datatable.get(new Integer(itemId));

}

}

 

  • 7 months later...
  • 2 weeks later...
  • 1 month later...

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

    • @Silvin Thanks    This will be very useful.
    • Hello, everyone. I am an American, looking to start my own server.... I am looking for a dev, to help me build & edit a pride-style server.  Basically, at this point: (being Lineage 2 is a dying game - with botters overtaking) I'm not looking to spend hundreds-thousands of dollars.... Even if it's a cheap not "pride-style" server, I'll be content with that, too. I have everything else as far as Name, Discord, website, and staff - I just need a dev, to help with the files.  Thanks! 🙂 
    • ## SuperPoint Editor   SuperPoint Editor is a practical visual editor for Lineage II PTS 'SuperPoint.bin' files. It is built for people who need to inspect, fix, rebuild, and draw server routes without digging through binary data by hand.   ### What You Can Do   - Open and edit 'SuperPoint.bin' files. - Export BIN data into a readable TXT format. - Save edited data back into a valid BIN file. - Validate routes before saving. - Work with SuperPoint routes, points, directed connections, and path records in tables. - Add, duplicate, delete, and reorder points. - Create direct and reverse connections between route points. - Automatically generate connections between neighboring points. - Edit raw point coordinates: 'X', 'Y', 'Z', 'Index', and 'Delay'. - Keep route names and internal route data organized. - Use either English or Ukrainian interface language.   ### C4 Server Support   Some C4 servers have 'SuperPoint.bin', but do not have 'superpointinfo.txt' in scripts. The editor supports this case directly. When 'superpointinfo.txt' is not found near the BIN file, the editor can open the BIN in C4 mode. In this mode, 'Fstring ID' is disabled because that value belongs to 'superpointinfo.txt', not to the BIN itself. The editor will not generate or modify 'superpointinfo.txt' while working in this mode. This keeps C4 data clean and avoids creating script files that the server does not actually use.   ### superpointinfo.txt Support   For chronicles that do use 'superpointinfo.txt', the editor can load and synchronize it together with the BIN data. When saving, the editor updates route nodes and coordinates while preserving existing metadata such as: - 'npc_name' - 'move_type' - 'fstring_index' - 'social_number' - 'delay' New nodes are generated with safe default values, so existing script metadata is not accidentally wiped.   ### Geodata Tools   The editor can also open converted geodata '.dat' files and display them as a map. This makes route editing much more visual. You can: - Load geodata and inspect the terrain by layer. - Zoom and pan around the map. - Create a new SuperPoint directly from a map cell. - Draw a route by clicking on the geodata. - Drag existing points to new positions. - Automatically snap 'X/Y' to the selected geo cell. - Use the selected geodata layer to fill the point 'Z'. - See all routes on the map or focus only on the selected one. This is especially useful when building new NPC movement paths or correcting bad route coordinates.   ### Connections and Paths   SuperPoint connections are directional. A connection from point '3' to point '2' is not the same as a connection from point '2' to point '3'. The editor makes this explicit by separating: - route points, - directed connections, - and the actual path records used by each connection. For simple cases, it can create direct path records automatically. For more complex movement, you can edit the path points manually. ### Built for Safe Editing The editor includes validation before saving, so common structural problems can be caught before a broken BIN is produced. It also verifies rebuilt BIN files through the converter engine. The goal is simple: edit quickly, but do not silently damage server data.   ### Unknown Field   This small 'Unknown' field is part of the original BIN structure. Most official-looking files keep it as '0', and for regular route editing there is usually no reason to change it. The editor exposes it so nothing from the BIN is hidden or lost. If you do not know exactly what your server uses it for, keep it at '0'. Download
    • NpcGrp não salva no interlúdio e da crítico quando coloca ele no cliente, já testei ele antes.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..