Jump to content

Recommended Posts

Posted

ES: Un Pequeño aporte un mod que cumple la funcion que al entrar en lo eventos de TVT, DM o CTF automaticamente te da buff dependiendo la clase ya sea Mago o Guerrero espero que lo disfruten

 

EN: A small contribution, a mod that fulfills the function that when entering the TVT, DM or CTF events it automatically gives you a buff depending on the class, whether it is a Mage or a Warrior, I hope you enjoy it.

 

### Eclipse Workspace Patch 1.0
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java   (revision 43)
+++ head-src/com/l2jfrozen/Config.java   (working copy)

		public static boolean TVT_STATS_LOGGER;
		public static boolean TVT_REMOVE_BUFFS_ON_DIE;
		public static boolean TVT_ALLOW_HEALER_CLASSES;
		public static String DISABLE_ID_CLASSES_STRING;
		public static FastList<Integer> DISABLE_ID_CLASSES = new FastList<>();
+		/* TVT BUFF CONFIG */
+       public static List<int[]> CUSTOM_BUFFS_MTVT = new ArrayList<>();     
+       public static List<int[]> CUSTOM_BUFFS_FTVT = new ArrayList<>();
+/* ============================================================================ */	
		public static boolean CTF_AURA;
		public static boolean CTF_STATS_LOGGER;
		public static int CTF_SPAWN_OFFSET;
		public static boolean CTF_REMOVE_BUFFS_ON_DIE;
+		/* CTF BUFF CONFIG */
+       public static List<int[]> CUSTOM_BUFFS_MCTF = new ArrayList<>();     
+       public static List<int[]> CUSTOM_BUFFS_FCTF = new ArrayList<>();
+/* ============================================================================ */	
		public static boolean DM_STATS_LOGGER;
		public static boolean DM_ALLOW_HEALER_CLASSES;
		public static boolean DM_REMOVE_BUFFS_ON_DIE;
+		/* DM BUFF CONFIG */
+       public static List<int[]> CUSTOM_BUFFS_MDM = new ArrayList<>();     
+       public static List<int[]> CUSTOM_BUFFS_FDM = new ArrayList<>();
+/* ============================================================================ */	
		
		TVT_STATS_LOGGER = p.getProperty("TvTStatsLogger", true);
		TVT_REMOVE_BUFFS_ON_DIE = p.getProperty("TvTRemoveBuffsOnPlayerDie", false);
		TVT_ALLOW_HEALER_CLASSES = p.getProperty("TvTAllowedHealerClasses", true);
		DISABLE_ID_CLASSES_STRING = p.getProperty("DisableIdForClasses", "");
+		/*==============================================================================================================================================*/
+		/* TVT BUFF CONFIG */
+			String[] propertySplit = p.getProperty("TvTBuffsMage", "1204,2").split(";");
+			CUSTOM_BUFFS_MTVT.clear();
+			 for (String buff : propertySplit)
+			     {
+			       String[] buffSplit = buff.split(",");
+			        if (buffSplit.length != 2)
+			           LOGGER.warn("TvTBuffsMage[Config.load()]: invalid config property -> TvTBuffsMage \"" + buff + "\"");
+			        else
+			        	{
+			        try
+				            {
+				            	CUSTOM_BUFFS_MTVT.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+				            }
+			                catch (NumberFormatException nfe)
+				            {
+				               if(Config.ENABLE_ALL_EXCEPTIONS)
+				                 nfe.printStackTrace();
+				               if (!buff.isEmpty())
+				                 LOGGER.warn("TvTBuffsMage[Config.load()]: invalid config property -> TvTBuffsMage \"" + buff + "\"");
+				            }
+			            }
+			         }
+			 
+			        propertySplit = p.getProperty("TvTBuffsFighter", "1204,2").split(";");
+			        CUSTOM_BUFFS_FTVT.clear();
+			          for (String buff : propertySplit)
+			              {
+			               String[] buffSplit = buff.split(",");
+			                if (buffSplit.length != 2)
+			                    LOGGER.warn("TvTBuffsFighter[Config.load()]: invalid config property -> TvTBuffsFighter \"" + buff + "\"");
+			                else
+			                   {
+			                try
+			                    {
+			                      CUSTOM_BUFFS_FTVT.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+			                    }
+			                      catch (NumberFormatException nfe)
+			                         {
+			                            if(Config.ENABLE_ALL_EXCEPTIONS)
+			                               nfe.printStackTrace();
+			                                                     
+			                            if (!buff.isEmpty())
+			                                LOGGER.warn("TvTBuffsFighter[Config.load()]: invalid config property -> TvTBuffsFighter \"" + buff + "\"");
+			                          }
+			                      }
+			                     }
+			/*==============================================================================================================================================*/
			CTF_STATS_LOGGER = p.getProperty("CTFStatsLogger", true);
			CTF_SPAWN_OFFSET = Integer.parseInt(p.getProperty("CTFSpawnOffset", "100"));
			CTF_REMOVE_BUFFS_ON_DIE = p.getProperty("CTFRemoveBuffsOnPlayerDie", false);
