Jump to content
  • 0

I Try To Undestand How I Could Set Every Day New Olympiad Period


Question

Posted (edited)

as tittle say , i try to set everyday new period , but nothing ...

 

any ideas? what i should change ?

 

 

need core re-work ?

 

i set

 

# Default: 1
CurrentCycle = 1
 
# Default: 0
Period = 0
 
# Default: 0
OlympiadEnd = 86400000
 
# Default: 0
ValidationEnd = 6000
 
# Default: 0
NextWeeklyChange = 0
Edited by Pamela32

7 answers to this question

Recommended Posts

  • 0
Posted

Core rework is way better than shity configs.

 

If you rework it from core, you have to change only 2 lines.

 

xmm , ok i will search that.

  • 0
Posted (edited)

Para poder configurar las olimpiadas a vuestro gusto, creado por Pandragon.

### 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

 

found this , i m not java coder , i thing i m close to fix it , but not yet.

Edited by SweeTs
  • 0
Posted

-       currentTime.add(Calendar.MONTH, 1);

- currentTime.set(Calendar.DAY_OF_MONTH, 1);

+ currentTime.add(Calendar.HOUR, 24);

remember there's always validation day after calculation of new heroes.
  • 0
Posted (edited)
-       currentTime.add(Calendar.MONTH, 1);
-       currentTime.set(Calendar.DAY_OF_MONTH, 1);
+	currentTime.add(Calendar.HOUR, 24);
remember there's always validation day after calculation of new heroes.

 

 

 

as i see i have to set validation at least 6 hours .

 

 

 

 

 

if some1 can give me an example , about daily olympiad period.

Edited by Pamela32

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock