Jump to content

Recommended Posts

Posted

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

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