;==============================================================
;
; Tasks Provided By Clear Sky (drx_ql_tasks_csky.ltx)
;	CoC 1.5b r4 - DoctorX Questlines 2.0
;
;		- Strings file: configs\text\eng\drx_ql_strings_csky.xml
;		- Status functor file: scripts\task_status_functor.script  (functions for status_functor field)
;		- Target functor file: scripts\task_functor.script  (functions for target_functor field)
;		- Preconditions file: scripts\xr_conditions.script  (functions for precondition and condlist_* fields)
;		- Task scripts file: scripts\xr_effects.script  (functions for on_* fields)
;
;	Created by: DoctorX
;	Last revised: November 07, 2019
;
;==============================================================


;//////////////////////////////////////////////////////////////////////////////////////////////////
;
; Clear Sky Storyline Tasks
;
;	Created by DoctorX
;	for DoctorX Questlines 2.0
;	November 07, 2019
;
;--------------------------------------------------------------------------------------------------

;------------------------------------------------
; Clear Sky Search Agroprom Underground Storyline Task-

[drx_ql_csky_sl_task_1]

icon = ui_inGame2_Laboratoriya_X8
storyline = true
prior = 165
weight = 3
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() =drx_ql_is_npc(mar_smart_terrain_base_stalker_leader_marsh) -drx_ql_info_main_task_agr_u_done} true, false

important = true

title = drx_ql_csky_sl_task_1_name
descr = drx_ql_csky_sl_task_1_text
descr_functor = drx_ql_ug_fetch_task_target
job_descr = drx_ql_csky_sl_task_1_about
task_complete_descr = drx_ql_csky_sl_task_1_finish

stage_complete = 2
target_functor = drx_ql_ug_fetch_task_target
target_functor_params = agr_space_restrictor_to_agr_ug_2
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_1)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_1)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_1:drx_ql_location_main_story_1_quest_case_1:main_story_1_quest_case)%
on_init = %=drx_ql_setup_story_item_task(drx_ql_csky_sl_task_1:main_story_1_quest_case) =drx_ql_activate_teleport(agr_space_restrictor_to_agr_ug_1:agr_space_restrictor_to_agr_ug_2:agr_space_restrictor_to_agr_ug_4)%
on_complete = %=drx_ql_reward_item(6000:8000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =drx_ql_release_story_item(main_story_1_quest_case) =inc_task_stage(drx_ql_csky_sl_task_1) +drx_ql_info_main_task_agr_u_done =drx_ql_reset_task(drx_ql_csky_sl_task_1)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_release_story_item(main_story_1_quest_case) =drx_ql_fail_task(drx_ql_csky_sl_task_1) =drx_ql_reset_task(drx_ql_csky_sl_task_1)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_release_story_item(main_story_1_quest_case) =drx_ql_fail_task(drx_ql_csky_sl_task_1) =drx_ql_reset_task(drx_ql_csky_sl_task_1)%

;------------------------------------------------
; Clear Sky Meet With Ivan Trodnik Storyline Task (LINKS TO: Clear Sky Ivan Trodnik Deactivate Brain Scorcher)-

[drx_ql_csky_sl_task_2]

icon = ui_inGame2_Put_v_pripyat
storyline = true
prior = 192
weight = 1
repeat_timeout = 259200
link_info = drx_ql_trodnik_bs_sl_task_link
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() =drx_ql_is_npc(mar_smart_terrain_base_stalker_leader_marsh) =drx_ql_is_alive(mar_smart_terrain_base_doctor) -drx_ql_info_mon_inf_task_started +drx_ql_info_main_task_agr_u_done +drx_ql_info_main_task_labx16_done +drx_ql_actor_has_psi_helmet -drx_ql_info_main_task_x19_done} true, false

important = true

title = drx_ql_csky_sl_task_2_name
descr = drx_ql_csky_sl_task_2_text
job_descr = drx_ql_csky_sl_task_2_about

target = mar_smart_terrain_base_doctor
condlist_0 = {!drx_ql_is_alive(mar_smart_terrain_base_doctor)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_2)} fail
condlist_3 = {-drx_ql_meet_honcho_mar_smart_terrain_base_doctor} complete
on_init = %+drx_ql_meet_honcho_mar_smart_terrain_base_doctor +drx_ql_trodnik_bs_sl_task_link%

on_complete = %=drx_ql_reset_task(drx_ql_csky_sl_task_2)%
on_fail = %-drx_ql_meet_honcho_mar_smart_terrain_base_doctor -drx_ql_trodnik_bs_sl_task_link =drx_ql_fail_task(drx_ql_csky_sl_task_2) =drx_ql_reset_task(drx_ql_csky_sl_task_2)%
on_cancel = %-drx_ql_meet_honcho_mar_smart_terrain_base_doctor -drx_ql_trodnik_bs_sl_task_link =drx_ql_fail_task(drx_ql_csky_sl_task_2) =drx_ql_reset_task(drx_ql_csky_sl_task_2)%

;------------------------------------------------
; Clear Sky Ivan Trodnik Deactivate Brain Scorcher Storyline Task (LINKS FROM: Clear Sky Meet With Ivan Trodnik)-

[drx_ql_csky_sl_task_3]

icon = ui_iconsTotal_bar_radar_deactivate
storyline = true
prior = 165
weight = 1
repeat_timeout = 259200
link_back_info = drx_ql_trodnik_bs_sl_task_link
precondition = {=drx_ql_random_chance(100) =drx_ql_is_npc(mar_smart_terrain_base_doctor) =drx_ql_actor_faction() -drx_ql_info_mon_inf_task_started +drx_ql_info_main_task_agr_u_done +drx_ql_info_main_task_labx16_done +drx_ql_actor_has_psi_helmet -drx_ql_info_main_task_x19_done} true, false

important = true

title = drx_ql_csky_sl_task_3_name
descr = drx_ql_csky_sl_task_3_text
descr_functor = drx_ql_ug_fetch_task_target
job_descr = drx_ql_csky_sl_task_3_about
task_complete_descr = drx_ql_csky_sl_task_3_finish

