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

    • https://file.kiwi/85ded214#HP0EQ54upx_76JaA90zfOQ    
    • No complicated KYC, instant setup after purchase!  Boost your connection speed and secure your privacy today!  Official Website: https://novproxy.com?kwd=tt-max
    • Passa o conhecimento mano, só mercenários no mundo do l2.
    • I participate in "forum deal" in role middleman. I will advertise free your product with discounted from your "street store" on different forums. I know these forum addresses,i can post your advertisement on different forums.   Street store must be licensed(i will check license through website),store must pay taxes(i will check payment taxes through tax service website). Please note:seller(you) will decide "will like" to buyer or "not will like" total discount(total discount is price your product with discounted  plus my percentage above). Seller(you) decides what will be my percentage .   If you need free advertising,please write me in messenger for contact who are you by nationality and in which country you live. If you owner street store or you employee street store i will advertise free your product from your street store on different forums.   Country Location:i accept all countries except Ukraine. I will not conduct deals with buyers and sellers from Ukraine. I do not cooperate with country Ukraine. If you Ukrainian by nationality or live in Ukraine,ignore this topic.   Shoes,clothing,furniture,bags,televisions,music centers,telephones,laptops,tablets,refrigerators,washing machines,microwaves,fans.   Advertising process. Buyer sees product with discounted. To buyer likes price. Buyer pays my percentage on to payment details guarantor on forum,seller decides what will be my percentage. Buyer and seller through me decide what will be deadline in days for forum transaction(i will either receive money in specified deadline or i won't receive money).   Guarantor on forum notifies me that buyer paid money to payment details guarantor. I'm sending in "forum deal" address "street store" which ready to sell product with discount to buyer. Buyer arrives on given address,enters in street store,finds employee(seller) and asks "in stock?" this product with discount. If this product in stock employee(seller) shows buyer this product,which buyer saw on forum with discount. Buyer inspects product and if to buyer like product,buyer pays money seller and receives receipt for purchase. If buyer product doesn't like,buyer product doesn't purchase,according to clause in "forum questionnaire" seller must register on forum and write in "forum deal" that buyer has declined refused to purchase this product. Guarantor will return money to buyer(in full amount). If you in role seller don't want to register on forum,then advertising won't be(from me) on different forums. How it will be possible to prove that exactly this buyer,exactly from forum,on which this buyer saw my advertising topic,successfully purchased product. When buyer pays my percentage to guarantor on payment details guarantor,buyer writes to guarantor in private message "code word". When buyer meets with seller in store,buyer informs seller exactly same "code word". Then seller registers on forum and sends to guarantor in private message this "code word"(seller will have such right according to clause in "forum questionnaire"). Guarantor confirms to seller that "code word" is correct. If buyer purchases product,but buyer messages in "forum deal" that he not buy this product(buyer is lying in "forum deal"),then according to clause in "forum questionnaire" seller is connected to "forum deal"(i'll let you know via messenger when you need to connect to "forum deal"). Seller sends in "forum deal" "code word" and sends in "forum deal" screenshot receipt about successful sale product(seller will have such right according to clause "forum questionnaire"). On based "code word" and screenshot receipt about successful sale product guarantor makes decision:send money to middleman or return money to buyer.
  • 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..