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;
+    }
+}


 

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;
+            }

 

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

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

    • Hello guys, As you can understand I don't want to share yet many information regarding the project while it is under heavy development stage, I can understand your curiosity about  "What might be" however think it like a secret sauce from a restaurant that does not actually share the recipe from it, but of course once we have something in our hands we will provide any logical information. If you are interested that much you can always take a look in our discord: https://discord.com/invite/mightyproject Hello there, No it is not Unreal Engine 5, well for this we will need some good budget and a skilled team based on UE5. Thank you looking foward seeing you playing in our project soon, and trust me it will be mighty! https://discord.com/invite/mightyproject
    • Hello guys, There isn't much information to share yet regarding the project. We've been working on it for the past few months with the goal of creating something unique and truly different. Over the years, I've seen countless projects with the same features repeated over and over again. This time, we're aiming to build something solid and unlike anything players have seen before. Since many of you have been asking about Unreal Engine 5, I'd like to clear that up. Building something on UE5 requires a very large team and a lot of resources to accomplish properly. Right now, we can't say anything regarding UE5. Maybe in the future, who knows? Tzelal is a real life friend of mine. I've known him for many years, and he's a great guy. Right now, he's looking for people who genuinely want to be part of this project. The team is working 20+ hours a day, every single day. I'm often on calls with them, watching their progress and seeing everything they're creating. So, if anyone is wondering what's happening behind the scenes, my answer is simple, something amazing. I know many of you have been asking about features and other details, but we don't want to spoil anything just yet. There is still a lot of work to be done, and we'd rather reveal things when they're ready. Once everything is in the state we want, we'll start releasing sneak peeks. If you'd like to join the project, feel free to send Tzelal a private message so you can go through an interview. Please don't waste his time, or yours, if you're not genuinely interested. Now, I'd like to make a few things clear. No, we're not making another generic server with the same old features and the same old engine that you've seen for years. Our goal is to build something completely different, something that players haven't experienced before. And no, we're not going to give up on development. We work every day, and we keep pushing forward even when some challenges seem difficult. We're committed to making this project the best it can be. That's all for now. There will be much more to share once we're ready to show it. Thanks for your time, everyone.
    • 📢 MMORE.DEV — ONE SLOT AVAILABLE FOR A PROJECT   1 slot has opened up for long-term cooperation. We welcome anyone interested — we're looking for projects built for long-term collaboration, not one-off tasks.   🎯 We're ready to take on projects for these chronicles:   Essence Classic   Current protocols: 520, 542, 557+ One example of our developers' work — the Aden.Land team.   📋 We're also accepting preliminary discussions for the Main (GOD) branch — if you're planning a project on this chronicle, reach out in advance so we can go over the details and timeline. _______________________________________________________________________   For any questions — PM us or reach out on Telegram: https://t.me/L2scripts
    • 🔥 L2SCRIPTS BIG SALE 🔥 30-50% OFF ALL LEGACY PRODUCTS! Special offer for MaxCheaters users! Promotion runs from July 25 to August 1 inclusive _____________________________________________________    🎁 Promo details: 30-50% discount on all legacy studio products Source codes, ready-made builds, technical support — everything you've been wanting to grab at a great price. ___________________________________________________________________________   ⚡ Why you should hurry: A discount like this across the whole lineup is a rare event in our 20 years on the market This offer is strictly time-limited — exactly 7 days, no extensions Available only for MaxCheaters users Support slots are limited. ____________________________________________________ ✅ Proven quality — 20 years in the L2 market ✅ Full range of chronicles and ready-made solutions ✅ Personal support from our team ____________________________________________________   🌐 Our websites: L2-scripts.com — https://l2-scripts.com Mmore.dev — https://mmore.dev Telegram for contact: https://t.me/L2scripts ____________________________________________________   Don't miss your chance! In 7 days prices go back to normal — grab what you need at the best price in the studio's history. ➡️ Browse the product catalog: https://l2-scripts.com For any questions — PM us or check the support thread.
  • 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..