stage_complete = 2
target_functor = drx_ql_ug_fetch_task_target
target_functor_params = rad_space_restrictor_to_bunker
status_functor = drx_ql_brain_scorcher_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_3)} fail
condlist_1 = {=drx_ql_is_enemy(csky) -drx_ql_mon_inf_is_infiltrator} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_3)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_3:rad_antenna_monolith)%
on_init = %+drx_ql_info_spawn_bs_extraction_squads +drx_ql_info_mon_inf_task_started -drx_ql_meet_honcho_mar_smart_terrain_base_doctor -drx_ql_trodnik_bs_sl_task_link =drx_ql_setup_mon_inf_task() =drx_ql_activate_teleport(rad_space_restrictor_to_bunker)%
on_complete = %=drx_ql_reward_random(9000:12000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_csky_sl_task_3) +drx_ql_info_main_task_x19_done -drx_ql_info_mon_inf_task_started -drx_ql_info_spawn_bs_extraction_squads =drx_ql_reset_task(drx_ql_csky_sl_task_3)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_3) -drx_ql_info_mon_inf_task_started -drx_ql_info_spawn_bs_extraction_squads =drx_ql_reset_task(drx_ql_csky_sl_task_3)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_3) -drx_ql_info_mon_inf_task_started -drx_ql_info_spawn_bs_extraction_squads =drx_ql_reset_task(drx_ql_csky_sl_task_3)%

;------------------------------------------------
; Clear Sky Meet With Novikov Storyline Task (LINKS TO: Clear Sky Novikov Infiltrate Lab X-16)-

[drx_ql_csky_sl_task_4]

icon = ui_inGame2_Put_v_pripyat
storyline = true
prior = 192
weight = 3
repeat_timeout = 259200
link_info = drx_ql_novikov_x16_sl_task_link
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() =drx_ql_is_alive(mar_base_stalker_tech) +drx_ql_info_main_task_agr_u_done +drx_ql_info_main_task_labx18_done -drx_ql_info_main_task_labx16_done} true, false

important = true

title = drx_ql_csky_sl_task_4_name
descr = drx_ql_csky_sl_task_4_text
job_descr = drx_ql_csky_sl_task_4_about

target = mar_base_stalker_tech
condlist_0 = {!drx_ql_is_alive(mar_base_stalker_tech)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_4)} fail
condlist_3 = {-drx_ql_meet_honcho_mar_base_stalker_tech} complete
on_init = %+drx_ql_meet_honcho_mar_base_stalker_tech +drx_ql_novikov_x16_sl_task_link%

on_complete = %=drx_ql_reset_task(drx_ql_csky_sl_task_4)%
on_fail = %-drx_ql_meet_honcho_mar_base_stalker_tech -drx_ql_novikov_x16_sl_task_link =drx_ql_fail_task(drx_ql_csky_sl_task_4) =drx_ql_reset_task(drx_ql_csky_sl_task_4)%
on_cancel = %-drx_ql_meet_honcho_mar_base_stalker_tech -drx_ql_novikov_x16_sl_task_link =drx_ql_fail_task(drx_ql_csky_sl_task_4) =drx_ql_reset_task(drx_ql_csky_sl_task_4)%

; -----------------------------------------------
; Clear Sky Novikov Infiltrate Lab X-16 Storyline Task (LINKS FROM: Clear Sky Meet With Novikov )-

[drx_ql_csky_sl_task_5]

icon = ui_iconsTotal_yan_kill_brain_task
storyline = true
prior = 165
weight = 3
repeat_timeout = 259200
link_back_info = drx_ql_novikov_x16_sl_task_link
precondition = {=drx_ql_random_chance(100) =drx_ql_is_npc(mar_base_stalker_tech) =drx_ql_actor_faction() -drx_ql_info_main_task_labx16_done} true, false

important = true

title = drx_ql_csky_sl_task_5_name
descr = drx_ql_csky_sl_task_5_text
descr_functor = drx_ql_ug_fetch_task_target
job_descr = drx_ql_csky_sl_task_5_about
task_complete_descr = drx_ql_csky_sl_task_5_finish

stage_complete = 2
target_functor = drx_ql_ug_fetch_task_target
target_functor_params = yan_space_restrictor_to_x16
status_functor = drx_ql_miracle_machine_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_5)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_5)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_5:yan_smart_terrain_5_5)%
on_init = %-drx_ql_meet_honcho_mar_base_stalker_tech =drx_ql_reward_psi_helmet() =drx_ql_activate_teleport(yan_space_restrictor_to_x16)%
on_complete = %=drx_ql_reward_random(6500:9500) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_csky_sl_task_5) +drx_ql_info_main_task_labx16_done =drx_ql_reset_task(drx_ql_csky_sl_task_5)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_5) =drx_ql_reset_task(drx_ql_csky_sl_task_5)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_5) =drx_ql_reset_task(drx_ql_csky_sl_task_5)%

; -----------------------------------------------
; Clear Sky Infiltrate Lab X-18 (Dark Valley) Storyline Task-

[drx_ql_csky_sl_task_6]

icon = ui_inGame2_Laboratoriya_X8
storyline = true
prior = 165
weight = 3
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() +drx_ql_info_main_task_agr_u_done -drx_ql_info_main_task_labx18_done} true, false

important = true

title = drx_ql_csky_sl_task_6_name
descr = drx_ql_csky_sl_task_6_text
descr_functor = drx_ql_ug_fetch_task_target
job_descr = drx_ql_csky_sl_task_6_about
task_complete_descr = drx_ql_csky_sl_task_6_finish

stage_complete = 2
target_functor = drx_ql_ug_fetch_task_target
target_functor_params = val_space_restrictor_to_labx18
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_6)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_6)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_6:val_smart_terrain_9_6:main_story_2_lab_x18_documents)%
on_init = %=drx_ql_setup_story_item_task(drx_ql_csky_sl_task_6:main_story_2_lab_x18_documents) =drx_ql_create_squad(drx_ql_designated_target_squad_army_valley_x18:val_smart_terrain_1_2) =drx_ql_activate_teleport(val_space_restrictor_to_labx18)%
on_complete = %=drx_ql_reward_random(6500:9000) =complete_task_inc_goodwill(50:csky) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_army_valley_x18) =drx_ql_release_story_item(main_story_2_lab_x18_documents) =inc_task_stage(drx_ql_csky_sl_task_6) +drx_ql_info_main_task_labx18_done =drx_ql_reset_task(drx_ql_csky_sl_task_6)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_army_valley_x18) =drx_ql_release_story_item(main_story_2_lab_x18_documents) =drx_ql_fail_task(drx_ql_csky_sl_task_6) =drx_ql_reset_task(drx_ql_csky_sl_task_6)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_army_valley_x18) =drx_ql_release_story_item(main_story_2_lab_x18_documents) =drx_ql_fail_task(drx_ql_csky_sl_task_6) =drx_ql_reset_task(drx_ql_csky_sl_task_6)%

;------------------------------------------------
; Clear Sky Protect Clear Sky Base Storyline Task-

[drx_ql_csky_sl_task_7]

icon = ui_inGame2_Issledovanie_anomaliy
storyline = true
prior = 185
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() =drx_ql_is_npc(mar_smart_terrain_base_stalker_leader_marsh) =drx_ql_find_occupied_smart_local(csky:drx_ql_csky_sl_task_7)} true, false

