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

    • ============================================================== VIKOS AUTOBOTS — live bots for Lineage 2 servers on Lucera2 Interlude and Classic ============================================================== An empty server loses players. Vikos Autobots fills the world with bots that act like real players: they farm, walk around towns, join clans, fight wars, go to raids, sieges, events and the Olympiad, trade and talk in chat. Installs on top of a Lucera2 build: one .ext.jar + the data/autobots folder + a config. Database tables are created automatically. WHAT THE BOTS DO • Farm zones by level along set routes; they do not steal mobs from players or other bots. Leave town through gatekeepers (custom ones and NPC bypasses too) and come back. • Some bots leave the farm to walk around town while others keep farming, so towns are not empty. They walk, talk to NPCs and sit down to rest (can be turned off for PvP servers). • After a server restart bots carry on where they were: same zone, same route, no mass teleport to town. • Class-based combat AI: fighters, archers, mages, healers, buffers, summoners. Auto parties, healers resurrect the dead. • Real fishing with core skills (cast, Pumping / Reeling, fish fight). Rod by grade, bait and fishing shots are handed out automatically; spots have stands, a bot limit, levels and time. • Gear by class and level, a separate Olympiad set and an "online time" set; custom skills by class and by online time (same idea as time gear). Random enchant, Life Stones, dyes, buffs. Shots, potions, arrows and scrolls restock on their own; bot items never reach the economy. • Clans and alliances with generated crests, clan wars, clan defense, PvP server mode. PvP zones (arena, Coliseum, custom): admin Send or a clock like TvT (14:00;16:00). • Raids and epics (Antharas, Valakas, Baium; more via XML), with a gathering in town or a direct teleport to the boss. Castle sieges, TvT / CTF / DM, Olympiad 1v1 and 3v3, Seven Signs. • Private stores (sell and buy), RU/EN chat, AI chat (Groq or any OpenAI-compatible API), bot replies go through your server chat filter (chatfilters.xml), player PMs forwarded to admin Telegram. • Admin panel: //autobots panel. Online schedule, own AI thread pool built for hundreds of bots online, one commented config and XML files checked at server start. INCLUDED: VIKOS AUTOBOTS CONFIGURATOR (Windows) • A single .exe with Java inside, nothing to install. • Works right on your VPS over SSH/SFTP: edit and save, the files go straight to the server; the old version goes to backup. • World map from server geodata, automatic route building by the core movement rules with checks. • Farm zones, towns, raids, sieges, TvT, PvP zones, fishing spots. • Editors with client icons: equipment (farm / online time / Olympiad), skills (regular and by online time), buffs, Life Stones, supplies, dyes. Finds config mistakes by itself. • Interlude and Classic, RU/EN interface, light and dark theme, F1 help. ============================================================== VIKOS AUTOBOTS — REAL SERVER LOAD Measured ============================================================== Interlude test server on Lucera2, a regular VPS: • 4 vCPU, 8 GB RAM, Debian 13 • Java 17 (Temurin), -Xmx5G • MariaDB -------------------------------------------------------------- RESULTS -------------------------------------------------------------- CPU is a one-minute average for the whole game server process: core, mobs and bots together. 400% = all 4 cores. Bots online Server CPU (of 400%) Share of VPS 1000 ~103% ~26% 1200 ~105% ~26% 1500 ~120-150% ~30-37% • An empty server without bots uses ~40% by itself, so 1000 bots add about one core. • The bot AI itself (all bots together) takes 10-15% of one core for 1000-1500 bots. • Memory is stable, no leaks: - after GC the heap stays at ~2.8-2.9 GB with 800, 1000 and 1200 bots — about the same as the server uses by itself, without bots; - the heap low point does not grow over time: memory does not pile up, it is freed on every garbage collection; - a full night with 1500 bots with no out-of-memory errors (OutOfMemory), the server never crashed; - with -Xmx5G there is more than 2 GB of headroom. • A full night with 1500 bots ran stable. Meanwhile the bots live a full life: farming along routes, walking around towns, fishing, clans, scheduled PvP zones, TvT/CTF, Olympiad and raids. -------------------------------------------------------------- SETTINGS USED FOR THESE NUMBERS -------------------------------------------------------------- • AutobotsIterationDelayMs = 500 A bot thinks twice per second: enough to act like a real player without wasting CPU. • AutobotsMaxBots = 1000-1500 • ai.properties: AiTaskActiveDelay = 500 AggroCheckInterval = 500 Most of the load comes not from the bot code but from the mobs around the bots: bots bring locations to life, and the mobs start checking whom to attack. With these values they check twice per second instead of four times. The load is almost halved, and you can't see the difference: a mob notices its target a fraction of a second later. • MariaDB: innodb_flush_log_at_trx_commit = 2 The database flushes its log to disk once per second instead of after every small query. With 1000+ bots there are many queries, and this removes most of the database load. A standard setting for game servers. • server.properties: AutoDestroyDroppedItemAfter = 120 Drops on the ground disappear after 2 minutes instead of 10. Bots kill a lot, and in 10 minutes tens of thousands of items piled up on the ground: extra memory, extra server work and database deletes. Two minutes is enough for players to pick up their own drops. Rule of thumb: a 4-core VPS handles 1000-1500 bots comfortably. For more, go for 6-8 cores. LICENSE • The license is bound to your VPS IP: the bots run only on the server with that IP. • Send the server IP when you buy. Price: 500$ Contact: Telegram @Vikos177 — https://t.me/Vikos177 Test the bots here: <DOWNLOAD LINK> https://drive.google.com/file/d/1xpOII2X2fsUWekDIJk7POTMWu7ICpHJo/view After purchase you are added to a private Telegram group for clients: news, updates and support. ==============================================================
    • 💻 Supercharge your workflow with Claude Pro & Cursor AI. Clean setups with full warranty included!
    • 📦 Running out of Google Drive space? Upgrade to 5TB + Gemini Pro instantly on your own email.
    • AHAHAHAHAH ? Send it proofs here. I just wanted to sell my stuff, but this crazy Ukrainian just stole my money, and he does this all the time to other people. 
  • 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..