diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-07-07 16:23:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-07-07 16:23:01 -0300 |
commit | 753d8a34cfa64c4d7fcc2cd3fd0563512d7f119a (patch) | |
tree | d2a3aa21b30f9203406d9cb93e0b9b9e588085a1 /npc/functions/shake.txt | |
parent | 3e60bb1d7c2cc99df802b34c065fd1f3ab7d5eeb (diff) | |
parent | 5f538fbcfdd675bbf88253232569c25b7f5b3b78 (diff) | |
download | serverdata-753d8a34cfa64c4d7fcc2cd3fd0563512d7f119a.tar.gz serverdata-753d8a34cfa64c4d7fcc2cd3fd0563512d7f119a.tar.bz2 serverdata-753d8a34cfa64c4d7fcc2cd3fd0563512d7f119a.tar.xz serverdata-753d8a34cfa64c4d7fcc2cd3fd0563512d7f119a.zip |
[skip ci] Merge branch 'master' into heroes_hold
Diffstat (limited to 'npc/functions/shake.txt')
-rw-r--r-- | npc/functions/shake.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/npc/functions/shake.txt b/npc/functions/shake.txt new file mode 100644 index 000000000..a20fc6b43 --- /dev/null +++ b/npc/functions/shake.txt @@ -0,0 +1,35 @@ +// 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; + restorecam; + closedialog; + } + end; + +// Called by GM Command +OnGM: + @shake=0; + @max_shake=rand(6,10); + 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; +} |