;--------------------------------------------------------------------------
; State 0
;--------------------------------------------------------------------------
[logic@val_prisoner]
active          = walker@wander
meet            = meet@ignore_abuse
on_death        = death
combat_ignore   = combat_ignore

[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@ignore_abuse]
meet_dialog     =
meet_state      =
meet_state_wpn  =
victim          =
victim_wpn      =
use             = false
use_wpn         = false
abuse           = false

;--------------------------------------------------------------------------
; основной денжер
;--------------------------------------------------------------------------
[danger@small]
ignore_types          = corpse
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@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@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_info                             = {+val_prisoner_door_unlocked} walker@outside %-val_prisoner_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@main
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true


;--------------------------------------------------------------------------
; State 1
;--------------------------------------------------------------------------
[logic@val_prisoner_free]
active          = walker@outside
;meet            = meet@ignore_abuse
on_death        = death
combat_ignore   = combat_ignore

;--------------------------------------------------------------------------
; выходим за двери
;--------------------------------------------------------------------------
[walker@outside]
path_walk                           = captive_outside_door_walk
path_look                           = captive_outside_door_look
on_signal                           = arrived | remark@outside %+val_prisoner_free%
on_info                             = {-val_prisoner_door_unlocked} walker@sit
meet                                = meet@main1
combat_ignore_cond                  = always
combat_ignore_keep_when_attacked    = true

;--------------------------------------------------------------------------
; благодарим игрока
;--------------------------------------------------------------------------
[remark@outside]
anim                    = wait
on_timer                = 60000 | walker@escape ;%+val_prisoner_scene_end%
on_actor_dist_ge_nvis   = 20 | walker@escape ;%+val_prisoner_scene_end%
;on_info                 = {-val_prisoner_door_unlocked} walker@sit
;on_info                 = {+val_prisoner_raid} walker@escape
meet                    = meet@main
danger                  = danger@small
;combat_ignore_cond      = always ;{=check_fighting(403)}

;--------------------------------------------------------------------------
; идем мочить братву
;--------------------------------------------------------------------------
[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
combat_ignore_cond                  = {=check_fighting(403)}
