summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/siege.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index 765de269c..35b681102 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -346,6 +346,23 @@ function script do_siege {
.@n$=getarg(4);
.@t=getarg(5);
+ // If no active player, KILL THE SCRIPT
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ .@idle = 0;
+ for (.@i = 0; .@i < .@c; .@i++) {
+ attachrid(.@players[.@i]);
+ if (checkidle() < 300)
+ .@idle++;
+ detachrid();
+ }
+
+ // No one is active, cancel the event
+ if (!.@idle) {
+ kamibroadcast(col(b("EVENT CANCELLED DUE TO PLAYER INACTIVITY"),1));
+ $@MK_AGGRO=$@MK_AGGRO/5; // Lower aggro bar to 20%
+ end;
+ }
+
// In past, we had a $@SIEGE_<town> to determine difficulty
// This behavior is now deprecated, we use a global $SIEGE_DIFFICULTY
// Which raises in 1 every victory and lowers in 1 every defeat (capped at 1)