title = drx_ql_csky_sl_task_7_name
descr = drx_ql_csky_sl_task_7_text
descr_functor = drx_ql_assault_task_target
job_descr = drx_ql_csky_sl_task_7_about
task_complete_descr = drx_ql_csky_sl_task_7_finish

stage_complete = 1
target_functor = drx_ql_assault_task_target
status_functor = drx_ql_assault_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_7)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_7)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_7)%
on_init = %=drx_ql_give_assault_target(drx_ql_csky_sl_task_7)%
on_complete = %=drx_ql_reward_random(3000:6500) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_csky_sl_task_7) =drx_ql_reset_task(drx_ql_csky_sl_task_7)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_7) =drx_ql_reset_task(drx_ql_csky_sl_task_7)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_7) =drx_ql_reset_task(drx_ql_csky_sl_task_7)%

;------------------------------------------------
; Clear Sky Rescue Missing Operative Storyline Task-

[drx_ql_csky_sl_task_8]

icon = ui_inGame2_Zalozhnik
storyline = true
prior = 195
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_is_npc(mar_base_owl_stalker_trader) =drx_ql_actor_faction() -hostage_companion_task_1_started -hostage_companion_task_1_hostage_rescued =drx_ql_find_occupied_smart_ext(csky:drx_ql_csky_sl_task_8) !squad_exist(hostage_companion_task_1)} true, false

title = drx_ql_csky_sl_task_8_name
descr = drx_ql_csky_sl_task_8_text
descr_functor = drx_ql_hostage_task_target
job_descr = drx_ql_csky_sl_task_8_about
task_complete_descr = drx_ql_csky_sl_task_8_finish

stage_complete = 1
target_functor = drx_ql_hostage_task_target
status_functor = drx_ql_hostage_task_status
status_functor_params = hostage_companion_task_1
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_8)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_8)} fail
condlist_3 = {!squad_exist(hostage_companion_task_1)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_csky_sl_task_8)%
on_init = %=drx_ql_give_assault_target(drx_ql_csky_sl_task_8) =drx_ql_setup_hostage_task(hostage_companion_task_1_csky:nil:drx_ql_csky_sl_task_8_id) +hostage_companion_task_1_started%
on_complete = %=drx_ql_reward_item(1500:3000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =drx_ql_remove_story_squad(hostage_companion_task_1) -hostage_companion_task_1_hostage_rescued -hostage_companion_task_1_started =inc_task_stage(drx_ql_csky_sl_task_8) =unlock_smart(drx_ql_csky_sl_task_8_id) =drx_ql_reset_task(drx_ql_csky_sl_task_8)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_story_squad(hostage_companion_task_1) -hostage_companion_task_1_hostage_rescued -hostage_companion_task_1_started =unlock_smart(drx_ql_csky_sl_task_8_id) =drx_ql_fail_task(drx_ql_csky_sl_task_8) =drx_ql_reset_task(drx_ql_csky_sl_task_8)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_story_squad(hostage_companion_task_1) -hostage_companion_task_1_hostage_rescued -hostage_companion_task_1_started =unlock_smart(drx_ql_csky_sl_task_8_id) =drx_ql_fail_task(drx_ql_csky_sl_task_8) =drx_ql_reset_task(drx_ql_csky_sl_task_8)%

;------------------------------------------------
; Clear Sky Dynamic Brawl Storyline Task-

[drx_ql_csky_sl_task_9]

icon = ui_inGame2_Issledovanie_anomaliy
storyline = true
prior = 194
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_actor_faction() =drx_ql_is_npc(mar_base_owl_stalker_trader) =drx_ql_find_brawl_terrain(csky:drx_ql_csky_sl_task_9)} true, false

title = drx_ql_csky_sl_task_9_name
descr = drx_ql_csky_sl_task_9_text
descr_1 = drx_ql_csky_sl_task_9_text_1
descr_functor = drx_ql_brawl_task_target
job_descr = drx_ql_csky_sl_task_9_about
message = drx_ql_csky_sl_task_9_message
goodbye = drx_ql_csky_sl_task_9_goodbye
task_complete_descr = drx_ql_csky_sl_task_9_finish

stage_complete = 3
target_functor = drx_ql_brawl_task_target
status_functor = drx_ql_brawl_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_9)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_9)} fail

on_job_descr = %=moon_cotz_show_brawl_task_info(drx_ql_csky_sl_task_9)%
on_init = %=drx_ql_setup_brawl_task(drx_ql_csky_sl_task_9:4:2)%
on_complete = %=drx_ql_reward_random(6500:9500) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_csky_sl_task_9) =drx_ql_end_brawl_task(drx_ql_csky_sl_task_9) =drx_ql_reset_task(drx_ql_csky_sl_task_9)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_end_brawl_task(drx_ql_csky_sl_task_9) =drx_ql_fail_task(drx_ql_csky_sl_task_9) =drx_ql_reset_task(drx_ql_csky_sl_task_9)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_end_brawl_task(drx_ql_csky_sl_task_9) =drx_ql_fail_task(drx_ql_csky_sl_task_9) =drx_ql_reset_task(drx_ql_csky_sl_task_9)%

; -----------------------------------------------
; Clear Sky Sniper Storyline Task-

[drx_ql_csky_sl_task_10]

icon = ui_inGame2_Odin_vistrel
storyline = true
prior = 145
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(100) =drx_ql_is_npc(mar_smart_terrain_base_stalker_leader_marsh) =drx_ql_actor_faction() =drx_ql_find_assassination_target(csky:drx_ql_csky_sl_task_10)} true, false
sniper_task = true

title = drx_ql_csky_sl_task_10_name
descr = drx_ql_csky_sl_task_10_text
descr_functor = drx_ql_assassination_task_target
job_descr = drx_ql_csky_sl_task_10_about
task_complete_descr = drx_ql_csky_sl_task_10_finish

stage_complete = 1
target_functor = drx_ql_assassination_task_target
status_functor = drx_ql_assassination_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_csky_sl_task_10)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_csky_sl_task_10)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_csky_sl_task_10:false)%
on_init = %=drx_ql_give_assassination_target(drx_ql_csky_sl_task_10)%

on_complete = %=drx_ql_reward_random(2500:4500) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_csky_sl_task_10) =drx_ql_reset_task(drx_ql_csky_sl_task_10)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_10) =drx_ql_reset_task(drx_ql_csky_sl_task_10)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_csky_sl_task_10) =drx_ql_reset_task(drx_ql_csky_sl_task_10)%

; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


;//////////////////////////////////////////////////////////////////////////////////////////////////
;
; Clear Sky Simulation Tasks
;
;	Created by DoctorX
;	for DoctorX Questlines 2.0
;	September 10, 2019
;
;--------------------------------------------------------------------------------------------------

