;==============================================================
;
; TASKS PROVIDED FOR LOST TO THE ZONE: LIVING LEGEND
;	Anomaly 1.5 - Lost to the Zone: Living Legend
;
;	Made by: SarisKhan
;	Last revised: 13 August 2020
;
;==============================================================

;=================Living Legend Storyline Quests===========================
; Living Legend Task 1-
[lttz_ll_find_doctor]
icon = ui_iconsNpc_doctor
prior = 195
storyline = true

title = lttz_ll_find_doctor_task_title
target = mar_smart_terrain_doc_doctor
descr = lttz_ll_find_doctor_task_descr

on_init = %=remove_squad(monolith_eidolon) =create_squad(stalker_gatekeeper_squad:mil_smart_terrain_4_8)%
on_complete = %=complete_task_inc_goodwill(50:stalker) =give_task(lttz_ll_visit_agro_ug) +lttz_ll_visit_agro_ug_task%
condlist_0 = {+living_legend_doctor} complete
condlist_1 = {=actor_has_item(cit_doctors_pda)} complete

;------------------------------------------------
; Living Legend Task 2-
[lttz_ll_visit_agro_ug]
icon = ui_inGame2_Laboratoriya_X8
prior = 195
storyline = true

title = lttz_ll_visit_agro_ug_name
target = agr_space_restrictor_to_agr_ug_4
descr = {=actor_has_item(cit_doctors_pda)} lttz_ll_visit_agro_ug_text_2, {+living_legend_doctor} lttz_ll_visit_agro_ug_text 

on_init = %=spawn_strelok_notes() =open_route(agr:agr_u)%
on_complete = %+lttz_ll_visit_agro_ug_task_done%
condlist_0 = {=actor_has_item(strelok_notes)} complete

;------------------------------------------------
; Living Legend Task 3-
[lttz_ll_visit_barkeep]
icon = ui_icons_bar_100rentgen18
prior = 195
storyline = true

title = lttz_ll_visit_barkeep_task_title
target = bar_visitors_barman_stalker_trader
descr = lttz_ll_visit_barkeep_task_descr

on_complete = %=give_task(lttz_ll_call_north) =reward_item(drug_psy_blockade)%
condlist_0 = {+living_legend_barkeep} complete

; Living Legend Task 3a-
[lttz_ll_visit_blackjack]
icon = ui_icons_mercicon13
prior = 195
storyline = true

title = lttz_ll_visit_aslan_task_title
target = cit_killers_merc_barman_mlr
descr = lttz_ll_visit_aslan_task_descr

on_complete = %=give_task(lttz_ll_call_north) =reward_item(drug_psy_blockade)%
condlist_0 = {+living_legend_aslan} complete

;------------------------------------------------
; Living Legend Task 4-
[lttz_ll_call_north]
icon = ui_iconsTotal_rad_get_to_aes
prior = 195
storyline = true

title = lttz_ll_call_north_task_title
target = {=actor_has_item(good_psy_helmet)} stalker_gatekeeper, {=actor_has_item(bad_psy_helmet)} stalker_gatekeeper, yan_stalker_sakharov
status_functor = special_steps_for_lostzone_tasks
descr = {=actor_has_item(good_psy_helmet)} lttz_ll_call_north_task_descr2, {=actor_has_item(bad_psy_helmet)} lttz_ll_call_north_task_descr2, lttz_ll_call_north_task_descr

on_complete = %=give_task(lttz_ll_breakthrough)%
condlist_0 = {+living_legend_breakthrough} complete
condlist_1 = {+stalker_gatekeeper_dead} fail

;------------------------------------------------
; Living Legend Task 5-
[lttz_ll_breakthrough]
icon = ui_icons_base_attack24
prior = 195
storyline = true

title = lttz_ll_breakthrough_task_name
target = {+mil_smart_terrain_3_8_monolith_attackers_squad_death} stalker_gatekeeper, mil_smart_terrain_3_8_monolith_attackers_squad
descr = {+mil_smart_terrain_3_8_monolith_attackers_squad_death} lttz_ll_talk_gatekeeper_task_descr, lttz_ll_breakthrough_task_text

on_init = %=create_squad(mil_smart_terrain_3_8_monolith_attackers:mil_smart_terrain_3_8)% ;=create_squad(barrier_freedom_guardians_squad:mil_smart_terrain_3_8) 
on_complete = %=reward_stash(true) =reward_random_money(5000:6000) =reward_item(drug_radioprotector) =complete_task_inc_goodwill(50:stalker:freedom) =give_task(lttz_ll_turn_off_brain_scorcher)%
condlist_0 = {+living_legend_brainscorcher} complete
condlist_1 = {+stalker_gatekeeper_dead} fail

;------------------------------------------------
; Disable Brain Scorcher Living Legend Task 6-
[lttz_ll_turn_off_brain_scorcher]
icon = ui_iconsTotal_bar_radar_deactivate
prior = 195
storyline = true

title = lttz_ll_radar_deactivate_name
target = rad_space_restrictor_to_bunker
descr = lttz_ll_deactivate_text

on_init = %=open_route(mil:rad) =open_route(rad:x19)%
on_complete = %=complete_task_inc_goodwill(100:stalker) =give_task(lttz_ll_visit_beard) =create_squad(stalker_rogue_squad:zat_stalker_base_smart) +lttz_ll_turn_off_brain_scorcher_task_done =stalker_ceasefire()%
condlist_0 = {+bar_deactivate_radar_done} complete

;------------------------------------------------
; Living Legend Task 7-
[lttz_ll_visit_beard]
icon = ui_inGame2_Artefakti_na_zakaz
prior = 195
storyline = true

title = lttz_ll_visit_beard_task_title
target = zat_a2_stalker_barmen
descr = lttz_ll_visit_beard_task_descr

on_init = %=open_route(red:rad) =open_route(red:jup) =open_route(jup:zat)% 
on_complete = %=reward_money(6000) =reward_item(vodka_quality) =reward_stash(true) =complete_task_inc_goodwill(50:stalker) =give_task(lttz_ll_meet_rogue)%
condlist_0 = {+living_legend_beard} complete

;------------------------------------------------
; Meet Rogue Living Legend Task 8-
[lttz_ll_meet_rogue]
icon = ui_inGame2_Issledovatelskaya_gruppa
prior = 195
storyline = true

title = lttz_ll_meet_rogue_task_title
target = stalker_rogue
descr = lttz_ll_meet_rogue_task_descr

on_complete = %=give_task(lttz_ll_fetch_gauss)%
condlist_0 = {+living_legend_rogue_start} complete
condlist_1 = {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 9-
[lttz_ll_fetch_gauss]
icon = ui_inGame2_Izdelie_N62
storyline = true
prior = 195

title = lttz_ll_fetch_gauss_task_title
target_functor = task_targets_lostzone_all
status_functor = special_steps_for_lostzone_tasks
descr = {+wpn_gauss_quest} lttz_ll_fetch_gauss_task_descr2, lttz_ll_fetch_gauss_task_descr
stage_complete = 2

on_init = %=spawn_item_at_pos(wpn_gauss_quest) =create_squad(special_poltergeist_task_squad:zat_a23_smart_terrain)%
on_complete = %=reward_random_money(4000:6000) =complete_task_inc_goodwill(50:stalker) =lttz_ll_take_wpn_gauss_quest%
condlist_0 = {+stalker_rogue_living_legend_fetch_complete} complete
condlist_1 = {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 10-
[lttz_ll_path_pripyat]
icon = ui_inGame2_Put_v_pripyat
prior = 195
storyline = true

title = lttz_ll_path_pripyat_task_title
target = {+stalker_rogue_underpass} lost_stalker_strelok, {+jupiter_underpass_monolith_ambush_squad_death} stalker_rogue, {+monolith_ambush} jupiter_underpass_monolith_ambush_squad, {=actor_on_level(jupiter_underground)} lost_stalker_strelok, jupiter_space_restrictor_to_jupiter_ug
descr = {+stalker_rogue_underpass} lttz_ll_reach_pripyat_task_descr, {+jupiter_underpass_monolith_ambush_squad_death} lttz_ll_talk_rogue_underpass_task_descr, lttz_ll_path_pripyat_task_descr

on_init = %=create_squad(jupiter_underpass_monolith_ambush:pas_b400_hall) =create_squad(lost_stalker_strelok_squad:pri_a16) =create_squad(stalker_stitch_squad:pri_a16) =open_route(jup:jup_u)%
on_complete = %=complete_task_inc_goodwill(50:stalker) =remove_special_task_squad(stalker_rogue) =create_squad(pri_a16_stalker_rogue_squad:pri_a16) +lttz_ll_preparations%
condlist_0 = {+living_legend_strelok_start} complete
condlist_1 = {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 11-
[lttz_ll_medical_supplies]
icon = ui_inGame2_Pered_zadaniyami_voennih
storyline = true
prior = 195
precondition = {+living_legend_stitch_supplies -stitch_supplies} true, false

title = lttz_ll_medical_supplies_name
title_functor = general_fetch_task
target = stalker_stitch
status_functor = actor_has_fetch_item
descr = lttz_ll_medical_supplies_text
descr_functor = general_fetch_task
stage_complete = 1

on_init = %=setup_fetch_task(lttz_ll_medical_supplies_fetch:medical:4:6) +stitch_supplies%
on_complete = %+lttz_ll_medical_supplies_task_done =complete_task_inc_goodwill(50:stalker) =fetch_reward_and_remove(lttz_ll_medical_supplies_fetch:1.25) =reward_stash(true) =pstor_reset(lttz_ll_medical_supplies_fetch)%
on_fail = %=pstor_reset(lttz_ll_medical_supplies_fetch)%
condlist_0 = {+living_legend_stitch_supplies_complete} complete
condlist_1 = {+stalker_stitch_dead} fail

;------------------------------------------------
; Living Legend Task 12-
[lttz_ll_attack_on_titan]
icon = ui_inGame2_PD_Ohotnik_na_mutantov
storyline = true
prior = 195
precondition = {+living_legend_stitch_supplies -rogue_titan} true, false

title = lttz_ll_attack_on_titan_name
target_functor = task_targets_lostzone_all
status_functor = special_steps_for_lostzone_tasks
descr = {+special_gigant_task_squad_dead} lttz_ll_return_rogue_attack_on_titan_task_descr, lttz_ll_attack_on_titan_text
stage_complete = 2

on_init = %=create_squad(special_gigant_task_squad:pri_sim_3) +rogue_titan%
on_complete = %+lttz_ll_attack_on_titan_task_done =reward_money(6000) =reward_item(swiss_knife) =complete_task_inc_goodwill(50:stalker)%
condlist_0 = {+living_legend_rogue_titan_complete} complete
condlist_1 = {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 13-
[lttz_ll_find_documents]
icon = ui_inGame2_Laboratoriya_X8
prior = 195
storyline = true
precondition = {+living_legend_stitch_supplies -strelok_x8} true, false

title = lttz_ll_find_documents_name
target = {=actor_has_item(x8_documents)} lost_stalker_strelok, {=actor_on_level(labx8)} nil, pri_space_restrictor_to_labx8
descr = lttz_ll_find_documents_text

on_init = %=spawn_x8_documents() +strelok_x8 =open_route(out:x8)%
on_complete = %=reward_random_item(af_grid_up:af_freon_up:af_cooler_up:af_kevlar_up) =reward_stash(true) =complete_task_inc_goodwill(50:stalker) =lttz_ll_take_x8_documents%
condlist_0 = {+living_legend_strelok_preparations} complete
condlist_1 = {+lost_stalker_strelok_dead} fail

;------------------------------------------------
; Living Legend Task 14-
[lttz_ll_eidolon_start]
icon = ui_inGame2_Vizhivshiy_monolit
prior = 195
storyline = true

title = lttz_ll_eidolon_start_task_title
target = {+stalker_stitch_join_eidolon +stalker_rogue_join_eidolon} monolith_eidolon_recon_squad, {-stalker_rogue_join_eidolon} pri_a16_stalker_rogue, {-stalker_stitch_join_eidolon} stalker_stitch
descr = lttz_ll_eidolon_start_task_descr

on_init = %=create_squad(monolith_eidolon_recon_squad:pri_sim_5) =create_squad(monolith_eidolon_squad:pri_monolith)%
on_complete = %=give_task(lttz_ll_eidolon)%
condlist_0 = {+monolith_eidolon_recon_squad_death} complete
condlist_1 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 15-
[lttz_ll_eidolon]
icon = ui_inGame2_Odin_vistrel
prior = 195
storyline = true

title = lttz_ll_eidolon_task_title
target_functor = task_targets_lostzone_all
descr = lttz_ll_eidolon_task_descr

on_init = %=create_squad(monolith_eidolon_assault_squad:pri_monolith)  =open_route(out:pri) =open_route(aes1:pri) =open_route(aes1:sar)%
on_complete = %=give_task(lttz_ll_strelok_objective)%
condlist_0 = {+monolith_eidolon_dead} complete
condlist_1 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 16-
[lttz_ll_strelok_objective]
icon = ui_iconsNpc_strelok
prior = 195
storyline = true

title = lttz_ll_strelok_objective_task_title
target = lost_stalker_strelok
descr = lttz_ll_strelok_objective_task_descr

on_complete = %=reward_money(10000) =reward_random_item(af_aam:af_gravi_af_aam:af_fireball_af_aam:af_electra_moonlight_af_aam) =reward_item(decoder) =reward_stash(true) =complete_task_inc_goodwill(50:stalker) =give_task(lttz_ll_chernobyl_raid)%
condlist_0 = {+living_legend_strelok_objective} complete
condlist_1 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 17-
[lttz_ll_chernobyl_raid]
icon = ui_iconsTotal_sar_warlab
prior = 195
storyline = true

title = lttz_ll_chernobyl_raid_task_title
target_functor = task_targets_lostzone_all
descr = lttz_ll_chernobyl_raid_task_descr

on_init = %=create_squad(monolith_chernobyl_defence_squad:aes_smart_terrain_monolit_blockpost4)%
on_complete = %=give_task(lttz_ll_crucible)%
condlist_0 = {+monolith_chernobyl_defence_squad_death} complete
condlist_1 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Crucible Living Legend Task 18-
[lttz_ll_crucible]
icon = ui_iconsTotal_sar_secret_lab
prior = 195
storyline = true

title = lttz_ll_crucible_task_title
target = {+sar_enter_command_center} monolith_shard_guardian_squad, {+actor_in_sarcofag} monolith_shard_guardian_squad, aes_space_restrictor_to_sarcofag
descr = lttz_ll_crucible_task_descr

on_init = %=spawn_monolith_shard() =create_squad(monolith_shard_guardian_squad:sar_monolith_guard)%
on_complete = %=give_task(lttz_ll_answers) +lttz_ll_crucible_task_done%
condlist_0 = {=actor_has_item(monolith_shard) +monolith_shard_guardian_squad_dead} complete
condlist_1 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Living Legend Task 19-
[lttz_ll_answers]
icon = ui_inGame2_PD_WishfulThinking
prior = 195
storyline = true

title = lttz_ll_answers_task_title
target = lost_stalker_strelok
descr = lttz_ll_answers_task_descr

on_complete = %=complete_task_inc_goodwill(50:stalker) =reward_item(af_fuzz_kolobok_af_aam) =lttz_ll_give_strelok_pendrive =lttz_ll_take_monolith_shard =remove_special_task_squad(lost_stalker_strelok) =remove_special_task_squad(stalker_stitch) =remove_special_task_squad(pri_a16_stalker_rogue) =open_route(aes2:aes1) =open_route(aes1:zat)%
condlist_0 = {+lost_stalker_strelok_dead} fail, {+stalker_stitch_dead} fail, {+stalker_rogue_dead} fail

;------------------------------------------------
; Finish Living Legend Task 20-
[lttz_ll_finish_dolg]
icon = ui_iconsNpc_stalker_do_komandir
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = bar_dolg_leader
descr = lttz_ll_finish_dolg_task_descr

on_complete = %=reward_money(30000) =reward_stash() =complete_task_inc_goodwill(100:dolg) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+voronin_living_legend_finish} complete

[lttz_ll_finish_killer]
icon = ui_iconsNpc_stalker_ki_informator
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = cit_killers_merc_trader_stalker
descr = lttz_ll_finish_killer_task_descr

on_complete = %=reward_money(35000) =reward_stash() =complete_task_inc_goodwill(100:killer) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+dushman_living_legend_finish} complete

[lttz_ll_finish_stalker]
icon = ui_iconsNpc_trader
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = esc_m_trader
descr = lttz_ll_finish_stalker_task_descr

on_complete = %=reward_money(30000) =reward_stash() =complete_task_inc_goodwill(100:stalker) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+sidorovich_living_legend_finish} complete

[lttz_ll_finish_csky]
icon = ui_iconsTotal_tutorial_help_wounded
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = mar_smart_terrain_base_stalker_leader_marsh
descr = lttz_ll_finish_csky_task_descr

on_complete = %=reward_money(25000) =reward_item(af_aac) =reward_stash() =complete_task_inc_goodwill(100:csky) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+cold_living_legend_finish} complete

[lttz_ll_finish_freedom]
icon = ui_iconsNpc_stalker_sv_leader
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = mil_smart_terrain_7_7_freedom_leader_stalker
descr = lttz_ll_finish_freedom_task_descr

on_complete = %=reward_money(30000) =reward_item(cigar3__3) =reward_stash() =complete_task_inc_goodwill(100:freedom) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+lukash_living_legend_finish} complete

[lttz_ll_finish_ecolog]
icon = ui_iconsNpc_ucheniy_2
prior = 195
storyline = true

title = lttz_ll_finish_task_title
target = yan_stalker_sakharov
descr = lttz_ll_finish_ecolog_task_descr

on_complete = %=reward_money(25000) =reward_item(af_aam) =reward_stash() =complete_task_inc_goodwill(100:ecolog) =lttz_ll_take_strelok_pendrive%
condlist_0 = {+sakharov_living_legend_finish} complete