summaryrefslogtreecommitdiff
path: root/npc/functions/shake.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-07-07 02:33:09 -0300
committerJesusaves <cpntb1@ymail.com>2018-07-07 02:33:09 -0300
commit1076faa26b09f6fb9a7cc7bfa526adf043aefe1e (patch)
treec700fb253a806817b29de7d3cabf87af49e4aafb /npc/functions/shake.txt
parent08bb9c0235f1a29e55055a76ac1773b8cdffded8 (diff)
downloadserverdata-1076faa26b09f6fb9a7cc7bfa526adf043aefe1e.tar.gz
serverdata-1076faa26b09f6fb9a7cc7bfa526adf043aefe1e.tar.bz2
serverdata-1076faa26b09f6fb9a7cc7bfa526adf043aefe1e.tar.xz
serverdata-1076faa26b09f6fb9a7cc7bfa526adf043aefe1e.zip
@shake :>
Diffstat (limited to 'npc/functions/shake.txt')
-rw-r--r--npc/functions/shake.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/npc/functions/shake.txt b/npc/functions/shake.txt
new file mode 100644
index 000000000..0dabfb602
--- /dev/null
+++ b/npc/functions/shake.txt
@@ -0,0 +1,31 @@
+// Shake player screen
+
+- script shake 32767,{
+ end;
+
+// Loops until @shake is @max_shake
+OnShake:
+ @shake+=1;
+ movecam rand(-20,20), rand(-20,20);
+ if (@shake < @max_shake)
+ addtimer(50, "shake::OnShake");
+ else
+ @shake=0;
+ end;
+
+// Called by GM Command
+OnGM:
+ @shake=0;
+ @max_shake=rand(4,8);
+ addtimer(50, "shake::OnShake");
+ end;
+
+OnCall:
+ getmapxy(.@m$,.@x,.@y,0);
+ areatimer(.@m$, .@x-15, .@y-15, .@x+15, .@y+15, 10, "shake::OnGM");
+ end;
+
+OnInit:
+ bindatcmd "shake", "shake::OnCall", 80, 80, 1;
+ end;
+}