;------------------------------------------------
; Eliminate Dangerous Mutants for Clear Sky Simulation Task -

[drx_ql_simulation_task_csky_1]

icon = ui_inGame2_Nochnaya_ohota
storyline = false
prior = 55
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_find_occupied_smart_local(stalker:drx_ql_simulation_task_csky_1:monster)} true, false

title = drx_ql_simulation_task_csky_1_name
descr = drx_ql_simulation_task_csky_1_text
descr_functor = drx_ql_assault_task_target
job_descr = drx_ql_simulation_task_csky_1_about
task_complete_descr = drx_ql_simulation_task_csky_1_finish

stage_complete = 1
target_functor = drx_ql_assault_task_target
status_functor = drx_ql_assault_task_status
status_functor_params = monster
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_1)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_1)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_simulation_task_csky_1)%
on_init = %=drx_ql_give_assault_target(drx_ql_simulation_task_csky_1)%
on_complete = %=drx_ql_reward_random(1500:3000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_1) =drx_ql_reset_task(drx_ql_simulation_task_csky_1)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_1) =drx_ql_reset_task(drx_ql_simulation_task_csky_1)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_1) =drx_ql_reset_task(drx_ql_simulation_task_csky_1)%

;------------------------------------------------
; Mutant Meat Stew for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_2]

icon = ui_inGame2_Pripasi
storyline = false
prior = 30
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction()} true, false

title = drx_ql_simulation_task_csky_2_name
title_functor = drx_ql_fetch_task_target
descr = drx_ql_simulation_task_csky_2_text
descr_functor = drx_ql_fetch_task_target
job_descr = drx_ql_simulation_task_csky_2_about
fetch_descr = drx_ql_simulation_task_csky_2_fetch_about
task_complete_descr = drx_ql_simulation_task_csky_2_fetch_finish

stage_complete = 2
target_functor = drx_ql_fetch_task_target
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_2)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_2)} fail

on_job_descr = %=moon_cotz_show_fetch_task_info(drx_ql_simulation_task_csky_2)%
fetch_func = %=drx_ql_setup_fetch_task(drx_ql_simulation_task_csky_2:120:300:1:6:0:items_mutant_meat_list)%
on_complete = %=drx_ql_fetch_reward_random(drx_ql_simulation_task_csky_2:7) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_2) =drx_ql_reset_task(drx_ql_simulation_task_csky_2)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_2) =drx_ql_reset_task(drx_ql_simulation_task_csky_2)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_2) =drx_ql_reset_task(drx_ql_simulation_task_csky_2)%

;------------------------------------------------
; Retrieve Notebook for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_3]

icon = ui_inGame2_PD_Torgovets_informatsiey
storyline = false
prior = 39
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_quest_item_notebook_task_started} true, false

title = drx_ql_simulation_task_csky_3_name
descr = drx_ql_simulation_task_csky_3_text
descr_functor = drx_ql_quest_stash_task_target
job_descr = drx_ql_simulation_task_csky_3_about
task_complete_descr = drx_ql_simulation_task_csky_3_finish

stage_complete = 1
target_functor = drx_ql_quest_stash_task_target
target_functor_params = drx_ql_quest_item_notebook
status_functor = drx_ql_quest_stash_task_status
status_functor_params = drx_ql_quest_item_notebook
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_3)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_3)} fail


on_job_descr = %=drx_ql_create_quest_stash(drx_ql_quest_item_notebook:drx_ql_simulation_task_csky_3)%
on_init = %=moon_cotz_reenable_quest_stash() +drx_ql_quest_item_notebook_task_started%
on_complete = %=drx_ql_reward_random(1500:3000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =remove_item(drx_ql_quest_item_notebook) =inc_task_stage(drx_ql_simulation_task_csky_3) -drx_ql_quest_item_notebook_task_started =pstor_reset(drx_ql_quest_item_notebook_stash_id) =drx_ql_reset_task(drx_ql_simulation_task_csky_3)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_quest_stash(drx_ql_quest_item_notebook) -drx_ql_quest_item_notebook_task_started =pstor_reset(drx_ql_quest_item_notebook_stash_id) =drx_ql_fail_task(drx_ql_simulation_task_csky_3) =drx_ql_reset_task(drx_ql_simulation_task_csky_3)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_remove_quest_stash(drx_ql_quest_item_notebook) -drx_ql_quest_item_notebook_task_started =pstor_reset(drx_ql_quest_item_notebook_stash_id) =drx_ql_fail_task(drx_ql_simulation_task_csky_3) =drx_ql_reset_task(drx_ql_simulation_task_csky_3)%

;------------------------------------------------
; HAVFetch Reward Assault for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_4]

icon = ui_inGame2_Propavshaya_razvedgruppa
storyline = false
prior = 65
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_havfetch_reward_task_started =drx_ql_has_havfetch_task(drx_ql_simulation_task_csky_4) =drx_ql_find_occupied_smart_ext(csky:drx_ql_simulation_task_csky_4)} true, false

title = drx_ql_simulation_task_csky_4_name
descr = drx_ql_simulation_task_csky_4_text
descr_functor = drx_ql_assault_task_target
job_descr = drx_ql_simulation_task_csky_4_about
task_complete_descr = drx_ql_simulation_task_csky_4_finish

stage_complete = 1
target_functor = drx_ql_assault_task_target
status_functor = drx_ql_assault_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_4)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_4)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_simulation_task_csky_4:false)%
on_init = %=drx_ql_give_assault_target(drx_ql_simulation_task_csky_4) +drx_ql_havfetch_reward_task_started%

on_complete = %=drx_ql_give_stored_reward(drx_ql_simulation_task_csky_4) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_4) -drx_ql_havfetch_reward_task_started =drx_ql_reset_task(drx_ql_simulation_task_csky_4)%
on_fail = %=fail_task_dec_goodwill(50:csky) -drx_ql_havfetch_reward_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_4) =drx_ql_reset_task(drx_ql_simulation_task_csky_4)%
on_cancel = %=fail_task_dec_goodwill(50:stalker) -drx_ql_havfetch_reward_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_4) =drx_ql_reset_task(drx_ql_simulation_task_csky_4)%

; -----------------------------------------------
; Find Lost PDA for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_5]

icon = ui_inGame2_PD_Torgovets_informatsiey
storyline = false
prior = 39
repeat_timeout = 259200
weight = 1
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_quest_item_pda_task_started =drx_ql_find_unoccupied_smart_terrain(drx_ql_simulation_task_csky_5)} true, false

