diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-04-11 12:36:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-04-11 12:36:01 -0300 |
commit | 7880f044e17620f16e3f8ea73a59e3d0f65f8f61 (patch) | |
tree | 90c98a657db32d18290e9a33de2c803ddb28657a | |
parent | becee49d7a50aa5acbfac4a17e8d751340f0f848 (diff) | |
download | serverdata-7880f044e17620f16e3f8ea73a59e3d0f65f8f61.tar.gz serverdata-7880f044e17620f16e3f8ea73a59e3d0f65f8f61.tar.bz2 serverdata-7880f044e17620f16e3f8ea73a59e3d0f65f8f61.tar.xz serverdata-7880f044e17620f16e3f8ea73a59e3d0f65f8f61.zip |
Prsm Handler
-rw-r--r-- | npc/008-1/_import.txt | 1 | ||||
-rw-r--r-- | npc/008-1/prsm.txt | 95 |
2 files changed, 96 insertions, 0 deletions
diff --git a/npc/008-1/_import.txt b/npc/008-1/_import.txt index 96d03c46..c4885d9b 100644 --- a/npc/008-1/_import.txt +++ b/npc/008-1/_import.txt @@ -14,6 +14,7 @@ "npc/008-1/old-man.txt", "npc/008-1/old-woman.txt", "npc/008-1/oscar.txt", +"npc/008-1/prsm.txt", "npc/008-1/sabine.txt", "npc/008-1/shop.txt", "npc/008-1/snarfles.txt", diff --git a/npc/008-1/prsm.txt b/npc/008-1/prsm.txt new file mode 100644 index 00000000..df9ac452 --- /dev/null +++ b/npc/008-1/prsm.txt @@ -0,0 +1,95 @@ +// Evol scripts. +// Author: +// Jesusalva +// Description: +// No sitting or standing on Prsm + +008-1,0,0,0 script #PrsmGuard NPC_HIDDEN,0,0,{ +OnInit: + .accid=0; + .active=false; + end; + +OnPCLogin: + if (strcharinfo(0) == "Prsm") + { + initnpctimer; + .accid=getcharid(3); + } + end; + +OnTimer5000: + if (!attachrid(.accid)) + { + stopnpctimer; + .accid=0; + .active=false; + end; + } + // Prsm is attached + getmapxy(.@m$, .@x, .@y ,0); + if (.@m$ != "008-1" && .active) + { + slide 0, 0; + .active=false; + } + else if (.@m$ == "008-1") + { + .active=true; + slide .@x, .@y; + } + end; + +OnTouch: + // GMs can stand/sit on Prsm because they might be Prsm >.> + if (getgroupid()) + end; + // Start timer (in case player just passed by, and is not trying to annoy Prsm) + addtimer 2000, "#PrsmGuard::OnWarning"; + end; + +OnUnTouch: + deltimer("#PrsmGuard::OnWarning"); + end; + +OnWarning: + switch (@prsm_warning) + { + case 0: + case 3: + dispbottom l("Sitting or standing in Prsm is prohibted. Please move peacefully."); + break; + case 1: + case 4: + case 7: + dispbottom l("Sitting or standing in Prsm is prohibted. YOU HAVE BEEN WARNED!"); + break; + case 2: + case 5: + case 8: + dispbottom l("Moving player preventively."); + getmapxy(.@m$, .@x, .@y, 0); + slide .@x+any(1,-1), .@y+(any(1,-1); + break; + case 6: + case 9: + dispbottom l("Moving and killing player preventively."); + getmapxy(.@m$, .@x, .@y, 0); + slide .@x+any(1,-1), .@y+(any(1,-1); + percentheal -100, -100; + break; + case 10: + default: + dispbottom l("Preventively banning annoying player so Prsm can rest in peace."); + getmapxy(.@m$, .@x, .@y, 0); + slide .@x+any(1,-1), .@y+(any(1,-1); + atcommand "@ban 10mn "+strcharinfo(0); // This is half sane, half insane + break; + } + @prsm_warning+=1; + addtimer rand(3800, 4800), "#PrsmGuard::OnWarning"; + end; + +} + + |