diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-08-20 12:25:41 -0400 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-08-22 11:45:09 -0400 |
commit | 2c87bb38c881639bed963e7933a1e9d9c2e8e6a3 (patch) | |
tree | d9e26c7592316293f333a7384c6f9a92b2afe8bd /npc/functions/main.txt | |
parent | e9c90337a6057b66faad6759ff418e8a5f162cfe (diff) | |
download | serverdata-2c87bb38c881639bed963e7933a1e9d9c2e8e6a3.tar.gz serverdata-2c87bb38c881639bed963e7933a1e9d9c2e8e6a3.tar.bz2 serverdata-2c87bb38c881639bed963e7933a1e9d9c2e8e6a3.tar.xz serverdata-2c87bb38c881639bed963e7933a1e9d9c2e8e6a3.zip |
fix the npc talk lock mechanism, make some other npcs use it
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r-- | npc/functions/main.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index f3fca9b4..b2827a52 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -171,29 +171,29 @@ function script compareandsetq { function script npctalkonce { if (getarg(2, 0) == 0) { - if (now() <= @misc_NPC_lock) + if (gettimetick(2) <= @NPC_TALK_LOCK[getnpcid(0)]) { - @misc_NPC_lock = now() + getarg(1, 1); return false; } + @NPC_TALK_LOCK[getnpcid(0)] = gettimetick(2) + getarg(1, 1); npctalk3(getarg(0)); } else if (getarg(2, 0) == 1) { - if (now() <= .talk_lock) + if (gettimetick(2) <= .talk_lock) { - .talk_lock = now() + getarg(1, 1); return false; } + .talk_lock = gettimetick(2) + getarg(1, 1); npctalk(getarg(0)); } else if (getarg(2, 0) == 2) { - if (now() <= @misc_NPC_lock) + if (gettimetick(2) <= @NPC_TALK_LOCK[getnpcid(0)]) { - @misc_NPC_lock = now() + getarg(1, 1); return false; } + @NPC_TALK_LOCK[getnpcid(0)] = gettimetick(2) + getarg(1, 1); message(strcharinfo(0), getarg(0)); } |