diff options
-rw-r--r-- | npc/functions/siege.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt index 1b34d02d3..10dd96a9d 100644 --- a/npc/functions/siege.txt +++ b/npc/functions/siege.txt @@ -356,25 +356,34 @@ function script do_siege { detachrid(); } - // No one is active, cancel the event (FIXME) + // 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% + + // Cleanup and Garbage Collection + siege_revert(.@m$); + siege_revert(.@o$); + enablenpc("Mana Stone"); + setd("$@SIEGE_"+.@c$, 0); 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) + // But this behavior can be overriden if (!getd("$@SIEGE_"+.@c$)) { .@difc=max(1, getd("$SIEGE_DIFFICULTY")); // And then, we reset $@SIEGE_<town> so it can be manipulated // And set .@difc to this value setd("$@SIEGE_"+.@c$, .@difc); - .@difc=getd("$@SIEGE_"+.@c$); } + // Set difficulty based on previous value + .@difc=getd("$@SIEGE_"+.@c$); + switch (.@t) { // Warmup case 70: |