;*****************************
;********* ally 1 ***********

[logic@work1]
active = patrol@attack_work1
suitable = {=check_npc_name(lim_csky_commander) =is_gulag_attacking_target(lim_smart_terrain_3) -lim_smart_3_captured} true
on_combat = combat
prior = 50

[combat]
on_info = %+lim_csky_in_ambush%

[patrol@attack_work1]
path_walk = spec_attack_1_walk
path_look = spec_attack_1_look
commander = true
move_type = assault
on_signal = arrive_to_wait | %=request_current_squad_stage(prepare)%
on_info = {+lim_csky_in_ambush +lim_ambush2} walker@retreat_work1 %=request_current_squad_stage(prepare)%
;on_info2 = %=restore_health%

[walker@retreat_work1]
combat_ignore_cond = {!enemy_in_zone(lim_smart_terrain_3_defence)}
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_retreat_1_walk
path_look = spec_retreat_1_look
;on_info = %=restore_health%

;***********************************

[logic@work2]
active = patrol@attack_work2
suitable = {=check_npc_name(lim_csky_soldier) =is_gulag_attacking_target(lim_smart_terrain_3) -lim_smart_3_captured} true
on_combat = combat

[patrol@attack_work2]
combat_ignore_cond = {!enemy_in_zone(lim_smart_terrain_3_defence)}
path_walk = spec_attack_1_walk
path_look = spec_attack_1_look
move_type = assault
on_signal = arrive_to_wait | %=request_current_squad_stage(prepare)%
on_info = {+lim_csky_in_ambush +lim_ambush2} walker@retreat_work2
;on_info2 = %=restore_health%

[walker@retreat_work2]
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_retreat_2_walk
path_look = spec_retreat_1_look
;on_info = %=restore_health%

;***********************************

[logic@work3]
active = patrol@attack_work3
suitable = {=check_npc_name(lim_csky_soldier) =is_gulag_attacking_target(lim_smart_terrain_3) -lim_smart_3_captured} true
on_combat = combat

[patrol@attack_work3]
combat_ignore_cond = {!enemy_in_zone(lim_smart_terrain_3_defence)}
path_walk = spec_attack_2_walk
path_look = spec_attack_2_look
move_type = assault
on_info = {+lim_csky_in_ambush +lim_ambush2} walker@retreat_work3 %=request_current_squad_stage(prepare)%
;on_info2 = %=restore_health%
on_signal = arrive_to_wait | %=request_current_squad_stage(prepare)%

[walker@retreat_work3]
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_retreat_3_walk
path_look = spec_retreat_1_look
;on_info = %=restore_health%

;***********************************

[logic@work4]
active = patrol@attack_work4
suitable = {=check_npc_name(lim_csky_soldier) =is_gulag_attacking_target(lim_smart_terrain_3) -lim_smart_3_captured} true
on_combat = combat

[patrol@attack_work4]
combat_ignore_cond = {!enemy_in_zone(lim_smart_terrain_3_defence)}
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_attack_2_walk
path_look = spec_attack_2_look
move_type = assault
on_info = {+lim_csky_in_ambush +lim_ambush2} walker@retreat_work4 %=request_current_squad_stage(prepare)%
;on_info2 = %=restore_health%
on_signal = arrive_to_wait | %=request_current_squad_stage(prepare)%

[walker@retreat_work4]
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_retreat_4_walk
path_look = spec_retreat_1_look
;on_info = %=restore_health%

;***********************************

[logic@work5]
active = patrol@attack_work5
suitable = {=check_npc_name(lim_csky_soldier) =is_gulag_attacking_target(lim_smart_terrain_3) -lim_smart_3_captured} true
on_combat = combat

[patrol@attack_work5]
combat_ignore_cond = {!enemy_in_zone(lim_smart_terrain_3_defence)}
path_walk = spec_attack_2_walk
path_look = spec_attack_2_look
move_type = assault
on_info = {+lim_csky_in_ambush +lim_ambush2} walker@retreat_work5 %=request_current_squad_stage(prepare)%
;on_info2 = %=restore_health%
on_signal = arrive_to_wait | %=request_current_squad_stage(prepare)%

[walker@retreat_work5]
out_restr = lim_smart_2_3_bufer_zone
path_walk = spec_retreat_5_walk
path_look = spec_retreat_1_look
;on_info = %=restore_health%