+			/*==============================================================================================================================================*/
+			/* CTF BUFF CONFIG */
+			String[] propertySplit2 = p.getProperty("CTFBuffsMage", "1204,2").split(";");
+			CUSTOM_BUFFS_MCTF.clear();
+			 for (String buff : propertySplit2)
+			     {
+			       String[] buffSplit = buff.split(",");
+			        if (buffSplit.length != 2)
+			           LOGGER.warn("CTFBuffsMage[Config.load()]: invalid config property -> CTFBuffsMage \"" + buff + "\"");
+			        else
+			        	{
+			        try
+				            {
+				            	CUSTOM_BUFFS_MCTF.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+				            }
+			                catch (NumberFormatException nfe)
+				            {
+				               if(Config.ENABLE_ALL_EXCEPTIONS)
+				                 nfe.printStackTrace();
+				               if (!buff.isEmpty())
+				                 LOGGER.warn("CTFBuffsMage[Config.load()]: invalid config property -> CTFBuffsMage \"" + buff + "\"");
+				            }
+			            }
+			         }
+			 
+			        propertySplit2 = p.getProperty("CTFBuffsFighter", "1204,2").split(";");
+			        CUSTOM_BUFFS_FCTF.clear();
+			          for (String buff : propertySplit2)
+			              {
+			               String[] buffSplit = buff.split(",");
+			                if (buffSplit.length != 2)
+			                    LOGGER.warn("CTFBuffsFighter[Config.load()]: invalid config property -> CTFBuffsFighter \"" + buff + "\"");
+			                else
+			                   {
+			                try
+			                    {
+			                      CUSTOM_BUFFS_FCTF.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+			                    }
+			                      catch (NumberFormatException nfe)
+			                         {
+			                            if(Config.ENABLE_ALL_EXCEPTIONS)
+			                               nfe.printStackTrace();
+			                                                     
+			                            if (!buff.isEmpty())
+			                                LOGGER.warn("CTFBuffsFighter[Config.load()]: invalid config property -> CTFBuffsFighter \"" + buff + "\"");
+			                          }
+			                      }
+			                     }
+			/*==============================================================================================================================================*/
			DM_SPAWN_OFFSET = Integer.parseInt(p.getProperty("DMSpawnOffset", "100"));
			DM_STATS_LOGGER = p.getProperty("DMStatsLogger", true);
			DM_ALLOW_HEALER_CLASSES = p.getProperty("DMAllowedHealerClasses", true);
			DM_REMOVE_BUFFS_ON_DIE = p.getProperty("DMRemoveBuffsOnPlayerDie", false);