title = drx_ql_simulation_task_csky_5_name
descr = drx_ql_simulation_task_csky_5_text
descr_functor = drx_ql_float_item_task_target
job_descr = drx_ql_simulation_task_csky_5_about
task_complete_descr = drx_ql_simulation_task_csky_5_finish

stage_complete = 1
target_functor = drx_ql_float_item_task_target
status_functor = drx_ql_float_item_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_5)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_5)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_simulation_task_csky_5:nil:drx_ql_quest_item_pda)%
on_init = %=drx_ql_setup_float_task(drx_ql_simulation_task_csky_5:drx_ql_quest_item_pda:50) +drx_ql_quest_item_pda_task_started%
on_complete = %=drx_ql_reward_random(2500:4000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =remove_item(drx_ql_quest_item_pda) =inc_task_stage(drx_ql_simulation_task_csky_5) -drx_ql_quest_item_pda_task_started =drx_ql_reset_task(drx_ql_simulation_task_csky_5)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_release_float_item(drx_ql_simulation_task_csky_5) -drx_ql_quest_item_pda_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_5) =drx_ql_reset_task(drx_ql_simulation_task_csky_5)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_release_float_item(drx_ql_simulation_task_csky_5) -drx_ql_quest_item_pda_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_5) =drx_ql_reset_task(drx_ql_simulation_task_csky_5)%

;------------------------------------------------
; Item Swap with Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_6]

icon = ui_inGame2_D_Vipolnil_4_zadaniya_dlya_Swobodi
storyline = false
prior = 28
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction()} true, false

title = drx_ql_simulation_task_csky_6_name
title_functor = drx_ql_fetch_task_target
descr = drx_ql_simulation_task_csky_6_text
descr_functor = drx_ql_fetch_task_target
job_descr = drx_ql_simulation_task_csky_6_about
fetch_descr = drx_ql_simulation_task_csky_6_fetch_about
task_complete_descr = drx_ql_simulation_task_csky_6_fetch_finish

stage_complete = 2
target_functor = drx_ql_fetch_task_target
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_6)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_6)} fail
fetch_func = %=drx_ql_setup_swap_task(drx_ql_simulation_task_csky_6:3000:15000:0.8)%

on_job_descr = %=moon_cotz_show_fetch_task_info(drx_ql_simulation_task_csky_6)%
on_init = %=drx_ql_add_havfetch_task(drx_ql_simulation_task_csky_6)%
on_complete = %=drx_ql_give_stored_reward(drx_ql_simulation_task_csky_6) =remove_fetch_item(drx_ql_simulation_task_csky_6_fetch) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_6) =drx_ql_reset_task(drx_ql_simulation_task_csky_6)%
on_fail = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_6) =drx_ql_reset_task(drx_ql_simulation_task_csky_6)%
on_cancel = %=fail_task_dec_goodwill(50:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_6) =drx_ql_reset_task(drx_ql_simulation_task_csky_6)%



; ¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯
; ¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯
; ¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯¯`·.¸¸.·´¯`·.¸¸.·´¯



; //||\\||//||\\||//||\\||//||\\||//||\\
;
; Rhons' Quest Expansion
;
; //||\\||//||\\||//||\\||//||\\||//||\\

;------------------------------------------------
; Clear Sky Counterattack Task-

[drx_ql_simulation_task_csky_7]

icon = ui_inGame2_Issledovanie_anomaliy
storyline = false
prior = 38
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_find_occupied_smart_local(csky:drx_ql_simulation_task_csky_7)} true, false

title = drx_ql_simulation_task_csky_7_name
descr = drx_ql_simulation_task_csky_7_text
descr_functor = drx_ql_assault_task_target
job_descr = drx_ql_simulation_task_csky_7_about
task_complete_descr = drx_ql_simulation_task_csky_7_finish

stage_complete = 1
target_functor = drx_ql_assault_task_target
status_functor = drx_ql_assault_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_7)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_7)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_simulation_task_csky_7)%

on_init = %=drx_ql_give_assault_target(drx_ql_simulation_task_csky_7) =drx_ql_add_task_giver_companion(drx_ql_simulation_task_csky_7)%

on_complete = %=drx_ql_reward_random(8000:11500) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_7) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_7) =drx_ql_reset_task(drx_ql_simulation_task_csky_7)%

on_fail = %=fail_task_dec_goodwill(25:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_7) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_7) =drx_ql_reset_task(drx_ql_simulation_task_csky_7)%

on_cancel = %=fail_task_dec_goodwill(25:csky) =drx_ql_fail_task(drx_ql_simulation_task_csky_7) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_7) =drx_ql_reset_task(drx_ql_simulation_task_csky_7)%

;------------------------------------------------
; Clear Sky Manhunt Simulation Task-

[drx_ql_simulation_task_csky_8]

icon = ui_inGame2_Odin_vistrel
storyline = false
prior = 45
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_find_assassination_target(csky:drx_ql_simulation_task_csky_8)} true, false

title = drx_ql_simulation_task_csky_8_name
descr = drx_ql_simulation_task_csky_8_text
descr_functor = drx_ql_assassination_task_target
job_descr = drx_ql_simulation_task_csky_8_about
task_complete_descr = drx_ql_simulation_task_csky_8_finish

stage_complete = 1
target_functor = drx_ql_assassination_task_target
status_functor = drx_ql_assassination_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_8)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_8)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_simulation_task_csky_8:false)%
on_init = %=drx_ql_give_assassination_target(drx_ql_simulation_task_csky_8)%

on_complete = %=drx_ql_reward_money(10000:17000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_8) =drx_ql_reset_task(drx_ql_simulation_task_csky_8)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_8) =drx_ql_reset_task(drx_ql_simulation_task_csky_8)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_8) =drx_ql_reset_task(drx_ql_simulation_task_csky_8)%

;------------------------------------------------
; Clear Sky Guide Simulation Task-

[drx_ql_simulation_task_csky_9]

icon = ui_inGame2_Karti_mestnosti
storyline = false
prior = 50
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_guide_task_started =drx_ql_find_guide_target(drx_ql_simulation_task_csky_9)} true, false
guide_task = true

title = drx_ql_simulation_task_csky_9_name
descr = drx_ql_simulation_task_csky_9_text
descr_functor = drx_ql_guide_task_target
job_descr = drx_ql_simulation_task_csky_9_about
message = drx_ql_simulation_task_csky_9_message
task_complete_descr = drx_ql_simulation_task_csky_9_finish

stage_complete = 1
target_functor = drx_ql_guide_task_target
status_functor = drx_ql_guide_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_9)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_9)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_simulation_task_csky_9)%

on_init = %=drx_ql_give_stored_smart_target(drx_ql_simulation_task_csky_9) =drx_ql_add_task_giver_companion(drx_ql_simulation_task_csky_9) +drx_ql_guide_task_started%

