Explorar el Código

Little custom stuff - setup maximum subclass level from config.
# Maximum subclass level.
# Default: 80
MaxSubclassLevel = 80

_DS_ hace 16 años
padre
commit
51e50b3aa9

+ 4 - 0
L2_GameServer/java/config/Character.properties

@@ -203,6 +203,10 @@ MaxEvasion = 200
 # Default: 3
 MaxSubclass = 3
 
+# Maximum subclass level.
+# Default: 80
+MaxSubclassLevel = 80
+
 # Maximum number of allowed slots for Private Stores Sell.
 # Other means all the other races aside from Dwarf.
 # Default: 4, 3

+ 2 - 0
L2_GameServer/java/net/sf/l2j/Config.java

@@ -105,6 +105,7 @@ public final class Config
 	public static int MAX_MATK_SPEED;
 	public static int MAX_EVASION;
 	public static byte MAX_SUBCLASS;
+	public static byte MAX_SUBCLASS_LEVEL;
 	public static int MAX_PVTSTORESELL_SLOTS_DWARF;
 	public static int MAX_PVTSTORESELL_SLOTS_OTHER;
 	public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
@@ -1159,6 +1160,7 @@ public final class Config
 					MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
 					MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
 					MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
+					MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
 					MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
 					MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
 					MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));

+ 9 - 5
L2_GameServer/java/net/sf/l2j/gameserver/model/base/SubClass.java

@@ -14,6 +14,8 @@
  */
 package net.sf.l2j.gameserver.model.base;
 
+import net.sf.l2j.Config;
+
 /**
  * Character Sub-Class Definition
  * <BR>
@@ -23,6 +25,8 @@ package net.sf.l2j.gameserver.model.base;
  */
 public final class SubClass
 {
+	private static final byte _maxLevel = Config.MAX_SUBCLASS_LEVEL < Experience.MAX_LEVEL ? Config.MAX_SUBCLASS_LEVEL : Experience.MAX_LEVEL - 1;
+
 	private PlayerClass _class;
 	private long _exp = Experience.LEVEL[40];
 	private int _sp = 0;
@@ -88,8 +92,8 @@ public final class SubClass
 	
 	public void setExp(long expValue)
 	{
-		if (expValue > (Experience.LEVEL[81] - 1))
-			expValue = (Experience.LEVEL[81] - 1);
+		if (expValue > (Experience.LEVEL[_maxLevel + 1] - 1))
+			expValue = (Experience.LEVEL[_maxLevel + 1] - 1);
 		
 		_exp = expValue;
 	}
@@ -106,8 +110,8 @@ public final class SubClass
 	
 	public void setLevel(byte levelValue)
 	{
-		if (levelValue > 80)
-			levelValue = 80;
+		if (levelValue >= _maxLevel)
+			levelValue = _maxLevel;
 		else if (levelValue < 40)
 			levelValue = 40;
 		
@@ -116,7 +120,7 @@ public final class SubClass
 	
 	public void incLevel()
 	{
-		if (getLevel() == 80)
+		if (getLevel() == _maxLevel)
 			return;
 		
 		_level++;