+			/*==============================================================================================================================================*/
+			/* DM BUFF CONFIG */
+			String[] propertySplit3 = p.getProperty("DMBuffsMage", "1204,2").split(";");
+			CUSTOM_BUFFS_MDM.clear();
+			 for (String buff : propertySplit33)
+			     {
+			       String[] buffSplit = buff.split(",");
+			        if (buffSplit.length != 2)
+			           LOGGER.warn("DMBuffsMage[Config.load()]: invalid config property -> DMBuffsMage \"" + buff + "\"");
+			        else
+			        	{
+			        try
+				            {
+				            	CUSTOM_BUFFS_MDM.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+				            }
+			                catch (NumberFormatException nfe)
+				            {
+				               if(Config.ENABLE_ALL_EXCEPTIONS)
+				                 nfe.printStackTrace();
+				               if (!buff.isEmpty())
+				                 LOGGER.warn("DMBuffsMage[Config.load()]: invalid config property -> DMBuffsMage \"" + buff + "\"");
+				            }
+			            }
+			         }
+			 
+			        propertySplit3 = p.getProperty("DMBuffsFighter", "1204,2").split(";");
+			        CUSTOM_BUFFS_FDM.clear();
+			          for (String buff : propertySplit3)
+			              {
+			               String[] buffSplit = buff.split(",");
+			                if (buffSplit.length != 2)
+			                    LOGGER.warn("DMBuffsFighter[Config.load()]: invalid config property -> DMBuffsFighter \"" + buff + "\"");
+			                else
+			                   {
+			                try
+			                    {
+			                      CUSTOM_BUFFS_FDM.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+			                    }
+			                      catch (NumberFormatException nfe)
+			                         {
+			                            if(Config.ENABLE_ALL_EXCEPTIONS)
+			                               nfe.printStackTrace();
+			                                                     
+			                            if (!buff.isEmpty())
+			                                LOGGER.warn("DMBuffsFighter[Config.load()]: invalid config property -> DMBuffsFighter \"" + buff + "\"");
+			                          }
+			                      }
+			                     }
+			/*==============================================================================================================================================*/









Index: head-src/com/l2jfrozen/gameserver/model/entity/event/TVT.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/event/TVT.java   (revision 43)
+++ head-src/com/l2jfrozen/gameserver/model/entity/event/TVT.java   (working copy)

+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.model.L2Skill;

	if (Config.TVT_ON_START_REMOVE_ALL_EFFECTS)
		{
			player.stopAllEffects();				
		}

+		//TVTBuff
+		L2Skill skill;
+       SystemMessage sm;
+		if(!player.isMageClass())
+           {
+                for (int[] buff : Config.CUSTOM_BUFFS_FTVT) //Custom buffs for fighters
+                    {
+                        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+                        skill.getEffects(player, player,false,false,false);
+                       sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+                        sm.addSkillName(buff[0]);
+                        player.sendPacket(sm);
+                    }
+            }
+			else
+			{
+				for (int[] buff : Config.CUSTOM_BUFFS_MTVT) //Custom buffs for mystics
+					{
+						skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+						skill.getEffects(player, player,false,false,false);
+						sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+						sm.addSkillName(buff[0]);
+						player.sendPacket(sm);
+					}
+			}
+			//-------------------------

Index: head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java   (revision 43)
+++ head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java   (working copy)

+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.model.L2Skill;

	if (Config.CTF_ON_START_REMOVE_ALL_EFFECTS)
		{
			for (final L2Effect e : player.getAllEffects())
				{
					if (e != null)
					e.exit(true);
				}
		}

+		//CTFBuff
+		L2Skill skill;
+        SystemMessage sm;
+		if(!player.isMageClass())
+            {
+                for (int[] buff : Config.CUSTOM_BUFFS_FCTF) //Custom buffs for fighters
+                    {
+                        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+                        skill.getEffects(player, player,false,false,false);
+                        sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+                        sm.addSkillName(buff[0]);
+                        player.sendPacket(sm);
+                    }
+            }
+			else
+			{
+				for (int[] buff : Config.CUSTOM_BUFFS_MCTF) //Custom buffs for mystics
+					{
+						skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+						skill.getEffects(player, player,false,false,false);
+						sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+						sm.addSkillName(buff[0]);
+						player.sendPacket(sm);
+					}
+			}
+			//-------------------------



Index: head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java   (revision 43)
+++ head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java   (working copy)

+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.model.L2Skill;

	if (Config.DM_ON_START_REMOVE_ALL_EFFECTS)
		{
			player.stopAllEffects();						
		}

