Browse Source

fix for loading castle mercenaries max config.

JIV 14 years ago
parent
commit
0154b1e260

+ 0 - 19
L2_GameServer/java/com/l2jserver/Config.java

@@ -299,15 +299,6 @@ public final class Config
 	public static int CS_SUPPORT2_FEE;
 	public static int CS_SUPPORT3_FEE;
 	public static int CS_SUPPORT4_FEE;
-	public static int GLUDIO_MAX_MERCENARIES;
-	public static int DION_MAX_MERCENARIES;
-	public static int GIRAN_MAX_MERCENARIES;
-	public static int OREN_MAX_MERCENARIES;
-	public static int ADEN_MAX_MERCENARIES;
-	public static int INNADRIL_MAX_MERCENARIES;
-	public static int GODDARD_MAX_MERCENARIES;
-	public static int RUNE_MAX_MERCENARIES;
-	public static int SCHUTTGART_MAX_MERCENARIES;
 	public static List<String> CL_SET_SIEGE_TIME_LIST;
 	public static List<Integer> SIEGE_HOUR_LIST_MORNING;
 	public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
@@ -1259,16 +1250,6 @@ public final class Config
 					CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
 					CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
 					
-					GLUDIO_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("GludioMaxMercenaries", "100"));
-					DION_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("DionMaxMercenaries", "150"));
-					GIRAN_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("GiranMaxMercenaries", "200"));
-					OREN_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("OrenMaxMercenaries", "300"));
-					ADEN_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("AdenMaxMercenaries", "400"));
-					INNADRIL_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("InnadrilMaxMercenaries", "400"));
-					GODDARD_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("GoddardMaxMercenaries", "400"));
-					RUNE_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("RuneMaxMercenaries", "400"));
-					SCHUTTGART_MAX_MERCENARIES = Integer.parseInt(Feature.getProperty("SchuttgartMaxMercenaries", "400"));
-					
 					CL_SET_SIEGE_TIME_LIST = new ArrayList<String>();
 					SIEGE_HOUR_LIST_MORNING = new ArrayList<Integer>();
 					SIEGE_HOUR_LIST_AFTERNOON = new ArrayList<Integer>();

+ 10 - 11
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java

@@ -24,7 +24,6 @@ import java.util.logging.Logger;
 
 import javolution.util.FastList;
 
-import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.idfactory.IdFactory;
@@ -81,16 +80,16 @@ public class MercTicketManager
 	};
 	
 	//TODO: not retail like: clan lvl 5 - 30 ticks max, lvl 7+ - 50 max
-	private static final int[] MERCS_MAX_PER_CASTLE = {
-		Config.GLUDIO_MAX_MERCENARIES, //default 100
-		Config.DION_MAX_MERCENARIES,   //default 150
-		Config.GIRAN_MAX_MERCENARIES,  //default 200
-		Config.OREN_MAX_MERCENARIES,   //default 300
-		Config.ADEN_MAX_MERCENARIES,   //default 400
-		Config.INNADRIL_MAX_MERCENARIES, //default 400
-		Config.GODDARD_MAX_MERCENARIES,  //default 400
-		Config.RUNE_MAX_MERCENARIES,     //default 400
-		Config.SCHUTTGART_MAX_MERCENARIES //default 400
+	protected static final int[] MERCS_MAX_PER_CASTLE = {
+		100, // Gludio
+		150, // Dion
+		200, // Giran
+		300, // Oren
+		400, // Aden
+		400, // Innadril
+		400, // Goddard
+		400, // Rune
+		400 // Schuttgart
 	};
 	
 	private static final int[] ITEM_IDS = {

+ 3 - 0
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/SiegeManager.java

@@ -270,6 +270,9 @@ public class SiegeManager
 					}
 				}
 				
+				MercTicketManager.MERCS_MAX_PER_CASTLE[castle.getCastleId()] = Integer.parseInt(siegeSettings.getProperty(castle.getName() + "MaxMercenaries",
+						Integer.toString(MercTicketManager.MERCS_MAX_PER_CASTLE[castle.getCastleId()])));
+				
 				_controlTowerSpawnList.put(castle.getCastleId(), _controlTowersSpawns);
 				_artefactSpawnList.put(castle.getCastleId(), _artefactSpawns);
 				_flameTowerSpawnList.put(castle.getCastleId(), _flameTowersSpawns);