From c1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46 Mon Sep 17 00:00:00 2001 From: Reid Date: Sun, 17 Jan 2016 02:35:43 +0100 Subject: Add a lock to prevent NPC spamming on juscare. --- npc/001-1/juscare.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/001-1/juscare.txt b/npc/001-1/juscare.txt index 7ad1ecdb..3a2d0c51 100644 --- a/npc/001-1/juscare.txt +++ b/npc/001-1/juscare.txt @@ -5,7 +5,6 @@ // Description: // Juscare, walking NPC of the legion of Aemil on the right part of the Agora of Artis. - 001-1,118,92,0 script Juscare#001-1 NPC_HUMAN_MALE_LEGION_ARTIS,{ function shouldTurn { @@ -23,6 +22,17 @@ close; } + function randomTalk { + debugmes "Juscare lock value : " + Repeat_NPC_lock + " current time " + gettimetick(2); + + if (Repeat_NPC_lock <= gettimetick(2)) + { + Repeat_NPC_lock = gettimetick(2) + 2; + debugmes "ACCEPTED"; + villagertalk; + } + } + npc_pausemove; @Juscar_old_dir = -1; if (shouldTurn()) @@ -32,12 +42,13 @@ npc_turntoxy(.@cx, .@cy); } - villagertalk; + randomTalk; localClose; OnTimer1000: dographmovestep; + debugmes "Juscare lock value : " + Repeat_NPC_lock; OnInit: .sex = G_MALE; -- cgit v1.2.3-70-g09d2