Last active
August 29, 2015 13:57
-
-
Save Pandragon/9416319 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Eclipse Workspace Patch 1.0 | |
#P L2J_Server_BETA | |
Index: java/com/l2jserver/Config.java | |
=================================================================== | |
--- java/com/l2jserver/Config.java (revision 6469) | |
+++ java/com/l2jserver/Config.java (working copy) | |
@@ -599,6 +599,9 @@ | |
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS; | |
public static int ALT_OLY_ENCHANT_LIMIT; | |
public static int ALT_OLY_WAIT_TIME; | |
+ public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS; | |
+ public static String ALT_OLY_PERIOD; | |
+ public static int ALT_OLY_PERIOD_MULTIPLIER; | |
public static int ALT_MANOR_REFRESH_TIME; | |
public static int ALT_MANOR_REFRESH_MIN; | |
public static int ALT_MANOR_APPROVE_TIME; | |
@@ -2683,6 +2686,9 @@ | |
} | |
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); | |
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 120); | |
+ ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false); | |
+ ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); | |
+ ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); | |
final File hexIdFile = new File(HEXID_FILE); | |
if (hexIdFile.exists()) | |
Index: java/com/l2jserver/gameserver/model/olympiad/Olympiad.java | |
=================================================================== | |
--- java/com/l2jserver/gameserver/model/olympiad/Olympiad.java (revision 6469) | |
+++ java/com/l2jserver/gameserver/model/olympiad/Olympiad.java (working copy) | |
@@ -584,6 +584,12 @@ | |
protected void setNewOlympiadEnd() | |
{ | |
+ if (Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS) | |
+ { | |
+ setNewOlympiadEndCustom(); | |
+ return; | |
+ } | |
+ | |
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED); | |
sm.addInt(_currentCycle); | |
@@ -603,6 +609,70 @@ | |
scheduleWeeklyChange(); | |
} | |
+ protected void setNewOlympiadEndCustom() | |
+ { | |
+ SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED); | |
+ sm.addInt(_currentCycle); | |
+ | |
+ Announcements.getInstance().announceToAll(sm); | |
+ | |
+ Calendar currentTime = Calendar.getInstance(); | |
+ currentTime.set(Calendar.AM_PM, Calendar.AM); | |
+ currentTime.set(Calendar.HOUR, 12); | |
+ currentTime.set(Calendar.MINUTE, 0); | |
+ currentTime.set(Calendar.SECOND, 0); | |
+ | |
+ Calendar nextChange = Calendar.getInstance(); | |
+ | |
+ switch (Config.ALT_OLY_PERIOD) | |
+ { | |
+ case "DAY": | |
+ { | |
+ currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER); | |
+ currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation | |
+ | |
+ if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14) | |
+ { | |
+ _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD; | |
+ } | |
+ else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7) | |
+ { | |
+ _nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2); | |
+ } | |
+ else | |
+ { | |
+ _log.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7"); | |
+ } | |
+ break; | |
+ } | |
+ case "WEEK": | |
+ { | |
+ currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER); | |
+ currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation | |
+ | |
+ if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1) | |
+ { | |
+ _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD; | |
+ } | |
+ else | |
+ { | |
+ _nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2); | |
+ } | |
+ break; | |
+ } | |
+ case "MONTH": | |
+ { | |
+ currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER); | |
+ currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation | |
+ | |
+ _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD; | |
+ break; | |
+ } | |
+ } | |
+ _olympiadEnd = currentTime.getTimeInMillis(); | |
+ scheduleWeeklyChange(); | |
+ } | |
+ | |
public boolean inCompPeriod() | |
{ | |
return _inCompPeriod; | |
Index: dist/game/config/Olympiad.properties | |
=================================================================== | |
--- dist/game/config/Olympiad.properties (revision 6469) | |
+++ dist/game/config/Olympiad.properties (working copy) | |
@@ -159,4 +159,30 @@ | |
# Maximum number of Class-Irrelevant Team matches a character can join per week | |
# Default: 10 | |
-AltOlyMaxWeeklyMatchesTeam = 10 | |
\ No newline at end of file | |
+AltOlyMaxWeeklyMatchesTeam = 10 | |
+ | |
+ | |
+# --------------------------------------------------------------------------- | |
+# Custom Olympiad period settings | |
+# --------------------------------------------------------------------------- | |
+# Example for Olympiad every 2 weeks: | |
+# AltOlyUseCustomPeriodSettings = True | |
+# AltOlyPeriod = WEEK | |
+# AltOlyPeriodMultiplier = 2 | |
+# --------------------------------------------------------------------------- | |
+# Enable/disable custom period settings. | |
+# Default: False | |
+AltOlyUseCustomPeriodSettings = False | |
+ | |
+# Change the type of delay between two Olympiads. | |
+# Available values: MONTH, WEEK, DAY | |
+# Default: MONTH | |
+AltOlyPeriodType = MONTH | |
+ | |
+# Change the Olympiad frequency. | |
+# The value is a multiplier of period type, | |
+# i.e. if type is MONTH and multiplier is 2, | |
+# then Olympiad will occur every 2 months. | |
+# Default: 1 | |
+# Note! If type = DAY, multiplier must be >= 7! | |
+AltOlyPeriodMultiplier = 1 | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment