summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2016-01-17 02:35:43 +0100
committerReid <reidyaro@gmail.com>2016-01-17 02:39:48 +0100
commitc1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46 (patch)
tree20127a96eb393642aca9f003195ba0a79825a9d8
parent2f3d2b50848ac65abefaaccf356ef39ee1796e66 (diff)
downloadserverdata-c1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46.tar.gz
serverdata-c1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46.tar.bz2
serverdata-c1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46.tar.xz
serverdata-c1af08c958ce9f30b7e2bbf6cda8e0aeaec97b46.zip
Add a lock to prevent NPC spamming on juscare.
-rw-r--r--npc/001-1/juscare.txt15
1 files changed, 13 insertions, 2 deletions
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;