+		//DMBuff
+		L2Skill skill;
+        SystemMessage sm;
+		if(!player.isMageClass())
+            {
+                for (int[] buff : Config.CUSTOM_BUFFS_FDM) //Custom buffs for fighters
+                    {
+                        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+                        skill.getEffects(player, player,false,false,false);
+                        sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+                        sm.addSkillName(buff[0]);
+                        player.sendPacket(sm);
+                    }
+            }
+			else
+			{
+				for (int[] buff : Config.CUSTOM_BUFFS_MDM) //Custom buffs for mystics
+					{
+						skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+						skill.getEffects(player, player,false,false,false);
+						sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+						sm.addSkillName(buff[0]);
+						player.sendPacket(sm);
+					}
+			}
+			//-------------------------
+











GameServer/Config/Function/eventmanager.ini

+# ----------------------------------------
+# Custom TVT buffs
+#------------------------------------------
+#Buffs for mage classes:
+#Retail: Wind Walk(lvl 2) and Acumen(lvl 1)
+TvTBuffsMage = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1;
+
+#Buffs for fighter classes:
+#Retail: Wind Walk(lvl 2) and Haste(lvl 1)
+TvTBuffsFighter = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1;
+
+# ----------------------------------------
+# Custom CTF buffs
+#------------------------------------------
+#Buffs for mage classes:
+#Retail: Wind Walk(lvl 2) and Acumen(lvl 1)
+CTFBuffsMage = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1;
+
+#Buffs for fighter classes:
+#Retail: Wind Walk(lvl 2) and Haste(lvl 1)
+CTFBuffsFighter = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1;
+
+
+# ----------------------------------------
+# Custom DM buffs
+#------------------------------------------
+#Buffs for mage classes:
+#Retail: Wind Walk(lvl 2) and Acumen(lvl 1)
+DMBuffsMage = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1;
+
+#Buffs for fighter classes:
+#Retail: Wind Walk(lvl 2) and Haste(lvl 1)
+DMBuffsFighter = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1;

 

Posted

Hey,

 

The code you provided contains a lot of repetitive code and can be improved to be cleaner. It's just a opinion, nothing else..

This way, you don't need to go into each file individually when you want to make a change; instead, it can be done through the new classes.

https://pastebin.com/vAgkygfN

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,   A quick update from the Emerge team. The official launch of Emerge Eclipse x10 is just around the corner and we are currently finishing the final preparations to ensure a smooth and stable opening for all players. Our team has been working on performance improvements, network optimizations, and additional infrastructure to provide the best possible experience from day one.   🚀 Launch Date: 7 June 2026 🕕 Launch Time: 18:00 CET We would like to invite everyone to join our Discord community where all announcements, updates, events, and support information are posted first. 🌐 Website: https://l2emerge.com 💬 Discord: https://discord.gg/l2emerge Thank you for all the support and feedback during the preparation phase. We look forward to seeing both new and veteran Lineage II players on launch day. See you soon on Emerge!
    • Added an enchant NPC ( more infos on test server)     - remade autofarm system, more clever , more humanlike steps, catacomb mode in route farm and rewrite of route farming   - Updated Antibot to defend even more from more advanced adrenaline users ( not gonna write how 😂 )   - now dll of antibot will not be flagged from antivirus or defenders   - Updated some more the AI based Agent     Our discord https://discord.gg/acvqx9rbhy   L2R Off files / monthly subscription
    • Interlude will never be the same again. To celebrate our first 3 months online, L2 Detona proudly presents League of Lineage.   A brand-new game mode inspired by the world's biggest MOBAs, bringing lane battles, minions, towers, strategic objectives, and epic team fights into the world of Lineage 2. All of this while preserving the essence that made Interlude one of the most beloved chronicles in Lineage 2 history.   ⚔️ Destroy enemy towers. 🛡️ Defend your base. 👑 Lead your team to victory.   📅 Officially launching on June 12, 2026. 🔥 Jump into the action right now through System_Test and become one of the first players to experience League of Lineage. Server Rates XP: 500x SP: 500x Adena: 200x Server Features Full Official Interlude gameplay with custom modifications Exclusive MOBA Arena 3 Hour Buffs for comfortable gameplay No Class Change Quests Website: https://www.l2detona.com Images of project: https://imgur.com/a/Lajn9Ag
    • Remove google ads from site , will be perfect without this.. we do a vote and we get 2-3 google ads, its nervus. i just give feedback you do ofc what you want 🙂
  • 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..