;--------------------------------------------------------------------------
; State 0
;--------------------------------------------------------------------------
[logic@val_prisoner]
active          = walker@wander
meet            = meet@ignore_abuse
on_death        = death
help_wounded_enabled = false
corpse_detection_enabled = false
tolerant = bandit,monster

[death]
on_info         = %+val_prisoner_dead%

;--------------------------------------------------------------------------
; основной диалог
;--------------------------------------------------------------------------
[meet@main]
meet_dialog     = val_prisoner_hello
meet_state      = 5|wait
meet_state_wpn  = 5|wait
victim          = 7|actor
victim_wpn      = 7|actor
use             = true
use_wpn         = true

[meet@main1]
meet_dialog     = val_prisoner_hello
meet_state      = 2|wait
meet_state_wpn  = 2|wait
victim          = 2|actor
victim_wpn      = 2|actor
use             = true
use_wpn         = true

[meet@near_door]
meet_dialog     = val_prisoner_hello
meet_state      = 20|hello@val_prisoner_captive_come_here
meet_state_wpn  = 20|hello@val_prisoner_captive_come_here
victim          = 20|actor
victim_wpn      = 20|actor
use             = true
use_wpn         = true

;--------------------------------------------------------------------------
; игнорирование
;--------------------------------------------------------------------------
[meet@ignore_abuse]
use             = false
use_wpn         = false
abuse           = false

;--------------------------------------------------------------------------
; основной денжер
;--------------------------------------------------------------------------
[danger@no]
ignore_distance = 0
[danger@small]
ignore_distance_corpse = 0
ignore_distance_sound = 15

;--------------------------------------------------------------------------
; режим ожидания
;--------------------------------------------------------------------------
[walker@wander]
path_walk                           = captive_cage_walk
path_look                           = captive_cage_look
on_info                             = {+val_prisoner_sit} walker@sit
;on_info2                            = {+val_prisoner_door_unlocked} walker@outside
on_actor_in_zone                    = val_prisoner_window_zone | walker@near_window
on_actor_in_zone2                   = val_prisoner_near_door_zone | walker@near_door %+val_prisoner_near_door%
on_actor_dist_ge                    = 30 | walker@actor_far
meet                                = meet@ignore_abuse ;meet@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; игрок отошел дальше 30 метров
;--------------------------------------------------------------------------
[walker@actor_far]
path_walk                           = captive_sit_walk
path_look                           = captive_sit_look
on_actor_dist_le                    = 30 | walker@wander
meet                                = meet@ignore_abuse
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; игрок стоит возле окна. диалог с просьбой о помощи
;--------------------------------------------------------------------------
[walker@near_window]
path_walk                           = captive_window_walk
path_look                           = captive_window_look
on_info                             = {+val_prisoner_sit} walker@sit
;on_info2                            = {+val_prisoner_door_unlocked} walker@outside
on_actor_not_in_zone                = val_prisoner_window_zone | walker@wander
on_actor_in_zone                    = val_prisoner_near_door_zone | walker@near_door %+val_prisoner_near_door%
meet                                = meet@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; сидим, ждем когда игрок освободит нас
;--------------------------------------------------------------------------
[walker@sit]
path_walk                           = captive_sit_walk
path_look                           = captive_sit_look
;on_info                             = {+val_prisoner_door_unlocked} walker@outside
on_actor_in_zone                    = val_prisoner_near_door_zone | walker@near_door %+val_prisoner_near_door%
meet                                = meet@ignore_abuse ;meet@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; игрок возле двери
;--------------------------------------------------------------------------
[walker@near_door]
path_walk                           = captive_near_door_walk
path_look                           = captive_near_door_look
def_state_moving1                   = run
def_state_moving2                   = run
def_state_moving3                   = run
;on_actor_dist_le_nvis               = 10| remark@near_door1
on_signal                           = arrived| remark@near_door1
on_actor_not_in_zone                = val_prisoner_near_door_zone| {+val_prisoner_sit} walker@sit %-val_prisoner_near_door%, walker@wander %-val_prisoner_near_door%
meet                                = meet@ignore_abuse ;meet@near_door
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; игрок возле двери
;--------------------------------------------------------------------------
[remark@near_door1]
anim                                = wait_na
snd                                 = val_prisoner_captive_come_here
target                              = actor
on_actor_dist_le_nvis               = 7| remark@near_door2
on_actor_not_in_zone                = val_prisoner_near_door_zone| {+val_prisoner_sit} walker@sit %-val_prisoner_near_door%, walker@wander %-val_prisoner_near_door%
meet                                = meet@ignore_abuse ;meet@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; игрок возле двери
;--------------------------------------------------------------------------
[remark@near_door2]
anim                                = wait_na
snd                                 = val_prisoner_captive_open
target                              = actor
;on_actor_dist_ge_nvis               = 14| walker@near_door
on_actor_not_in_zone                = val_prisoner_near_door_zone| {+val_prisoner_sit} walker@sit %-val_prisoner_near_door%, walker@wander %-val_prisoner_near_door%
meet                                = meet@ignore_abuse ;meet@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true


;--------------------------------------------------------------------------
; State 1
;--------------------------------------------------------------------------
[logic@val_prisoner_free]
active          = walker@outside
on_death        = death
corpse_detection_enabled = false
help_wounded_enabled = false

;--------------------------------------------------------------------------
; выходим за двери
;--------------------------------------------------------------------------
[walker@outside]
path_walk                           = captive_outside_door_walk
path_look                           = captive_outside_door_look
def_state_moving                    = run
on_info                             = {+val_prisoner_free} remark@outside %=set_sound_play(val_prisoner_captive_thanx) =actor_friend%, %=stop_sound_play%
meet                                = meet@ignore_abuse ;meet@main1
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true
danger                  = danger@no
tolerant				= bandit

;--------------------------------------------------------------------------
; благодарим игрока
;--------------------------------------------------------------------------
[remark@outside]
anim                    = wait
target                  = actor
;on_timer                = 60000 | walker@escape
;on_actor_dist_ge_nvis   = 15 | walker@escape %+val_prisoner_go%
on_info					= {+val_prisoner_go} walker@escape
meet                    = meet@main
danger                  = danger@small

;--------------------------------------------------------------------------
; идем мочить братву
;--------------------------------------------------------------------------
[walker@escape]
path_walk				= captive_escape_walk
path_look				= captive_escape_look
def_state_moving1		= assault
def_state_moving2		= assault
def_state_moving3		= assault
on_signal				= arrived | %+val_prisoner_scene_end%
meet					= meet@main
help_wounded_enabled	= true
corpse_detection_enabled = true
danger					= danger@small


