Jump to content

Level Zones Areas With Commands.


Recommended Posts

Commands: .lvl20 / .lvl40 / .lvl60 / .lvl75

 

config:
# Specified reward item rnd qty
ChampionRewardItemQty = 1
+
+# ----------------------------------------------
+#  Level Up Areas
+# ----------------------------------------------
+# Custom Level Zones. (.lvl20)
+Lvl20CommandAllow = True
+# Enter your spawn Location.
+lvl20_X = x
+lvl20_Y = y
+lvl20_Z = z
+Level20Messenge = You are in 20 Level Area.
+
+# Custom Level Zones. (.lvl40)
+Lvl40CommandAllow = True
# Enter your spawn Location.
+lvl40_X = x
+lvl40_Y = y
+lvl40_Z = z
+Level20Messenge = You are in 40 Level Area.
+
+# Custom Level Zones. (.lvl60)
+Lvl60CommandAllow = True
# Enter your spawn Location.
+lvl60_X = x
+lvl60_Y = y
+lvl60_Z = z
++Level20Messenge = You are in 60 Level Area.
+
+# Custom Level Zones. (.lvl75)
+Lvl75CommandAllow = True
# Enter your spawn Location.
+lvl75_X = x
+lvl75_Y = y
+lvl75_Z = z
+Level20Messenge = You are in 75 Level Area.
+
=====
Index: sf/l2j/config.java
       public static int L2JMOD_CHAMPION_REWARD_QTY;
+	public static String LVL20_MESSAGE;
+	public static String LVL40_MESSAGE;
+	public static String LVL60_MESSAGE;
+	public static String LVL75_MESSAGE;
+    public static boolean LVL20_COMMAND_ALLOW;
+    public static boolean LVL40_COMMAND_ALLOW;
+    public static boolean LVL60_COMMAND_ALLOW;
+    public static boolean LVL75_COMMAND_ALLOW;
+	public static int LVL20_X;
+	public static int LVL20_Y;
+	public static int LVL20_Z;
+	public static int LVL40_X;
+	public static int LVL40_Y;
+	public static int LVL40_Z;
+	public static int LVL60_X;
+	public static int LVL60_Y;
+	public static int LVL60_Z;
+	public static int LVL75_X;
+	public static int LVL75_Y;
+	public static int LVL75_Z;


                  L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                LVL20_COMMAND_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("Lvl20CommandAllow", "false"));