on_complete = %=drx_ql_give_stored_reward(drx_ql_simulation_task_csky_9) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_9) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_9) -drx_ql_guide_task_started =drx_ql_reset_task(drx_ql_simulation_task_csky_9)%

on_fail = %=drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_9) -drx_ql_guide_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_9) =drx_ql_reset_task(drx_ql_simulation_task_csky_9)%

on_cancel = %=drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_9) -drx_ql_guide_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_9) =drx_ql_reset_task(drx_ql_simulation_task_csky_9)%

;------------------------------------------------
; New Gun for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_10]

icon = ui_inGame2_Neizvestnoe_oruzhie
storyline = false
prior = 28
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction()} true, false

title = drx_ql_simulation_task_csky_10_name
title_functor = drx_ql_fetch_task_target
descr = drx_ql_simulation_task_csky_10_text
descr_functor = drx_ql_fetch_task_target
job_descr = drx_ql_simulation_task_csky_10_about
fetch_descr = drx_ql_simulation_task_csky_10_fetch_about
task_complete_descr = drx_ql_simulation_task_csky_10_fetch_finish

stage_complete = 2
status_functor = drx_ql_fetch_task_status
target_functor = drx_ql_fetch_task_target
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_10)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_10)} fail
fetch_func = %=drx_ql_setup_fetch_task(drx_ql_simulation_task_csky_10:1000:4500:1:1:0.5:items_rifles_list)%

on_job_descr = %=moon_cotz_show_fetch_task_info(drx_ql_simulation_task_csky_10)%

on_init = %=drx_ql_add_havfetch_task(drx_ql_simulation_task_csky_10)%

on_complete = %=drx_ql_fetch_reward_money(drx_ql_simulation_task_csky_10:1.5) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_10) =drx_ql_reset_task(drx_ql_simulation_task_csky_10)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_10) =drx_ql_reset_task(drx_ql_simulation_task_csky_10)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_10) =drx_ql_reset_task(drx_ql_simulation_task_csky_10)%

;------------------------------------------------
; Clear Sky Dynamic Brawl Task

[drx_ql_simulation_task_csky_11]

icon = ui_inGame2_Issledovanie_anomaliy
storyline = false
prior = 94
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(50) =drx_ql_actor_faction() =drx_ql_find_brawl_terrain(csky:drx_ql_simulation_task_csky_11)} true, false

title = drx_ql_simulation_task_csky_11_name
descr = drx_ql_simulation_task_csky_11_text
descr_1 = drx_ql_simulation_task_csky_11_text_1
descr_functor = drx_ql_brawl_task_target
job_descr = drx_ql_simulation_task_csky_11_about
message = drx_ql_simulation_task_csky_11_message
goodbye = drx_ql_simulation_task_csky_11_goodbye
task_complete_descr = drx_ql_simulation_task_csky_11_finish

stage_complete = 3
target_functor = drx_ql_brawl_task_target
status_functor = drx_ql_brawl_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_11)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_11)} fail

on_job_descr = %=moon_cotz_show_brawl_task_info(drx_ql_simulation_task_csky_11)%

on_init = %=drx_ql_setup_brawl_task(drx_ql_simulation_task_csky_11:4:2) =drx_ql_add_task_giver_companion(drx_ql_simulation_task_csky_11)%

on_complete = %=drx_ql_reward_random(15000:19000) =drx_ql_reward_stash() =complete_task_inc_goodwill(75:csky) =inc_task_stage(drx_ql_simulation_task_csky_11) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_11) =drx_ql_end_brawl_task(drx_ql_simulation_task_csky_11) =drx_ql_reset_task(drx_ql_simulation_task_csky_11)%

on_fail = %=fail_task_dec_goodwill(25:csky) =drx_ql_end_brawl_task(drx_ql_simulation_task_csky_11) =drx_ql_fail_task(drx_ql_simulation_task_csky_11) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_11) =drx_ql_reset_task(drx_ql_simulation_task_csky_11)%

on_cancel = %=fail_task_dec_goodwill(25:csky) =drx_ql_end_brawl_task(drx_ql_simulation_task_csky_11) =drx_ql_fail_task(drx_ql_simulation_task_csky_11) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_11) =drx_ql_reset_task(drx_ql_simulation_task_csky_11)%

;------------------------------------------------
; Clear Sky Kill and Recover Task-

[drx_ql_simulation_task_csky_12]

icon = ui_inGame2_Osobiy_zakaz
storyline = false
prior = 80
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_quest_item_document_case_task_started =drx_ql_is_enemy(bandit) =is_factions_enemies(csky:bandit) !squad_exist(drx_ql_designated_target_squad_bandit) =drx_ql_find_unoccupied_smart_terrain(drx_ql_simulation_task_csky_12)} true, false

title = drx_ql_simulation_task_csky_12_name
descr = drx_ql_simulation_task_csky_12_text
descr_functor = drx_ql_interceptor_task_target
job_descr = drx_ql_simulation_task_csky_12_about
task_complete_descr = drx_ql_simulation_task_csky_12_finish

stage_complete = 1
target_functor = drx_ql_interceptor_task_target
status_functor = drx_ql_interceptor_task_status
status_functor_params = drx_ql_quest_item_document_case
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_12)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_12)} fail

on_job_descr = %=moon_cotz_show_stored_smart_target_location(drx_ql_simulation_task_csky_12:nil:drx_ql_quest_item_document_case)%

on_init = %=drx_ql_give_stored_smart_target(drx_ql_simulation_task_csky_12) =drx_ql_create_interceptor_squad(drx_ql_simulation_task_csky_12:drx_ql_designated_target_squad_bandit) +drx_ql_quest_item_document_case_task_started%

on_complete = %=drx_ql_reward_money(10000:14500) =drx_ql_reward_stash() =complete_task_inc_goodwill(75:csky) =remove_item(drx_ql_quest_item_document_case) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_bandit) =inc_task_stage(drx_ql_simulation_task_csky_12) -drx_ql_quest_item_document_case_task_started =drx_ql_reset_task(drx_ql_simulation_task_csky_12)%

on_fail = %=fail_task_dec_goodwill(25:csky) =remove_item(drx_ql_quest_item_document_case) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_bandit) -drx_ql_quest_item_document_case_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_12) =drx_ql_reset_task(drx_ql_simulation_task_csky_12)%

on_cancel = %=fail_task_dec_goodwill(25:csky) =remove_item(drx_ql_quest_item_document_case) =drx_ql_remove_story_squad(drx_ql_designated_target_squad_bandit) -drx_ql_quest_item_document_case_task_started =drx_ql_fail_task(drx_ql_simulation_task_csky_12) =drx_ql_reset_task(drx_ql_simulation_task_csky_12)%

