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...

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

    • My official facebook profile!: https://www.facebook.com/spectrumL2 Specifications: Revamped L2JACIS revision FROM the core Private project!!! Revision that has been receiving corrections for over 3 years!!! Events already installed in the revision: TVT CTF KTB PARTY FARM SPOIL EVENT CRAZY RATES TOURNAMENT TIME ZONE (INSTANCE) All working correctly!!! SIEGE ESSENTIAL FEATURES: Walls fix Gates fix Flags fix 100% functional: OLYMPIADS: Implemented settings Hero receives enchanted Weapons with equal status PvP Weapons Optional /true/false Hero can acquire all Hero Weapons Optional true/false OTHER IMPLEMENTATIONS: Teleport fixed (directly to Giran) Teleport effect classic Vip skins vip collor name Pack NPCs with effect already configured BOSES already configured Mobs already configured CLASS BALANCE SPECIAL SYSTEM We have a SPECIAL system developed for Class Balance with only 1 digit in XML %tage of configurable debuffs Player limitation system in BOSES or PvP zones BS blocking system in FLEG zones or events Among others dozens of improvements made in the review... price: 390 USD !  OBS: WE CAN CHANGE THE BANNER AND NAME OF THE SERVICE TO THE ONE OF YOUR PREFERENCE BUT THE SETTINGS MUST BE KEPT ANY CHANGES REQUIRE ADDITION        
    • Server is Online – 1,000+ Active Players! We’re excited to announce the addition of a Europe Proxy to improve connectivity for our EU players! Clans can now benefit from VIP Access to help you catch up faster. 🎯 If you're a clan leader with at least 9 active members, join our Discord and open a ticket to claim your VIP rewards!  
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
  • 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