Jump to content

Recommended Posts

Posted

.makeaa / .aa
These commands convert all your seal stones ( green, red, blue ) in Ancient Adena. Nothing special at all, but it might be useful for someone.
Tested and working in L2J High Five Chronicle.


 

Spoiler

diff --git a/Data Side/game/data/scripts/handlers/MasterHandler.java b/Data Side/game/data/scripts/handlers/MasterHandler.java
--- a/Data Side/game/data/scripts/handlers/MasterHandler.java    
+++ b/Data Side/game/data/scripts/handlers/MasterHandler.java    
@@ -284,6 +284,7 @@ import handlers.voicedcommandhandlers.Debug;
 import handlers.voicedcommandhandlers.Lang;
 import handlers.voicedcommandhandlers.StatsVCmd;
+import handlers.voicedcommandhandlers.MakeAncientAdena;
 import handlers.voicedcommandhandlers.Wedding;
 
@@ -548,6 +549,7 @@ public class MasterHandler
             (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
             (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
+            MakeAncientAdena.class,
         },
         {
diff --git a/Data Side/game/data/scripts/handlers/voicedcommandhandlers/MakeAncientAdena.java b/Data Side/game/data/scripts/handlers/voicedcommandhandlers/MakeAncientAdena.java
new file mode 100644
+++ b/Data Side/game/data/scripts/handlers/voicedcommandhandlers/MakeAncientAdena.java    
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004-2016 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack 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.
+ * 
+ * L2J DataPack 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 handlers.voicedcommandhandlers;
+
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
+
+/**
+ * Voiced command to exchange all Seal Stones to Ancient Adena.<br>
+ * Created for Share Competition 2018.
+ * @author Benman from MaxCheaters.com
+ */
+public class MakeAncientAdena implements IVoicedCommandHandler
+{
+    private static final int ANCIENT_ADENA = 5575;
+    private static final int BLUE_SEAL_STONE = 6360;
+    private static final int GREEN_SEAL_STONE = 6361;
+    private static final int RED_SEAL_STONE = 6362;
+    private static final String[] commands =
+    {
+        "aa",
+        "makeaa",
+    };
+    
+    @Override
+    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
+    {
+        if (command.equalsIgnoreCase("aa") || command.equalsIgnoreCase("makeaa"))
+        {
+            L2ItemInstance redStones = activeChar.getInventory().getItemByItemId(RED_SEAL_STONE);
+            L2ItemInstance greenStones = activeChar.getInventory().getItemByItemId(GREEN_SEAL_STONE);
+            L2ItemInstance blueStones = activeChar.getInventory().getItemByItemId(BLUE_SEAL_STONE);
+            int count = 0;
+            int aa = 0;
+            if (redStones != null && activeChar.destroyItem("MakeAA", redStones, null, true))
+            {
+                count += redStones.getCount();
+                aa += redStones.getCount() * 10;
+            }
+            if (greenStones != null && activeChar.destroyItem("MakeAA", greenStones, null, true))
+            {
+                count += greenStones.getCount();
+                aa += greenStones.getCount() * 5;
+            }
+            if (blueStones != null && activeChar.destroyItem("MakeAA", blueStones, null, true))
+            {
+                count += blueStones.getCount();
+                aa += blueStones.getCount() * 3;
+            }
+            if (count == 0)
+            {
+                activeChar.sendMessage("You do not have any seal stones to exchange.");
+                return false;
+            }
+            activeChar.addItem("MakeAA", ANCIENT_ADENA, aa, activeChar, true);
+            activeChar.sendMessage("You have successfully exchanged " + count + " seal stones!");
+        }
+        return true;
+    }
+    
+    @Override
+    public String[] getVoicedCommandList()
+    {
+        return commands;
+    }
+}


 

  • Thanks 2
Posted

It can be exploited, you MUST first destroy the item and only if that succeeds you can continue with the new item generation.

 

do this:
 

+            if (redStones != null && activeChar.destroyItem("MakeAA", redStones, null, true))
+            {
+                count += redStones.getCount();
+                aa += redStones.getCount() * 10;
+            }

 

  • Thanks 1
Posted
1 hour ago, xxdem said:

It can be exploited, you MUST first destroy the item and only if that succeeds you can continue with the new item generation.

 

do this:
 


+            if (redStones != null && activeChar.destroyItem("MakeAA", redStones, null, true))
+            {
+                count += redStones.getCount();
+                aa += redStones.getCount() * 10;
+            }

 

Ok thank you. Its better with that way.

Posted
6 hours ago, Solomun said:

Simple and nice  :) Thanks for share.

Yes small and useful as i told.

 

 

6 hours ago, melron said:

far better than the classic multisell for exchanges good job.

Its something different. Thanks melron :)

  • 1 month later...
Posted

 

2 hours ago, motrizer said:

dont give me AA D;

 

 

Maybe your destroyItem returns false, but destroys the item. Try to compare l2jserver destoryItem with the one is in your pack.

Posted (edited)

Edit: in aCis  destroyItem method changes the count of the iteminstance.

 

 

try to use this code and let me know if its working

public class MakeAncientAdena implements IVoicedCommandHandler
{
	
	private static final String[] _voicedCommands =
	{
		"aa",
		"makeaa"
	};
	private static final int ANCIENT_ADENA = 5575;
	private static final int BLUE_SEAL_STONE = 6360;
	private static final int GREEN_SEAL_STONE = 6361;
	private static final int RED_SEAL_STONE = 6362;
	
	@Override
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
	{
		if (command.equalsIgnoreCase("aa") || command.equalsIgnoreCase("makeaa"))
		{
			final L2ItemInstance redStones = activeChar.getInventory().getItemByItemId(RED_SEAL_STONE);
			final L2ItemInstance greenStones = activeChar.getInventory().getItemByItemId(GREEN_SEAL_STONE);
			final L2ItemInstance blueStones = activeChar.getInventory().getItemByItemId(BLUE_SEAL_STONE);
			
			int redStonesCount = 0;
			int blueStonesCount = 0;
			int greenStonesCount = 0;
			
			int count = 0;
			int aa = 0;
			
			if (redStones != null)
			{
				redStonesCount += redStones.getCount();
				if (activeChar.destroyItem("MakeAA", redStones, null, true))
				{
					count += redStonesCount;
					aa += redStonesCount * 10;
				}
			}
			if (greenStones != null)
			{
				greenStonesCount += greenStones.getCount();
				if (activeChar.destroyItem("MakeAA", greenStones, null, true))
				{
					count += greenStonesCount;
					aa += greenStonesCount * 5;
				}
			}
			if (blueStones != null)
			{
				blueStonesCount += blueStones.getCount();
				if (activeChar.destroyItem("MakeAA", blueStones, null, true))
				{
					count += blueStonesCount;
					aa += blueStonesCount * 3;
				}
			}
			if (count == 0)
			{
				activeChar.sendMessage("You do not have any seal stones to exchange.");
				return false;
			}
			activeChar.addItem("MakeAA", ANCIENT_ADENA, aa, activeChar, true);
			activeChar.sendMessage("You have successfully exchanged " + count + " seal stones!");
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return _voicedCommands;
	}
}

 

Edited by melron
Posted
2 minutes ago, melron said:

if you are using aCis Its because destroyItem method changes the count of the iteminstance.

 

try to use this code and let me know if its working

 

 

How does he use aCis since his screenshot is from high five client re? :P

Posted
Just now, Solomun said:

 

How does he use aCis since his screenshot is from high five client re? :P

yy i edited my post :P

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


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