summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2019-04-15 12:22:17 -0400
committergumi <git@gumi.ca>2019-04-15 12:22:17 -0400
commitb5191b178686abd365e113fb3ea32a19f70e9276 (patch)
tree48fae0f93530652ecf97aaee27d8e5896604c97c /world/map/npc
parent77a7958485eb6642cdfcb5086d2abf3588c60bc3 (diff)
downloadserverdata-b5191b178686abd365e113fb3ea32a19f70e9276.tar.gz
serverdata-b5191b178686abd365e113fb3ea32a19f70e9276.tar.bz2
serverdata-b5191b178686abd365e113fb3ea32a19f70e9276.tar.xz
serverdata-b5191b178686abd365e113fb3ea32a19f70e9276.zip
add an anti-prsm-sitting tool
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/commands/_import.txt1
-rw-r--r--world/map/npc/commands/automod.txt90
2 files changed, 91 insertions, 0 deletions
diff --git a/world/map/npc/commands/_import.txt b/world/map/npc/commands/_import.txt
index 814530bc..47aa978f 100644
--- a/world/map/npc/commands/_import.txt
+++ b/world/map/npc/commands/_import.txt
@@ -15,3 +15,4 @@ npc: npc/commands/npctalk.txt
npc: npc/commands/music.txt
npc: npc/commands/python.txt
npc: npc/commands/gm.txt
+npc: npc/commands/automod.txt
diff --git a/world/map/npc/commands/automod.txt b/world/map/npc/commands/automod.txt
new file mode 100644
index 00000000..09544852
--- /dev/null
+++ b/world/map/npc/commands/automod.txt
@@ -0,0 +1,90 @@
+-|script|@automod|32767
+{
+ end;
+
+OnCall:
+ if (GM < CMD_AUTOMOD && GM < G_SYSOP) goto L_GM;
+ set @PREV_AUTOMOD, AUTOMOD;
+ if (@args$ == "") goto L_Info;
+ elif (@args$ == "off") goto L_Off;
+ elif (@args$ == "kill") goto L_Kill;
+ elif (@args$ == "move") goto L_Move;
+ elif (@args$ == "block") goto L_Block;
+ elif (@args$ == "kick") goto L_Kick;
+
+ message strcharinfo(0), "automod : invalid mode.";
+ goto L_Info;
+
+L_Off:
+ set AUTOMOD, 0;
+ set ##AUTOMOD, AUTOMOD;
+ message strcharinfo(0), "automod : mode changed to ##Boff##b";
+ // send a fixpos to remove the current collision, if any
+ if (@PREV_AUTOMOD == 3) set Sex, Sex;
+ end;
+
+L_Kill:
+ set AUTOMOD, 1;
+ set ##AUTOMOD, AUTOMOD;
+ message strcharinfo(0), "automod : mode changed to ##Bkill##b";
+ message strcharinfo(0), "automod : players sitting on you will automatically be killed and then moved.";
+ // send a fixpos to remove the current collision, if any
+ if (@PREV_AUTOMOD == 3) set Sex, Sex;
+ end;
+
+L_Move:
+ set AUTOMOD, 2;
+ set ##AUTOMOD, AUTOMOD;
+ message strcharinfo(0), "automod : mode changed to ##Bmove##b";
+ message strcharinfo(0), "automod : players sitting on you will automatically be moved.";
+ // send a fixpos to remove the current collision, if any
+ if (@PREV_AUTOMOD == 3) set Sex, Sex;
+ end;
+
+L_Block:
+ set AUTOMOD, 3;
+ set ##AUTOMOD, AUTOMOD;
+ message strcharinfo(0), "automod : mode changed to ##Bblock##b";
+ message strcharinfo(0), "automod : players will be unable to sit or walk over you while you are sitting. (experimental)";
+ set Sex, Sex;
+ end;
+
+L_Kick:
+ set AUTOMOD, 4;
+ set ##AUTOMOD, AUTOMOD;
+ message strcharinfo(0), "automod : mode changed to ##Bkick##b";
+ message strcharinfo(0), "automod : players sitting on you will automatically be kicked from the server.";
+ // send a fixpos to remove the current collision, if any
+ if (@PREV_AUTOMOD == 3) set Sex, Sex;
+ end;
+
+L_GM:
+ message strcharinfo(0), "automod : GM command is level "+ CMD_AUTOMOD +", but you are level " + GM;
+ end;
+
+L_Info:
+ if (AUTOMOD == 0)
+ message strcharinfo(0), "automod : current mode: ##Boff##b kill move block kick";
+ elif (AUTOMOD == 1)
+ message strcharinfo(0), "automod : current mode: off ##Bkill##b move block kick";
+ elif (AUTOMOD == 2)
+ message strcharinfo(0), "automod : current mode: off kill ##Bmove##b block kick";
+ elif (AUTOMOD == 3)
+ message strcharinfo(0), "automod : current mode: off kill move ##Bblock##b kick";
+ elif (AUTOMOD == 4)
+ message strcharinfo(0), "automod : current mode: off kill move block ##Bkick##b";
+ message strcharinfo(0), "automod : you can change mode by doing @automod (mode)";
+ end;
+
+OnPCLoginEvent:
+ if (GM >= CMD_AUTOMOD && ##AUTOMOD)
+ set AUTOMOD, ##AUTOMOD;
+ elif (##AUTOMOD)
+ set ##AUTOMOD, 0;
+ end;
+
+OnInit:
+ registercmd chr(ATCMD_SYMBOL) + "automod", strnpcinfo(0) + "::OnCall";
+ registercmd chr(ATCMD_SYMBOL) + "automode", strnpcinfo(0) + "::OnCall";
+ end;
+}