;------------------------------------------------
; Collect Mutant Tissue Sample for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_13]

icon = ui_inGame2_Logovo_krovososov
storyline = false
prior = 35
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction()} true, false

title = drx_ql_simulation_task_csky_13_name
title_functor = drx_ql_fetch_task_target
descr = drx_ql_simulation_task_csky_13_text
descr_functor = drx_ql_fetch_task_target
job_descr = drx_ql_simulation_task_csky_13_about
fetch_descr = drx_ql_simulation_task_csky_13_fetch_about
task_complete_descr = drx_ql_simulation_task_csky_13_fetch_finish

stage_complete = 2
target_functor = drx_ql_fetch_task_target
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_13)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_13)} fail
fetch_func = %=drx_ql_setup_fetch_task(drx_ql_simulation_task_csky_13:500:1250:1:1:0:items_mutant_parts_list)%

on_job_descr = %=moon_cotz_show_fetch_task_info(drx_ql_simulation_task_csky_13)%

on_complete = %=drx_ql_fetch_reward_money(drx_ql_simulation_task_csky_13:1.2) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_13) =drx_ql_reset_task(drx_ql_simulation_task_csky_13)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_13) =drx_ql_reset_task(drx_ql_simulation_task_csky_13)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_13) =drx_ql_reset_task(drx_ql_simulation_task_csky_13)%

;------------------------------------------------
; Find Supplies for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_14]

icon = ui_inGame2_D_Sisshik
storyline = false
prior = 20
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction()} true, false

title = drx_ql_simulation_task_csky_14_name
title_functor = drx_ql_fetch_task_target
descr = drx_ql_simulation_task_csky_14_text
descr_functor = drx_ql_fetch_task_target
job_descr = drx_ql_simulation_task_csky_14_about
fetch_descr = drx_ql_simulation_task_csky_14_fetch_about
task_complete_descr = drx_ql_simulation_task_csky_14_fetch_finish

stage_complete = 2
target_functor = drx_ql_fetch_task_target
status_functor = drx_ql_fetch_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_14)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_14)} fail
fetch_func = %=drx_ql_setup_fetch_task(drx_ql_simulation_task_csky_14:800:1600:2:12:0:items_ammo_list:items_supplies_list)%

on_job_descr = %=moon_cotz_show_fetch_task_info(drx_ql_simulation_task_csky_14)%

on_complete = %=drx_ql_fetch_reward_money(drx_ql_simulation_task_csky_14:1.5) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_14) =drx_ql_reset_task(drx_ql_simulation_task_csky_14)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_14) =drx_ql_reset_task(drx_ql_simulation_task_csky_14)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_14) =drx_ql_reset_task(drx_ql_simulation_task_csky_14)%

;------------------------------------------------
; Clear Sky Hidden Target Simulation Task-

[drx_ql_simulation_task_csky_15]

icon = ui_inGame2_Odin_vistrel
storyline = false
prior = 20
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_find_assassination_target(csky:drx_ql_simulation_task_csky_15:csky)} true, false

title = drx_ql_simulation_task_csky_15_name
descr = drx_ql_simulation_task_csky_15_text
descr_functor = drx_ql_assassination_task_target
job_descr = drx_ql_simulation_task_csky_15_about
task_complete_descr = drx_ql_simulation_task_csky_15_finish

stage_complete = 1
target_functor = drx_ql_assassination_task_target
status_functor = drx_ql_assassination_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_15)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_15)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_simulation_task_csky_15:true)%
on_init = %=drx_ql_give_assassination_target(drx_ql_simulation_task_csky_15) =drx_ql_add_hidden_target(drx_ql_simulation_task_csky_15)%

on_complete = %=drx_ql_reward_random(8500:14000) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_15) =drx_ql_reset_task(drx_ql_simulation_task_csky_15)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_15) =drx_ql_reset_task(drx_ql_simulation_task_csky_15)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_15) =drx_ql_reset_task(drx_ql_simulation_task_csky_15)%

;------------------------------------------------
; Zombied Bounty for Clear Sky Simulation Task-

[drx_ql_simulation_task_csky_16]

icon = ui_inGame2_Odin_vistrel
storyline = false
prior = 45
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_find_assassination_target(csky:drx_ql_simulation_task_csky_16:zombied)} true, false

title = drx_ql_simulation_task_csky_16_name
descr = drx_ql_simulation_task_csky_16_text
descr_functor = drx_ql_assassination_task_target
job_descr = drx_ql_simulation_task_csky_16_about
task_complete_descr = drx_ql_simulation_task_csky_16_finish

stage_complete = 1
target_functor = drx_ql_assassination_task_target
status_functor = drx_ql_assassination_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_16)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_16)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_simulation_task_csky_16:false)%
on_init = %=drx_ql_give_assassination_target(drx_ql_simulation_task_csky_16)%

on_complete = %=drx_ql_reward_random(2500:3500) =drx_ql_reward_stash() =complete_task_inc_goodwill(25:csky) =inc_task_stage(drx_ql_simulation_task_csky_16) =drx_ql_reset_task(drx_ql_simulation_task_csky_16)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_16) =drx_ql_reset_task(drx_ql_simulation_task_csky_16)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_16) =drx_ql_reset_task(drx_ql_simulation_task_csky_16)%

;------------------------------------------------
; Clear Sky Stash Transfer Simulation Task-

[drx_ql_simulation_task_csky_17]

icon = ui_inGame2_PD_Torgovets_informatsiey
storyline = false
prior = 29
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() -drx_ql_quest_item_pda_task_started} true, false

title = drx_ql_simulation_task_csky_17_name
descr = drx_ql_simulation_task_csky_17_text
descr_functor = drx_ql_quest_stash_task_target
job_descr = drx_ql_simulation_task_csky_17_about
task_complete_descr = drx_ql_simulation_task_csky_17_finish

stage_complete = 1
target_functor = drx_ql_quest_stash_task_target
target_functor_params = drx_ql_quest_item_pda
status_functor = drx_ql_quest_stash_task_status
status_functor_params = drx_ql_quest_item_pda
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_17)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_17)} fail

on_job_descr = %=drx_ql_create_quest_stash(drx_ql_quest_item_pda:drx_ql_simulation_task_csky_17)%

on_init = %=moon_cotz_reenable_quest_stash() +drx_ql_quest_item_pda_task_started =give_actor(drx_ql_quest_item_stash_case) =drx_ql_add_task_giver_companion(drx_ql_simulation_task_csky_17)%

