Jump to content

Recommended Posts

Posted

CTF Doors Close :)

to posting here because I saw this mod missing = x

 

Author : Mazokista

Index: java/com/it/roberto/Config.java
===================================================================
--- java/com/it/roberto/Config.java	(revision 57)
+++ java/com/it/roberto/Config.java	(working copy)
@@ -73,11 +73,7 @@
	public static boolean CTF_ALLOW_SUMMON;
	public static boolean CTF_ON_START_REMOVE_ALL_EFFECTS;
	public static boolean CTF_ON_START_UNSUMMON_PET;
+	public static boolean CTF_REVIVE_RECOVERY;
+    public static String CTF_DOORS_IDS_TO_OPEN_STRING;
+	public static List<Integer> CTF_DOORS_IDS_TO_OPEN = new FastList<Integer>();
+    public static String CTF_DOORS_IDS_TO_CLOSE_STRING;
+	public static List<Integer> CTF_DOORS_IDS_TO_CLOSE = new FastList<Integer>();
     public static boolean ENABLE_MODIFY_SKILL_DURATION;
     public static Map<Integer, Integer> SKILL_DURATION_LIST;	
	public static boolean MOVE_BASED_KNOWNLIST;
@@ -2087,20 +2083,6 @@
				CTF_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(additionsSettings.getProperty("CTFOnStartRemoveAllEffects", "true"));
				CTF_ON_START_UNSUMMON_PET = Boolean.parseBoolean(additionsSettings.getProperty("CTFOnStartUnsummonPet", "true"));
				CTF_REVIVE_RECOVERY = Boolean.parseBoolean(additionsSettings.getProperty("CTFReviveRecovery", "false"));			
+		        CTF_DOORS_IDS_TO_OPEN_STRING = additionsSettings.getProperty("CTFDoorsToOpen", "");
+				CTF_DOORS_IDS_TO_OPEN = new FastList<Integer>();
+				for (String door : CTF_DOORS_IDS_TO_OPEN_STRING.split(";"))
+				{
+                     if (!door.equals(""))
+						CTF_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
+				}
+		        CTF_DOORS_IDS_TO_CLOSE_STRING = additionsSettings.getProperty("CTFDoorsToClose", "");
+				CTF_DOORS_IDS_TO_CLOSE = new FastList<Integer>();
+				for (String door : CTF_DOORS_IDS_TO_CLOSE_STRING.split(";"))
+				{
+                     if (!door.equals(""))
+						CTF_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
+				}
             }
             catch (Exception e)
             {
Index: java/com/it/roberto/gameserver/model/entity/events/CTF.java
===================================================================
--- java/com/it/roberto/gameserver/model/entity/events/CTF.java	(revision 57)
+++ java/com/it/roberto/gameserver/model/entity/events/CTF.java	(working copy)
@@ -10,7 +10,6 @@
import com.it.roberto.Config;
import com.it.roberto.L2DatabaseFactory;
import com.it.roberto.gameserver.ThreadPoolManager;
+import com.it.roberto.gameserver.datatables.DoorTable;
import com.it.roberto.gameserver.datatables.ItemTable;
import com.it.roberto.gameserver.datatables.NpcTable;
import com.it.roberto.gameserver.datatables.SpawnTable;
@@ -22,7 +21,6 @@
import com.it.roberto.gameserver.model.L2Summon;
import com.it.roberto.gameserver.model.L2World;
import com.it.roberto.gameserver.model.L2Radar;
+import com.it.roberto.gameserver.model.actor.instance.L2DoorInstance;
import com.it.roberto.gameserver.model.actor.instance.L2PcInstance;
import com.it.roberto.gameserver.model.actor.instance.L2PetInstance;
import com.it.roberto.gameserver.serverpackets.ActionFailed;
@@ -722,7 +720,7 @@
         _joining = true;
         spawnEventNpc(activeChar);
         Announcements(_eventName + "(CTF): Joinable in " + _joiningLocationName + "!");
+		closeDoorsCTF();
+		// Closes all doors specified in configs for tvt
     }

     public static void startJoin()
@@ -736,7 +734,7 @@
         _joining = true;
         spawnEventNpc();
         Announcements(_eventName + "(CTF): Joinable in " + _joiningLocationName + "!");
