From b5191b178686abd365e113fb3ea32a19f70e9276 Mon Sep 17 00:00:00 2001 From: gumi Date: Mon, 15 Apr 2019 12:22:17 -0400 Subject: add an anti-prsm-sitting tool --- world/map/npc/commands/_import.txt | 1 + world/map/npc/commands/automod.txt | 90 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 world/map/npc/commands/automod.txt (limited to 'world/map/npc/commands') 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; +} -- cgit v1.2.3-60-g2f50