on_complete = %=drx_ql_reward_random(9500:14000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_17) =remove_item(drx_ql_quest_item_pda) =remove_item(drx_ql_quest_item_stash_case) =inc_task_stage(drx_ql_simulation_task_csky_17) -drx_ql_quest_item_pda_task_started =pstor_reset(drx_ql_quest_item_pda_stash_id) =drx_ql_reset_task(drx_ql_simulation_task_csky_17)%

on_fail = %=drx_ql_remove_quest_stash(drx_ql_quest_item_pda) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_17) =remove_item(drx_ql_quest_item_stash_case) -drx_ql_quest_item_pda_task_started =pstor_reset(drx_ql_quest_item_pda_stash_id) =drx_ql_fail_task(drx_ql_simulation_task_csky_17) =drx_ql_reset_task(drx_ql_simulation_task_csky_17)%

on_cancel = %=drx_ql_remove_quest_stash(drx_ql_quest_item_pda) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_17) =remove_item(drx_ql_quest_item_stash_case) -drx_ql_quest_item_pda_task_started =pstor_reset(drx_ql_quest_item_pda_stash_id) =drx_ql_fail_task(drx_ql_simulation_task_csky_17) =drx_ql_reset_task(drx_ql_simulation_task_csky_17)%

;------------------------------------------------
; Capture for Clear Sky Task-

[drx_ql_simulation_task_csky_18]

icon = ui_inGame2_Odin_vistrel
storyline = false
prior = 47
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(75) =drx_ql_actor_faction() =drx_ql_is_enemy(dolg:freedom:army:bandit:killer) =is_factions_enemies(csky:dolg:freedom:army:bandit:killer) =drx_ql_find_assassination_target(csky:drx_ql_simulation_task_csky_18:dolg:freedom:army:bandit:killer)} true, false
prisoner_task = true

title = drx_ql_simulation_task_csky_18_name
descr = drx_ql_simulation_task_csky_18_text
descr_functor = drx_ql_prisoner_task_target
job_descr = drx_ql_simulation_task_csky_18_about
task_complete_descr = drx_ql_simulation_task_csky_18_finish

stage_complete = 2
target_functor = drx_ql_prisoner_task_target
status_functor = drx_ql_prisoner_task_status
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_18)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_18)} fail
on_job_descr = %=drx_ql_show_assassination_target(drx_ql_simulation_task_csky_18:false)%
on_init = %=drx_ql_give_prisoner_target(drx_ql_simulation_task_csky_18)%

on_complete = %=drx_ql_reward_random(9500:14000) =drx_ql_reward_stash() =complete_task_inc_goodwill(50:csky) =inc_task_stage(drx_ql_simulation_task_csky_18) =drx_ql_reset_prisoner_task(drx_ql_simulation_task_csky_18) =drx_ql_remove_prisoner(drx_ql_simulation_task_csky_18) =drx_ql_reset_task(drx_ql_simulation_task_csky_18)%

on_fail = %=drx_ql_fail_task(drx_ql_simulation_task_csky_18) =drx_ql_reset_prisoner_task(drx_ql_simulation_task_csky_18) =drx_ql_reset_task(drx_ql_simulation_task_csky_18)%

on_cancel = %=drx_ql_fail_task(drx_ql_simulation_task_csky_18) =drx_ql_reset_prisoner_task(drx_ql_simulation_task_csky_18) =drx_ql_reset_task(drx_ql_simulation_task_csky_18)%

;------------------------------------------------
; Clear Sky Dynamic Ambush Task-

[drx_ql_simulation_task_csky_19]

icon = ui_inGame2_Issledovanie_anomaliy
storyline = false
prior = 64
weight = 1
repeat_timeout = 259200
precondition = {=drx_ql_random_chance(50) =drx_ql_actor_faction() =drx_ql_is_enemy(dolg:freedom:army:bandit:killer:monolith) =drx_ql_find_brawl_terrain_ambush(csky:drx_ql_simulation_task_csky_19:dolg:freedom:army:bandit:killer:monolith)} true, false

title = drx_ql_simulation_task_csky_19_name
descr = drx_ql_simulation_task_csky_19_text
descr_1 = drx_ql_simulation_task_csky_19_text_1
descr_functor = drx_ql_brawl_task_target_ambush
job_descr = drx_ql_simulation_task_csky_19_about
message = drx_ql_simulation_task_csky_19_message
task_complete_descr = drx_ql_simulation_task_csky_19_finish

stage_complete = 2
target_functor = drx_ql_brawl_task_target_ambush
status_functor = drx_ql_brawl_task_status_ambush
condlist_0 = {!drx_ql_task_giver_alive(drx_ql_simulation_task_csky_19)} fail
condlist_1 = {=drx_ql_is_enemy(csky)} fail
condlist_2 = {=drx_ql_wg_fail(drx_ql_simulation_task_csky_19)} fail

on_job_descr = %=moon_cotz_show_brawl_task_info(drx_ql_simulation_task_csky_19)%

on_init = %=drx_ql_setup_brawl_task_ambush(drx_ql_simulation_task_csky_19:4:3) =drx_ql_add_task_giver_companion(drx_ql_simulation_task_csky_19) =reward_random_item(wpn_rpg7) =drx_ql_give_escort_task_companions(drx_ql_raid_companion_squad_csky_2)%

on_complete = %=drx_ql_reward_random(14500:24000) =drx_ql_reward_stash() =reward_random_item(drug_anabiotic) =reward_random_item(medkit_army) =reward_random_item(medkit_scientic) =reward_random_item(antirad) =reward_random_item(drug_booster) =reward_random_item(drug_booster) =complete_task_inc_goodwill(100:csky) =inc_task_stage(drx_ql_simulation_task_csky_19) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_19) =drx_ql_remove_story_squad(drx_ql_raid_companion_squad_csky_2) =drx_ql_end_brawl_task_ambush(drx_ql_simulation_task_csky_19) =drx_ql_reset_task(drx_ql_simulation_task_csky_19)%

on_fail = %=fail_task_dec_goodwill(25:csky) =drx_ql_end_brawl_task_ambush(drx_ql_simulation_task_csky_19) =drx_ql_fail_task(drx_ql_simulation_task_csky_19) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_19) =drx_ql_remove_story_squad(drx_ql_raid_companion_squad_csky_2) =drx_ql_reset_task(drx_ql_simulation_task_csky_19)%

on_cancel = %=fail_task_dec_goodwill(75:csky) =drx_ql_end_brawl_task_ambush(drx_ql_simulation_task_csky_19) =drx_ql_fail_task(drx_ql_simulation_task_csky_19) =drx_ql_remove_task_giver_companion(drx_ql_simulation_task_csky_19) =drx_ql_remove_story_squad(drx_ql_raid_companion_squad_csky_2) =drx_ql_reset_task(drx_ql_simulation_task_csky_19)%


; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