+		// Closes all doors specified in configs for CTF
+		closeDoorsCTF();
     }
     
     public static boolean startAutoJoin()
@@ -1272,7 +1270,7 @@
         unspawnAllFlags();
         Announcements(_eventName + "(CTF): Match aborted!");
         teleportFinish();
+		// Opens all doors specified in configs for CTF
+		openDoorsCTF();
     }
     
     public static void sit()
@@ -1955,7 +1953,7 @@
     
     public static void teleportFinish()
     {
+		// Opens all doors specified in configs for CTF
+		openDoorsCTF();
         Announcements(_eventName + "(CTF): Teleport back to participation NPC!");

         ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
@@ -1972,6 +1970,10 @@
         }, 3000);
     }

+
+	/**
+    * author : Mazokista
+	 * Close doors specified in configs
+	 */
+	private static void closeDoorsCTF() 
+	{
+		for (int doorId : Config.CTF_DOORS_IDS_TO_CLOSE) 
+		{
+			L2DoorInstance doorInstance = DoorTable.getInstance().getDoor(doorId);
+			if (doorInstance != null) 
+			{
+				doorInstance.closeMe();
+			}
+		}
+	}
+
@@ -1984,7 +1986,10 @@
			}
		}
	}
-
+	
+	/**
+    * author : Mazokista
+	 * Open doors specified in configs
+	 */
+	private static void openDoorsCTF() 
+	{
+		for (int doorId : Config.CTF_DOORS_IDS_TO_OPEN) 
+		{
+			L2DoorInstance doorInstance = DoorTable.getInstance().getDoor(doorId);
+			if (doorInstance != null) 
+			{
+				doorInstance.openMe();
+			}
+		}
+	}
+
Index: java/config/additions.ini
===================================================================
--- java/config/additions.ini	(revision 57)
+++ java/config/additions.ini	(working copy)
@@ -377,9 +377,3 @@

# on revive participants regain full hp/mp/cp ?
CTFReviveRecovery = False
+
+# Installation of doors in the closed / open in early / late
+# ex.: 1;2;3;4;5;6
+# no ";" at the start or end
+CTFDoorsToOpen =
+CTFDoorsToClose =
\ No newline at end of file

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 everyone, I am looking to purchase a Premium Lineage 2 High Five server pack. My main requirements are: Stability & Quality (Most Important): The pack must be highly stable with no system errors or major bugs. Custom Features: It must include ready-to-use custom features such as a fully functional Community Board, custom NPC Buffers, and Custom Item Sellers (GM Shops), etc. Complete Files: It is absolutely necessary that the full source code (src) and complete Geodata are included. If you are selling a pack that meets these criteria, please send me a PM or leave a reply with the following information: Brief details and key features of the pack Price Test server availability (I would like to test it before buying) Thank you!
    • L2jmobiusDevClon — Classic Interlude p110 Emulator L2jmobiusDevClon is actively developing a Lineage 2 Classic Interlude p110 emulator. Development is done in free time with a strong focus on: • Stability • Authentic Classic mechanics • Clean and optimized architecture The project is based on the L2jMobius source and is continuously evolving and improving. System Requirements: • Java 25 • MariaDB 12.0 • Client p110 Current Revision: 3.0 Development Status: Active Distribution: Free Official Website: https://www.l2jmobiusdevclon.pp.ua Discord Server: https://discord.gg/23a9S8g4Bn Contact: Telegram — @L2jmobiusDevClon Also available via private messages Project Goals: ✔ Improved stability ✔ Maximum Classic accuracy ✔ Core optimization We are currently looking for: • Testers • Server administrators Suggestions, bug reports, and ideas are always welcome. Contact us via: ✔ Discord ✔ Telegram ✔ Private Messages
    • i guess loading only the effects that are needed it will maybe work, like removing from reshade shader folder the ones that are not needed, depends on the pc also i guess, also limithing the game at 30fps can be better maybe
    • Up   SELL CHARACTERS L2 REBORN FRANZ x1     destroyer 74 lvl naked - 120 euro sws 71 lvl naked - 120 euro pp 66 skills - 120 euro se 64 lvl - 90 euro   Characters are legit with mail   i can wtt the characters for adena server franz   sell adena franz 250kk stock     add discord topeseller4081  
  • 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..