From b44b5b1ee49bf036ddda402f2357d0c7a88cf07f Mon Sep 17 00:00:00 2001 From: Joseph Botosh Date: Mon, 28 Sep 2015 12:09:37 +0300 Subject: Juscare now stops moving and turns to player for dialog --- npc/001-1/juscare.txt | 31 +++++++++++++++++++++++++++++-- 1 file 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()) -- cgit v1.2.3-60-g2f50