[logic]
active = sr_idle@wait

[sr_idle@wait]
on_info = {+makdm_message_1_sended} sr_idle@spawn_npc_detective %=create_squad(bar_a8_skazochnik_squad:bar_a8) =create_squad(bar_a6_kholodec_squad:bar_a6) =create_squad(bar_a5_kosoy_squad:bar_a5) =create_squad(bar_a2_opalev_squad:bar_a2)%

[sr_idle@spawn_npc_detective]
on_info  = {+bar_ivan_det_dial_1_end}     sr_idle@spawn_corpus_detective %=remove_squads(bar_a8_skazochnik_squad:bar_a6_kholodec_squad:bar_a5_kosoy_squad:bar_a2_opalev_squad)%
on_info2 = {+bar_ivan_det_one_dial_end}   sr_idle@quest_control_0 %=remove_squads(bar_a8_skazochnik_squad:bar_a6_kholodec_squad:bar_a5_kosoy_squad:bar_a2_opalev_squad)%
on_info3 = {+ivan_detectiv_quest_no_time} sr_idle@quest_control_0 %=remove_squads(bar_a8_skazochnik_squad:bar_a6_kholodec_squad:bar_a5_kosoy_squad:bar_a2_opalev_squad)%

[sr_idle@spawn_corpus_detective]
on_info  = {+actor_killed_opalev}     sr_idle@quest_control_0
on_info2 = {+actor_killed_kosoy}      sr_idle@quest_control_0
on_info3 = {+actor_killed_kholodec}   sr_idle@quest_control_0
on_info4 = {+actor_killed_skazochnik} sr_idle@quest_control_0
on_info5 = {+actor_choose_kosoy -actor_killed_kosoy}           sr_idle@quest_control_0 %=spawn_corpse(stalk_kosoy_dead:detect_dead_way)%
on_info6 = {+actor_choose_skazochnik -actor_killed_skazochnik} sr_idle@quest_control_0 %=spawn_corpse(stalk_skazochnik_dead:detect_dead_way)%
on_info7 = {+actor_choose_opalev -actor_killed_opalev}         sr_idle@quest_control_0 %=spawn_corpse(stalk_opalev_dead:detect_dead_way)%
on_info8 = {+actor_choose_kholodec -actor_killed_kholodec}     sr_idle@quest_control_0 %=spawn_corpse(stalk_kholodec_dead:detect_dead_way)%

[sr_idle@quest_control_0]
on_info = {!black_screen +fplay_vadim_dialog_end} sr_idle@quest_control_1 %=remove_squads(jup_a26_stalk_final_squad:jup_a26_stalk1_final_squad:jup_a26_stalk2_final_squad:jup_a26_stalk3_final_squad)%

[sr_idle@quest_control_1]
on_info = sr_idle@quest_control_2 %=clear_smart_terrain(jup_a12) =clear_smart_terrain(jup_a31)%

[sr_idle@quest_control_2]
on_game_timer = 30 | sr_idle@quest_control_3 %=create_squad(jup_a12_fp_agent_squad:jup_a12) =create_squad(jup_a31_fp_agent_squad:jup_a31)%

[sr_idle@quest_control_3]
on_info  = {+jup_a31_fp_agent_squad_dead +jup_a12_fp_agent_squad_dead} sr_idle@quest_control_4

[sr_idle@quest_control_4]
on_game_timer = 30 | sr_idle@quest_control_5 %=give_task( fplay_sherkchan_quest )%

[sr_idle@quest_control_5]
on_info  = {+fplay_sherkchan_dialog_yes_end} sr_idle@quest_control_7 %=create_squad(jup_a18_fp_agent_1_squad:jup_a18) =create_squad(jup_a18_fp_agent_2_squad:jup_a18) =create_squad(jup_a18_fp_agent_3_squad:jup_a18)%
on_info2 = {+fplay_sherkchan_dialog_noo_end} sr_idle@quest_control_6 %=create_squad(jup_a18_fp_agent_1_squad:jup_a18) =create_squad(jup_a18_fp_agent_2_squad:jup_a18) =create_squad(jup_a18_fp_agent_3_squad:jup_a18)%

[sr_idle@quest_control_6]
on_info = {=actor_in_zone( jup_a18_sr_noweapon )} sr_idle@quest_control_7 %=create_squad(jup_a18_bandit_assault_squad:jup_a18)%

[sr_idle@quest_control_7]
on_info  = {+jup_a18_fp_agent_1_squad_dead +jup_a18_fp_agent_2_squad_dead +jup_a18_fp_agent_3_squad_dead} sr_idle@quest_control_8 %+fplay_sherkchan_quest_done%

[sr_idle@quest_control_8]
on_game_timer = 30 | sr_idle@quest_control_9 %=give_task( fplay_lesnik_1_quest )%

[sr_idle@quest_control_9]
on_game_timer = 3000 | {!black_screen +fplay_glomar_dialog_end +jup_a9_under_enot_bandit +jup_a14_under_cherep_bandit +quest_brodiaga_is_done +radar_a4_lider_quest_is_done} sr_idle@quest_control_10 %=give_task( fplay_degtyr_1_quest )%

[sr_idle@quest_control_10]
on_info = {!black_screen +fplay_degtyr_1_dialog_end} sr_idle@quest_control_11

[sr_idle@quest_control_11]
on_info = sr_idle@quest_control_12 %=give_task( fplay_maria_quest )%

[sr_idle@quest_control_12]
on_game_timer  = 30 | {=squad_exist(jup_a1_rebel_new_squad)} sr_idle@quest_control_13 %=give_task( fplay_barry_quest )%
on_game_timer2 = 30 | {!squad_exist(jup_a1_rebel_new_squad)} sr_idle@nil

[sr_idle@quest_control_13]
on_info = {+fplay_barry_1_dialog_end} sr_idle@quest_control_14

[sr_idle@quest_control_14]
on_game_timer  = 21600 | {=dist_between_actor_and_smart_ge(jup_a1:150)} sr_idle@quest_control_15 %=remove_squads(jup_a1_rebel_new_squad)%

[sr_idle@quest_control_15]
on_game_timer = 20 | sr_idle@nil %=create_squad(jup_a1_klava_squad:jup_a1)%

[sr_idle@nil]
