From 3b8afeb72911f0a0ff77c2ce54c92d96e0826615 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 9 Sep 2019 13:02:16 -0300 Subject: Partly rewrite @shake --- npc/functions/shake.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'npc/functions/shake.txt') diff --git a/npc/functions/shake.txt b/npc/functions/shake.txt index 3a95d36ae..e3e5268c6 100644 --- a/npc/functions/shake.txt +++ b/npc/functions/shake.txt @@ -3,7 +3,16 @@ // Shake player screen // Usage: // set @max_shake then call OnShake -// call OnGM + +// sshake( {max_shake} ) +function script sshake { + @max_shake=abs(getarg(0, rand2(6,10))); + for (.@s=0; .@s < @max_shake; .@s++) { + movecam rand(-20,20), rand(-20,20); + sleep2(50); + } + return; +} - script shake 32767,{ end; @@ -26,7 +35,7 @@ OnShake: // Called by GM Command OnGM: @shake=0; - @max_shake=rand(6,10); + @max_shake=rand2(6,10); addtimer(50, "shake::OnShake"); end; -- cgit v1.2.3-60-g2f50