Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Anti - Heavy System

Iniciado por Swarlog, Jul 26, 2025, 11:42 PM

Tema anterior - Siguiente tema

Swarlog

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 45)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -558,7 +558,26 @@
 	public static int HOPZONE_DUALBOXES_ALLOWED;
     public static boolean ALLOW_HOPZONE_GAME_SERVER_REPORT;
     
+    public static boolean ENABLE_ANTI_HEAVY;
+    	
     //--------------------------------------------------
 	// Server
 	//--------------------------------------------------
@@ -1462,6 +1481,38 @@
                 }
                 HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(mods.getProperty("HopzoneDualboxesAllowed", "1"));
                 ALLOW_HOPZONE_GAME_SERVER_REPORT = Boolean.parseBoolean(mods.getProperty("AllowHopzoneGameServerReport", "false"));
				 
+                ENABLE_ANTI_HEAVY = Boolean.parseBoolean(mods.getProperty("EnableAntiHeavySystem", "True"));
+                   			
             }
             catch (Exception e)
             {

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: config/mods.properties
===================================================================
--- config/mods.properties	(revision 44)
+++ config/mods.properties	(working copy)
@@ -5,7 +5,7 @@
+
+# Enable or Disable anti-heavy system.
+# Dagger, tyrant, and bow classes won't be able to equip heavy type armours.
+EnableAntiHeavySystem = True
\ No newline at end of file

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(revision 44)
+++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(working copy)
@@ -31,6 +31,7 @@
 import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
 import net.sf.l2j.gameserver.network.serverpackets.ShowCalculator;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.templates.item.L2ArmorType;
 import net.sf.l2j.gameserver.templates.item.L2Item;
 import net.sf.l2j.gameserver.templates.item.L2Weapon;
 import net.sf.l2j.gameserver.templates.item.L2WeaponType;
@@ -116,6 +117,17 @@
 			return;
 		}
 		
+		if (Config.ENABLE_ANTI_HEAVY && item.getItemType() == L2ArmorType.HEAVY) {
+			if (activeChar.getClassId().getId() == 48 || activeChar.getClassId().getId() == 114 || activeChar.getClassId().getId() == 109
+				|| activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 36
+				|| activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 101
+				|| activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 8
+				|| activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 9) {
+				activeChar.sendMessage("Your class can't equip heavy type armors.");
+				return;
+			}
+		}
+		
 		if (!Config.KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
 		{
 			switch (_itemId)