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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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

    • What does ‘half-finished’ even mean? Most projects based on L2Off use essentially the same files made for gold-style servers, and they’re fully functional. As for the L2J branches, calling them ‘half-finished’ couldn’t be further from the truth, they’re not only complete in the sense of gold-style projects but are actually extended with even more features.
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchiha-market.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/4EPpYhe2HA  | https://campsite.bio/utchihaamkt  
    • sell adena l2rebon signature x1 - 1kk = 1 dollars l2reborn x10 - 500kk = 4.7 dollars E-Global x Lu4 - 1kk = 2.7 dollars BOHPTS - x20-x500 TOP PRICE DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO Also on sale are Epic jewelry, Clothes at a very good price
    • For wholesale clients   We understand that favorable terms are especially important when dealing with large volumes. That’s why we offer a flexible system for wholesale clients  we can discuss pricing and provide personalized solutions tailored to your needs. With us, you get not only a reliable service but also support focused on long-term cooperation. We value partners who operate at scale and do everything possible to make it convenient and profitable for you to grow together with Vibe SMS.   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms   Quality in the Details     As Henry Ford said: "Quality means doing it right even when no one is looking."   At Vibe SMS, we believe the same. Every number and every feature is designed to make your work easy and stress-free. With us, it’s simple: grab a number, complete your task, and move forward. Reliability, comfort, and attention to detail — that’s our vibe, helping you focus on what really matters.   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms  
    • We ready to post first part of Patchnotes! To avoid delaying the patch notes, we’ve decided to split them into two parts. Right now, we’re publishing the patch notes focused on balance changes (skill changes). In the second part, we’ll share details about gameplay updates, world changes, activities, and more.  - Patchnotes (last post on topic) https://forum.lineage2dex.com/threads/16724/#post-72291
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock