Skip to content

[Share] Join Oly With Command (.joinoly)

Featured Replies

Hello,hope to find it usefull

 

.joinoly and you are register

 

 

 

Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\Config.java
===================================================================
--- head-src\com\l2jfrozen\Config.java	(revision 931)
+++ head-src\com\l2jfrozen\Config.java	(working copy)

@@ -2385,1 +2385,5 @@
public static String PVP2_CUSTOM_MESSAGE;
+	public static boolean OLYMPIAD_JOIN_COMMAND;
+
//============================================================
public static void loadL2JFrozenConfig()

@@ -2512,1 +2512,13 @@
		PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
+	        OLYMPIAD_JOIN_COMMAND = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnableJoinOlympiadCommand", "True"));
(/No newline at the end of the line)

Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\handler\voicedcommandhandlers\JoinOly.java
===================================================================
+++ head-src\com\l2jfrozen\gameserver\handler\voicedcommandhandlers\JoinOly.java (working copy)
+package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+
+public class JoinOly implements IVoicedCommandHandler
+{
+	
+	  private static final String[] VOICED_COMMANDS = { "joinoly" , "leaveoly" };
+
+
+public boolean useVoicedCommand(String command, L2PcInstance activeChar,String target)
+{
+    if (command.equalsIgnoreCase("joinoly"))
+    {
+     if (!activeChar.isInOlympiadMode() )
+     {
+    	 Olympiad.getInstance().registerNoble(activeChar, true);
+    	 return true;
+   }
+    	 else if (!activeChar.isNoble() || activeChar.isDead() || activeChar.isFestivalParticipant() || activeChar.atEvent
+    		 || activeChar.isSubClassActive() || activeChar.isInDuel() || activeChar.isAlikeDead()
+    		 || activeChar.getPvpFlag() > 0 || activeChar.getKarma() > 0 || activeChar.isInCombat() || activeChar.inObserverMode())     
+    {
+    activeChar.sendMessage("Your Status Doesnt Allow You To Join Olympiad!");
+    return false;
+         }
+     }
+   
+    if (command.equalsIgnoreCase("leaveoly"))
+     {
+    	 if (activeChar.isInOlympiadMode())
+    	 {
+    		 Olympiad.getInstance().unRegisterNoble(activeChar);
+    		 return true;
+    	 }
+    	 else if (activeChar.isAlikeDead() || activeChar.isInCombat()
+    			 || activeChar.inObserverMode() || !activeChar.isInOlympiadMode())
+        		 {
+        	 activeChar.sendMessage("You Can't Leave Olympiad while Participating somewhere.");
+        	 return false;
+         }
+     }
+    
+    
+    return true;
+}
+
+	public String[] getVoicedCommandList()
+	{
+    	return VOICED_COMMANDS;
+	}
+}
+
(/No newline at the end of the line)

Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java
===================================================================
--- head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java	(revision 570)
+++ head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java	(working copy)

@@ -75,1 +75,9 @@
if(Config.BANKING_SYSTEM_ENABLED)
	{
		registerVoicedCommandHandler(new BankingCmd());
	}
+
+		if(Config.OLYMPIAD_JOIN_COMMAND)
+		{
+			registerVoicedCommandHandler(new JoinOly());
+		}
	if(Config.CTF_COMMAND)
(/No newline at the end of the line)

Index: L2jFrozen_GameServer\config\functions\l2jfrozen.ppt
===================================================================
--- config\functions\l2jfrozen.ppt	(revision 912)
+++ config\functions\l2jfrozen.ppt	(working copy)

@@ -282,1 +282,1 @@
ProtectorSkillId = 1170
# Skill Level used for npc
ProtectorSkillLevel = 13
ProtectorSkillTime = 600
# Npc Protector Message
ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+#-------------------------------------
+# Join and Leave Olympiad by Command -
+#-------------------------------------
+# Default: True
+EnableJoinOlympiadCommand = True

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.