소스 검색

Maximum points that a player can gain/lose from olympiad games is 10.
Can be configured especially for momo61 :P

Charus 15 년 전
부모
커밋
10551d110a

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

@@ -514,6 +514,10 @@ AltOlyRank4Points = 35
 # Default: 20
 AltOlyRank5Points = 20
 
+# Maximum points that player can gain/lose on a match.
+# Default: 10
+AltOlyMaxPoints = 10
+
 # Hero tables show last month's winners or current status.
 # Default: True
 AltOlyShowMonthlyWinners = True

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

@@ -455,6 +455,7 @@ public final class Config
 	public static int ALT_OLY_RANK3_POINTS;
 	public static int ALT_OLY_RANK4_POINTS;
 	public static int ALT_OLY_RANK5_POINTS;
+	public static int ALT_OLY_MAX_POINTS;
 	public static boolean ALT_OLY_LOG_FIGHTS;
 	public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
 	public static boolean ALT_OLY_ANNOUNCE_GAMES;
@@ -1526,6 +1527,7 @@ public final class Config
 					ALT_OLY_RANK3_POINTS = Integer.parseInt(General.getProperty("AltOlyRank3Points","55"));
 					ALT_OLY_RANK4_POINTS = Integer.parseInt(General.getProperty("AltOlyRank4Points","35"));
 					ALT_OLY_RANK5_POINTS = Integer.parseInt(General.getProperty("AltOlyRank5Points","20"));
+					ALT_OLY_MAX_POINTS = Integer.parseInt(General.getProperty("AltOlyMaxPoints","10"));
 					ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(General.getProperty("AlyOlyLogFights","false"));
 					ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(General.getProperty("AltOlyShowMonthlyWinners","true"));
 					ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(General.getProperty("AltOlyAnnounceGames","true"));

+ 5 - 5
L2_GameServer/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java

@@ -503,14 +503,14 @@ class OlympiadGame
 		
 		final int playerOnePoints = playerOneStat.getInteger(POINTS);
 		final int playerTwoPoints = playerTwoStat.getInteger(POINTS);
-		final int pointDiff = Math.min(playerOnePoints, playerTwoPoints) / _div;
+		final int pointDiff = Math.min(Math.min(playerOnePoints, playerTwoPoints) / _div, Config.ALT_OLY_MAX_POINTS);
 
 		// Check for if a player defaulted before battle started
 		if (_playerOneDefaulted || _playerTwoDefaulted)
 		{
 			if (_playerOneDefaulted)
 			{
-				final int lostPoints = playerOnePoints / 3;
+				final int lostPoints = Math.min(playerOnePoints / 3, Config.ALT_OLY_MAX_POINTS);
 				playerOneStat.set(POINTS, playerOnePoints - lostPoints);
 				Olympiad.updateNobleStats(_playerOneID, playerOneStat);
 				SystemMessage sm = new SystemMessage(SystemMessageId.C1_HAS_LOST_S2_OLYMPIAD_POINTS);
@@ -530,7 +530,7 @@ class OlympiadGame
 			}
 			if (_playerTwoDefaulted)
 			{
-				final int lostPoints = playerTwoPoints / 3;
+				final int lostPoints = Math.min(playerTwoPoints / 3, Config.ALT_OLY_MAX_POINTS);
 				playerTwoStat.set(POINTS, playerTwoPoints - lostPoints);
 				Olympiad.updateNobleStats(_playerTwoID, playerTwoStat);
 				SystemMessage sm = new SystemMessage(SystemMessageId.C1_HAS_LOST_S2_OLYMPIAD_POINTS);
@@ -783,8 +783,8 @@ class OlympiadGame
 			result = " tie";
 			_sm = new SystemMessage(SystemMessageId.THE_GAME_ENDED_IN_A_TIE);
 			broadcastMessage(_sm, true);
-			int pointOneDiff = playerOnePoints / 5;
-		 	int pointTwoDiff = playerTwoPoints / 5;
+			final int pointOneDiff = Math.min(playerOnePoints / 5, Config.ALT_OLY_MAX_POINTS);
+			final int pointTwoDiff = Math.min(playerTwoPoints / 5, Config.ALT_OLY_MAX_POINTS);
 		 	playerOneStat.set(POINTS, playerOnePoints - pointOneDiff);
 		 	playerTwoStat.set(POINTS, playerTwoPoints - pointTwoDiff);
 		 	playerOneStat.set(COMP_DRAWN, playerOneDrawn + 1);