+                LVL40_COMMAND_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("Lvl40CommandAllow", "false"));
+                LVL60_COMMAND_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("Lvl60CommandAllow", "false"));
+                LVL75_COMMAND_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("Lvl75CommandAllow", "false"));
+                LVL20_X = Integer.parseInt(L2JModSettings.getProperty("lvl20_X", "x));
+                LVL20_Y = Integer.parseInt(L2JModSettings.getProperty("lvl20_Y", "y"));
+                LVL20_Z = Integer.parseInt(L2JModSettings.getProperty("lvl20_Z", "z"));
+                LVL40_X = Integer.parseInt(L2JModSettings.getProperty("lvl40_X", "x));
+                LVL40_Y = Integer.parseInt(L2JModSettings.getProperty("lvl40_Y", "y"));
+                LVL40_Z = Integer.parseInt(L2JModSettings.getProperty("lvl40_Z", "z"));
+                LVL60_X = Integer.parseInt(L2JModSettings.getProperty("lvl60_X", "x"));
+                LVL60_Y = Integer.parseInt(L2JModSettings.getProperty("lvl60_Y", "y"));
+                LVL60_Z = Integer.parseInt(L2JModSettings.getProperty("lvl60_Z", "z"));
+                LVL75_X = Integer.parseInt(L2JModSettings.getProperty("lvl75_X", "x"));
+                LVL75_Y = Integer.parseInt(L2JModSettings.getProperty("lvl75_Y", "y"));
+                LVL75_Z = Integer.parseInt(L2JModSettings.getProperty("lvl75_Z", "z"));
+                LVL20_MESSAGE = L2JModSettings.getProperty("Level20Messenge", "You have been teleported to Farm Zone 1!");
+                LVL40_MESSAGE = L2JModSettings.getProperty("Level40Messenge", "You have been teleported to Farm Zone 2!");
+                LVL60_MESSAGE = L2JModSettings.getProperty("Level60Messenge", "You have been teleported to PvP Zone 1!");
+                LVL75_MESSAGE = L2JModSettings.getProperty("Level75Messenge", "You have been teleported to PvP Zone 2!");




=====
Index: net.sf.l2j.gameserver.handler.VoicedCommandHandler.java

import java.util.logging.Logger;

+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.LevelZones;

import javolution.util.FastMap;


private VoicedCommandHandler()
{
	_datatable = new FastMap<String, IVoicedCommandHandler>();
+		if(Config.LVL20_COMMAND_ALLOW || Config.LVL40_COMMAND_ALLOW || Config.LVL60_COMMAND_ALLOW || Config.LVL75_COMMAND_ALLOW)
+		{
+			registerVoicedCommandHandler(new LevelZones());
+		}
}

public void registerVoicedCommandHandler(IVoicedCommandHandler handler)

 

Create a New Class LevelZone.java

=====
Index: net.sf.l2j.gameserver.handler.voicedcommandhandlers.LevelZones.java

/*
* 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.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.SetupGauge;
import net.sf.l2j.gameserver.ThreadPoolManager;

@SuppressWarnings("unused")
public class LevelZones implements net.sf.l2j.gameserver.handler.IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS =
{
		"lvl20", "lvl40", "lvl60", "lvl75"
};

@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	int placex;
	int placey;
	int placez;
	String message;

	if(command.equalsIgnoreCase("lvl20") && Config.LVL20_COMMAND_ALLOW)
	{
		placex = Config.LVL20_X;
		placey = Config.LVL20_Y;
		placez = Config.LVL20_Z;
		message = Config.LVL20_MESSAGE;
	}
	else if(command.equalsIgnoreCase("lvl40") && Config.LVL40_COMMAND_ALLOW)
	{
		placex = Config.LVL40_X;
		placey = Config.LVL40_Y;
		placez = Config.LVL40_Z;
		message = Config.LVL40_MESSAGE;
	}
	else if(command.equalsIgnoreCase("lvl60") && Config.LVL60_COMMAND_ALLOW)
	{
		placex = Config.LVL60_X;
		placey = Config.LVL60_Y;
		placez = Config.LVL60_Z;
		message = Config.LVL60_MESSAGE;
	}
	else if(command.equalsIgnoreCase("lvl75") && Config.LVL75_COMMAND_ALLOW)
	{
		placex = Config.LVL75_X;
		placey = Config.LVL75_Y;
		placez = Config.LVL75_Z;
		message = Config.LVL75_MESSAGE;
	}
	else
		return false;

	if(activeChar.isInJail())
	{
		activeChar.sendMessage("Sorry,you are in Jail!");
		return false;
	}
	else if(activeChar.isInOlympiadMode())
	{
		activeChar.sendMessage("Sorry,you are in the Olympiad now.");
		return false;
	}
	else if(activeChar.isInDuel())
	{
		activeChar.sendMessage("Sorry,you are in a duel!");
		return false;
	}
	else if(activeChar.inObserverMode())
	{
		activeChar.sendMessage("Sorry,you are in the observation mode.");
		return false;
	}
	else if(activeChar.isFestivalParticipant())
	{
		activeChar.sendMessage("Sorry,you are in a festival.");
		return false;
	}
	else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
	{
		activeChar.sendMessage("Sorry,PK player can't use this.");
		return false;
	}
	else if(activeChar.isDead())
	{
		activeChar.sendMessage("Sorry,Dead player can't teleport.");			
                        return false;
	}
	else if(activeChar.isFakeDeath())
	{
		activeChar.sendMessage("Sorry,on fake death mode can't use this.");
		return false;
	}
	else if(activeChar.atEvent)
	{
		activeChar.sendMessage("Sorry,you are on event now.");
		return false;
	}

	SetupGauge sg = new SetupGauge(SetupGauge.BLUE, 15000);
	activeChar.sendPacket(sg);
	sg = null;
	activeChar.setIsImobilised(true);

	ThreadPoolManager.getInstance().scheduleGeneral(new teleportTask(activeChar, placex, placey, placez, message), 15000);

	return true;
}

@Override
public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}

class teleportTask implements Runnable
{
	private final L2PcInstance _activeChar;
	private final int _x;
	private final int _y;
	private final int _z;
	private final String _message;

	teleportTask(L2PcInstance activeChar, int x, int y, int z, String message)
	{
		_activeChar = activeChar;
		_x = x;
		_y = y;
		_z = z;
		_message = message;
	}

	@Override
	public void run()
	{
		if(_activeChar == null)
			return;

		_activeChar.teleToLocation(_x, _y, _z);
		_activeChar.sendMessage(_message);
		_activeChar.setIsImobilised(false);
	}
}
}

Link to comment
Share on other sites

activeChar.setIsImobilised(true);

_activeChar.setIsImobilised(false);

 

I think that's useless since it takes no time to do:

 

_activeChar.teleToLocation(_x, _y, _z);

 

not?

Link to comment
Share on other sites

activeChar.setIsImobilised(true);

_activeChar.setIsImobilised(false);

 

I think that's useless since it takes no time to do:

 

_activeChar.teleToLocation(_x, _y, _z);

 

not?

And of course takes time.

Link to comment
Share on other sites

Ah sorry so.

It's common to immobilize the player before teleport on IL? Never saw it, sorry if I'm wrong.

good share :)

Yes there is, but the problem? not stopping nor with esc.

When player is on this mode, can't stop the teleport.

 

And Thank you dude.

Link to comment
Share on other sites

implements net.sf.l2j.gameserver.handler.IVoicedCommandHandler

 

Delete the net.sf.l2j.gameserver.handler

 

Sorry but as i can see code is a mess.It can be done in less lines..

 

GoodLuck

Link to comment
Share on other sites

Hello, i could really use this for my server, i think i know how to apply this patch the only thing i am not sure about is where i put the config i know what to do with everything under that thanks. L2J High Five

 

config:

# Specified reward item rnd qty

ChampionRewardItemQty = 1

+

+# ----------------------------------------------

+#  Level Up Areas

+# ----------------------------------------------

+# Custom Level Zones. (.lvl20)

+Lvl20CommandAllow = True

+# Enter your spawn Location.

+lvl20_X = x

+lvl20_Y = y

+lvl20_Z = z

+Level20Messenge = You are in 20 Level Area.

+

+# Custom Level Zones. (.lvl40)

+Lvl40CommandAllow = True

# Enter your spawn Location.

+lvl40_X = x

+lvl40_Y = y

+lvl40_Z = z

+Level20Messenge = You are in 40 Level Area.

+

+# Custom Level Zones. (.lvl60)

+Lvl60CommandAllow = True

# Enter your spawn Location.

+lvl60_X = x

+lvl60_Y = y

+lvl60_Z = z

++Level20Messenge = You are in 60 Level Area.

+

+# Custom Level Zones. (.lvl75)

+Lvl75CommandAllow = True

# Enter your spawn Location.

+lvl75_X = x

+lvl75_Y = y

+lvl75_Z = z

+Level20Messenge = You are in 75 Level Area.

+

Link to comment
Share on other sites

Hello, i could really use this for my server, i think i know how to apply this patch the only thing i am not sure about is where i put the config i know what to do with everything under that thanks. L2J High Five

 

config:

# Specified reward item rnd qty

ChampionRewardItemQty = 1

+

+# ----------------------------------------------

+#  Level Up Areas

+# ----------------------------------------------

+# Custom Level Zones. (.lvl20)

+Lvl20CommandAllow = True

+# Enter your spawn Location.

+lvl20_X = x

+lvl20_Y = y

+lvl20_Z = z

+Level20Messenge = You are in 20 Level Area.

+

+# Custom Level Zones. (.lvl40)

+Lvl40CommandAllow = True

# Enter your spawn Location.

+lvl40_X = x

+lvl40_Y = y

+lvl40_Z = z

+Level20Messenge = You are in 40 Level Area.

+

+# Custom Level Zones. (.lvl60)

+Lvl60CommandAllow = True

# Enter your spawn Location.

+lvl60_X = x

+lvl60_Y = y

+lvl60_Z = z

++Level20Messenge = You are in 60 Level Area.

+

+# Custom Level Zones. (.lvl75)

+Lvl75CommandAllow = True

# Enter your spawn Location.

+lvl75_X = x

+lvl75_Y = y

+lvl75_Z = z

+Level20Messenge = You are in 75 Level Area.

+

put it whenever you want,just be sure you'll make the proper changes in config.java
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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

    • chrome and ISP doesn't let me due to ssl errors in your website
    • Keto Move ||  https://rebrand.ly/keto-move-official   Keto Move, as the name the provider has given it, is a pragmatic and regular arrangement that will help you in consuming the additional fat that is all put away in different substantial segments of your body. It can help you through your weight reduction venture in each conceivable way and assist you with consuming off every one of the additional calories put away in your headstrong body districts. On a keto diet, you should comply to specific tight rules, for example, consuming only 5% of carbs, considerably less than whatever we ordinarily take.   Facebook:- https://www.facebook.com/Keto.Move.Official/   Keto Move targets obstinate fat stores all through your body and attempts to kill them, permitting you to get thinner. This keto supplement contains BHB salts, green tea remove, espresso separate, and other home grown parts. Each part of this recipe ensures that Ketosis works appropriately in the body. What's more, this adds to fruitful weight reduction. These sticky bears offer your body all it expects for appropriate cell action. These desserts taste better, yet they additionally work better.   More Relative Blogs https://keto-move.webflow.io/ https://keto-move.company.site/ https://keto-move.jimdosite.com/ https://keto-move.mystrikingly.com/ https://ketomove.journoportfolio.com/ https://solo.to/ketomove https://bio.link/ketomoveofficial https://in.pinterest.com/pin/1145532855383041696 https://soundcloud.com/ketomove/keto-move-weight-loss-review-price-benefits https://medium.com/@ketomove/keto-move-expert-tips-for-staying-on-track-with-keto-71933c4ceaa5 https://sketchfab.com/3d-models/keto-move-better-sale-price-2024-54158d06ed6b48a485ec4ae5568792d9 https://www.eventbrite.com/e/keto-move-keto-move-updated-customer-warning-alert-exposed-tickets-891768873707
    • Attention, attention, the heroes of Elmoraden are wanted! Get ready for new adventures, because our gates are open for you! We switch to the Interlude chronicles on Lionna x5 server, where exciting battles, exciting quests and incredible adventures await you! But that's not all! For beginners, we have a special offer – shadow equipment that will help you develop faster and more efficiently in the world of Elmoraden. With these powerful items, you can easily reach new heights! Join us on May 17th and become a part of the great saga! An unforgettable adventure awaits you on the Lionna X5 server with the Interlude chronicles. Don't miss your chance to become a real hero!     More info: - Characters created from 17.05 09:00 server time, when created will receive gifts in the form of chests with coupons for temporary weapons \ armor No Grade - A grade; - Characters created from 15.05 00:00 server time to 17.05 09:00 will receive gifts in the form of chests with coupons for temporary weapons \ armor No Grade - A grade; - Gifts are divided by grades (No Grade - A Grade) and gifts can be opened at levels corresponding to the grade of the gift. (A gift of D Grade can be opened at the 20th level, B Grade at 52, etc.), but the character's level when opening the gift should not exceed the 75th; - The duration of the equipment \ weapon is 10 hours; - Chaotic characters (characters whose PK counter is higher than 0) cannot use shadow equipment; - On 17.05 at 09:00 server time (10:00 Moscow time), you can meet Looney the Cat in the cities, who will exchange coupons for temporary weapons and equipment; Coupon amount in the gift chests: No Grade: 1 D Grade: 2 C Grade: 2 B Grade: 1 A Grade: 1   On 17.06 at 00:00 server time, the cats will disappear, and with them the chests and coupons. Items received for coupons are not deleted.
  • Topics

×
×
  • Create New...