summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/011-3/flood.txt2
-rw-r--r--npc/commands/super-menu.txt14
2 files changed, 16 insertions, 0 deletions
diff --git a/npc/011-3/flood.txt b/npc/011-3/flood.txt
index 9bf9b2684..db9ac6888 100644
--- a/npc/011-3/flood.txt
+++ b/npc/011-3/flood.txt
@@ -31,6 +31,8 @@ OnMinute42:
OnMinute46:
OnMinute52:
OnMinute56:
+ // Check if auto-restart was scheduled
+ SchedRestart();
OnSkipFlood:
if ($@GM_OVERRIDE) debugmes "[Flood] Cycle begin";
.@fd=!(getmapmask("011-3")&MASK_SPECIAL); // .@fd - is flooded?
diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt
index faddd70d6..bf3923c92 100644
--- a/npc/commands/super-menu.txt
+++ b/npc/commands/super-menu.txt
@@ -210,6 +210,20 @@ OnWed0300:
if (!$AUTORESTART || gettime(GETTIME_DAYOFMONTH) > 7) end;
atcommand("@serverexit 101");
end;
+}
+
+// Auto-restart scheduled
+function script SchedRestart {
+ if (debug && $SCHED_RESTART) {
+
+ if ($SCHED_RESTART == 1)
+ $SCHED_RESTART=gettimetick(2)+900;
+ if ($SCHED_RESTART > gettimetick(2))
+ atcommand("@serverexit 101");
+
+ kamibroadcast("A restart has been scheduled to about %s.", FuzzyTime($SCHED_RESTART));
+ }
+ return;
}