U3Games

Games | Desarrollo & Soporte => L2 | Sección de Servidores => Lineage => L2 | Implementaciones => Mensaje iniciado por: Swarlog en Jul 26, 2025, 11:00 PM

Título: Cambiar numero máximo de subclases
Publicado por: Swarlog en Jul 26, 2025, 11:00 PM
Index: config/other.properties
===================================================================
--- config/other.properties (revision 1283)
+++ config/other.properties (working copy)
@@ -167,3 +167,8 @@
# Death Penalty chance if killed by mob (%)
#------------------------------------------
DeathPenaltyChance = 20
+
+#-----------------------------------------
+#Maximum number of subclass
+#-----------------------------------------
+MaxSubClass = 3
\ No newline at end of file
Index: net/sf/l2j/Config.java
===================================================================
--- net/sf/l2j/Config.java (revision 1283)
+++ net/sf/l2j/Config.java (working copy)
@@ -971,6 +971,9 @@
    /** Death Penalty chance */
    public static int  DEATH_PENALTY_CHANCE;

+ /** Max SubClass Number */
+ public static int  MAX_SUB;
+
    /** Player Protection control */
    public static int  PLAYER_SPAWN_PROTECTION;
    public static int  PLAYER_FAKEDEATH_UP_PROTECTION;
@@ -1552,6 +1555,7 @@
                JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
               
                DEATH_PENALTY_CHANCE = Integer.parseInt(otherSettings.getProperty("DeathPenaltyChance", "20"));
+ MAX_SUB = Integer.parseInt(otherSettings.getProperty("MaxSubClass", "3"));
            }
            catch (Exception e)
            {
Index: net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1283)
+++ net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -8292,7 +8292,7 @@
      */
    public boolean addSubClass(int classId, int classIndex)
    {
-    if (getTotalSubClasses() == 3 || classIndex == 0)
+    if (getTotalSubClasses() == Config.MAX_SUB || classIndex == 0)
    return false;

    if (getSubClasses().containsKey(classIndex))

Index: net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
===================================================================
--- net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 1283)
+++ net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (working copy)
@@ -197,7 +197,7 @@
            {
                case 1: // Add Subclass - Initial
                    // Avoid giving player an option to add a new sub class, if they have three already.
-                    if (player.getTotalSubClasses() == 3)
+                    if (player.getTotalSubClasses() == Config.MAX_SUB)
                    {
                        player.sendMessage("You can now only change one of your current sub classes.");
                        return;