From 61c62e93f3e0cda8018641034cd1e85634dc3bcb Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 4 Apr 2021 17:11:24 -0300 Subject: Nivalis Liberation Day will now begin "exact" two weeks after Hurnscald Liberation Advised level: 30+ Event will happen on the Saturday after the two weeks, actually, so up to 20 days. --- npc/012-1/guards.txt | 10 ++++++++-- npc/019-2/guards.txt | 41 +++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/npc/012-1/guards.txt b/npc/012-1/guards.txt index 26994e822..a0eb38b4a 100644 --- a/npc/012-1/guards.txt +++ b/npc/012-1/guards.txt @@ -496,8 +496,14 @@ OnVictory: $MOST_HEROIC$=strcharinfo(0); bg_destroy(1); bg_destroy(2); - // TODO: Auto-schedule Liberation Day - // two weeks from now, to happen on a saturday (FIXME) + // Auto-schedule Liberation Day + // two weeks from now, to happen on a saturday + .@offset = gettime(GETTIME_WEEKDAY); // How long since sunday? + .@offset += 1; // Move it to Saturday + .@offset += 14; // Add a couple weeks + .@offset += gettimeparam(GETTIME_DAYOFMONTH); // Apply offset to the all days + $NLIB_SEQDAY = .@offset; // Schedule the event + end; OnReward: diff --git a/npc/019-2/guards.txt b/npc/019-2/guards.txt index 88fd736c6..d60aa3803 100644 --- a/npc/019-2/guards.txt +++ b/npc/019-2/guards.txt @@ -19,7 +19,7 @@ if (BaseLevel < 30) goto L_Noob; if (BaseLevel >= 30) goto L_Veteran; close; - } else if (is_gm()) { // TODO: Auto-schedule Liberation Day + } else if (is_gm()) { // NOTE: This is an override label mesc "Initiate Nivalis Liberation Day?", 1; mesc "Event will last 7 days.", 1; select @@ -27,27 +27,33 @@ "Yes", "No"; if (@menu == 2) { - addmapmask "019-3", MASK_MATTACK; - $NLIB_DAY=1; - $NLIB_HIGHTIME=0; - $NLIB_HIGHNAME$=""; - setmapflagnosave("019-3", "000-1", 22, 22); - setmapflagnosave("020-1", "000-1", 22, 22); - setmapflagnosave("023-2", "000-1", 22, 22); - setmapflag("019-3",mf_bexp,25); - setmapflag("020-1",mf_bexp,150); - disablenpc "#019-1_70_21"; - disablenpc "#019-2_37_55"; - disablenpc "#020-1_70_128"; - disablenpc "#020-1_107_55"; - enablenpc "Lightbringer#NLib"; - kamibroadcast("Nivalis Liberation Day has started."); + goto OnNLibStart; } close; } else { legiontalk; end; } end; + +OnNLibStart: + addmapmask "019-3", MASK_MATTACK; + $NLIB_DAY=1; + $NLIB_HIGHTIME=0; + $NLIB_HIGHNAME$=""; + setmapflagnosave("019-3", "000-1", 22, 22); + setmapflagnosave("020-1", "000-1", 22, 22); + setmapflagnosave("023-2", "000-1", 22, 22); + setmapflag("019-3",mf_bexp,25); + setmapflag("020-1",mf_bexp,150); + disablenpc "#019-1_70_21"; + disablenpc "#019-2_37_55"; + disablenpc "#020-1_70_128"; + disablenpc "#020-1_107_55"; + enablenpc "Lightbringer#NLib"; + kamibroadcast("Nivalis Liberation Day has started."); + $NLIB_SEQDAY=false; + end; + // Event Selectors L_Noob: mesn; @@ -126,6 +132,9 @@ OnInit: OnHour00: if ($NLIB_DAY) $NLIB_DAY+=1; + // Begin Nivalis Liberation Day + if ($NLIB_SEQDAY == gettimeparam(GETTIME_DAYOFMONTH)) + goto OnNLibStart; end; OnClock1800: -- cgit v1.2.3-60-g2f50