summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Botosh <rumly111@gmail.com>2015-09-28 12:09:37 +0300
committerJoseph Botosh <rumly111@gmail.com>2015-09-28 12:09:37 +0300
commitb44b5b1ee49bf036ddda402f2357d0c7a88cf07f (patch)
treec6c5eca663497358fb3fcd26cf64dc00959d9fac
parent5d87a5aff44fbc5a6acb15afad26141fa8633094 (diff)
downloadserverdata-b44b5b1ee49bf036ddda402f2357d0c7a88cf07f.tar.gz
serverdata-b44b5b1ee49bf036ddda402f2357d0c7a88cf07f.tar.bz2
serverdata-b44b5b1ee49bf036ddda402f2357d0c7a88cf07f.tar.xz
serverdata-b44b5b1ee49bf036ddda402f2357d0c7a88cf07f.zip
Juscare now stops moving and turns to player for dialog
-rw-r--r--npc/001-1/juscare.txt31
1 files changed, 29 insertions, 2 deletions
diff --git a/npc/001-1/juscare.txt b/npc/001-1/juscare.txt
index 78cc09327..a81cbc275 100644
--- a/npc/001-1/juscare.txt
+++ b/npc/001-1/juscare.txt
@@ -7,8 +7,35 @@
001-1,118,92,0 script Juscare#001-1 NPC_HUMAN_MALE_LEGION_ARTIS,{
- npctalk3 l("It is a sunny day, don't you think?");
- end;
+
+ function shouldTurn {
+ .@tree = findmovegraphlabel("inn_tree");
+ .@table = findmovegraphlabel("inter_inn_fav_table");
+ if (.movepos == .@tree || .movepos == .@table)
+ return 0;
+ return 1;
+ }
+
+ function localClose {
+ if (@Juscar_old_dir > 0)
+ .dir = @Juscar_old_dir;
+ npc_resumemove;
+ close;
+ }
+
+ npc_pausemove;
+ @Juscar_old_dir = -1;
+ if (shouldTurn())
+ {
+ getmapxy(.@map$, .@cx, .@cy, 0);
+ @Juscar_old_dir = .dir;
+ npc_turntoxy(.@cx, .@cy);
+ }
+
+ speech 4,
+ l("It is a sunny day, don't you think?");
+
+ localClose;
OnTimer1000:
if (!isunitwalking())