;--------------------------------------------------------------------------------------------------
; DEFEND BAR FROM MUTANTS TASK-

[bar_visitors_barman_stalker_trader_task_1]
icon = ui_inGame2_Nochnaya_ohota
prior = 35
storyline = false
title = bar_visitors_barman_stalker_trader_task_1_name
descr = bar_visitors_barman_stalker_trader_task_1_text
job_descr = bar_visitors_barman_stalker_trader_task_1_about
task_complete_descr = bar_visitors_barman_stalker_trader_task_1_finish
target_functor = general_under_faction_control
status_functor = check_smart_under_faction_control_staged
status_functor_params = monster
on_init = %=find_smart_under_faction_control(bar_visitors_barman_stalker_trader_task_1_id:monster)%
precondition = {=all_avail_smart_stayed_squad_count_ge_by_faction(1:nil:false:monster)} true, false
repeat_timeout = 43200
stage_complete = 1
on_complete = %=complete_task_inc_goodwill(50:stalker) =reward_random_money(4000:4500) =reward_stash(true) =inc_task_stage(bar_visitors_barman_stalker_trader_task_1) =pstor_reset(bar_visitors_barman_stalker_trader_task_1_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_1_target_id)%
on_fail = %=pstor_reset(bar_visitors_barman_stalker_trader_task_1_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_1_target_id) =fail_task_dec_goodwill(25:stalker)%
on_cancel = %=pstor_reset(bar_visitors_barman_stalker_trader_task_1_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_1_target_id)%

;--------------------------------------------------------------------------------------------------
; KILL BANDITS FOR BARMAN TASK-

[bar_visitors_barman_stalker_trader_task_2]
icon = ui_inGame2_Odin_vistrel
prior = 10
storyline = false
title = bar_visitors_barman_stalker_trader_task_2_name
descr = bar_visitors_barman_stalker_trader_task_2_text
job_descr = bar_visitors_barman_stalker_trader_task_2_about
task_complete_descr = bar_visitors_barman_stalker_trader_task_2_finish
repeat_timeout = 43200
target_functor = general_under_faction_control
status_functor = check_smart_under_faction_control_staged
status_functor_params = bandit
stage_complete = 1
on_init = %=find_smart_under_faction_control_ex(bar_visitors_barman_stalker_trader_task_2_id:bandit)%
precondition = {=all_avail_smart_stayed_squad_count_ge_by_faction_ex(1:nil:false:bandit)} true, false
on_complete = %=complete_task_inc_goodwill(50:stalker) =reward_random_money(5500:6500) =reward_stash(true) =inc_task_stage(bar_visitors_barman_stalker_trader_task_2) =pstor_reset(bar_visitors_barman_stalker_trader_task_2_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_2_target_id)%
on_fail = %=fail_task_dec_goodwill(25:stalker) =pstor_reset(bar_visitors_barman_stalker_trader_task_2_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_2_target_id)%
on_cancel = %=pstor_reset(bar_visitors_barman_stalker_trader_task_2_id) =pstor_reset(bar_visitors_barman_stalker_trader_task_2_target_id)%

;--------------------------------------------------------------------------------------------------
; FIND ARTEFACT FOR BARMAN TASK-

[bar_visitors_barman_stalker_trader_task_3]
icon = ui_inGame2_Kontrakt_s_uchenimi
prior = 5
storyline = false
title = bar_visitors_barman_stalker_trader_task_3_name
title_functor = general_fetch_task
descr = bar_visitors_barman_stalker_trader_task_3_text
descr_functor = general_fetch_task
job_descr = bar_visitors_barman_stalker_trader_task_3_about
fetch_descr = bar_visitors_barman_stalker_trader_task_3_fetch_about
fetch_func = %=setup_artefact_fetch_task(bar_visitors_barman_stalker_trader_task_3_fetch)%
stage_complete = 1
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = bar_visitors_barman_stalker_trader_task_3_fetch_finish
; precondition = true
repeat_timeout = 64800
on_complete = %=complete_task_inc_goodwill(50:stalker) =reward_stash(true) =reward_item_cost_mult_and_remove(bar_visitors_barman_stalker_trader_task_3_fetch:0.63) =inc_task_stage(bar_visitors_barman_stalker_trader_task_3)%
on_fail = %=fail_task_dec_goodwill(25:stalker)%

;--------------------------------------------------------------------------------------------------
; FIND WEAPON FOR DUTY TASK-

[bar_dolg_leader_task_1]
icon = ui_inGame2_Osobiy_zakaz
prior = 50
storyline = false
title = bar_dolg_leader_task_1_name
title_functor = general_fetch_task
descr = bar_dolg_leader_task_1_text
descr_functor = general_fetch_task
job_descr = bar_dolg_leader_task_1_about
fetch_descr = bar_dolg_leader_task_1_fetch_about
fetch_func = %=setup_weapon_fetch_task(bar_dolg_leader_task_1_fetch)%
stage_complete = 1
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = bar_dolg_leader_task_1_fetch_finish
; precondition = true
repeat_timeout = 64800
on_complete = %=complete_task_inc_goodwill(50:dolg) =reward_weapon_cost_mult_and_remove(bar_dolg_leader_task_1_fetch:1.2) =reward_stash(true) =inc_task_stage(bar_dolg_leader_task_1)%
on_fail = %=fail_task_dec_goodwill(25:dolg)%
;--------------------------------------------------------------------------------------------------
; ASSASSINATION FOR DUTY TASK-

[bar_dolg_leader_task_2]
icon = ui_inGame2_Odin_vistrel
prior = 35
storyline = false
title = bar_dolg_general_petrenko_stalker_task_3_name
descr = bar_dolg_general_petrenko_stalker_task_3_text
job_descr = bar_dolg_general_petrenko_stalker_task_3_about
task_complete_descr = bar_dolg_general_petrenko_stalker_task_3_finish
precondition = true
repeat_timeout = 86400
status_functor = bounty_task
target_functor = general_bounty_task
stage_complete = 1
on_job_descr = %=on_init_bounty_hunt(bar_dolg_leader_task_2:freedom:bandit)%
%=on_init_bounty_hunt(bar_dolg_leader_task_2:freedom:bandit)%
on_complete = %=reward_random_money(10000:12000) =reward_stash(true) =inc_task_stage(bar_dolg_leader_task_2) =complete_task_inc_goodwill(50:dolg)%

;--------------------------------------------------------------------------------------------------
; DEFEND TERRITORY FOR DUTY TASK-

[bar_dolg_general_petrenko_stalker_task_1]
icon = ui_inGame2_Odin_vistrel
prior = 2
storyline = false
title = bar_dolg_general_petrenko_stalker_task_1_name
descr = bar_dolg_general_petrenko_stalker_task_1_text
job_descr = bar_dolg_general_petrenko_stalker_task_1_about
task_complete_descr = bar_dolg_general_petrenko_stalker_task_1_finish
repeat_timeout = 43200
target_functor = general_under_faction_control
status_functor = check_smart_under_faction_control_staged
status_functor_params = killer,bandit
stage_complete = 1
on_init = %=find_smart_under_faction_control_ex(bar_dolg_general_petrenko_stalker_task_1_id:killer:bandit)%
precondition = {=all_avail_smart_stayed_squad_count_ge_by_faction_ex(1:nil:false:killer:bandit)} true, false
on_complete = %=complete_task_inc_goodwill(50:dolg) =reward_random_money(7500:8500) =reward_stash(true) =inc_task_stage(bar_dolg_general_petrenko_stalker_task_1) =pstor_reset(bar_dolg_general_petrenko_stalker_task_1_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_1_target_id)%
on_fail = %=fail_task_dec_goodwill(25:dolg) =pstor_reset(bar_dolg_general_petrenko_stalker_task_1_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_1_target_id)%
on_cancel = %=pstor_reset(bar_dolg_general_petrenko_stalker_task_1_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_1_target_id)%

;--------------------------------------------------------------------------------------------------
; CAPTURE TERRITORY FOR DUTY TASK-

[bar_dolg_general_petrenko_stalker_task_2]
icon = ui_inGame2_Odin_vistrel
prior = 2
storyline = false
title = bar_dolg_general_petrenko_stalker_task_2_name
descr = bar_dolg_general_petrenko_stalker_task_2_text
job_descr = bar_dolg_general_petrenko_stalker_task_2_about
task_complete_descr = bar_dolg_general_petrenko_stalker_task_2_finish
repeat_timeout = 43200
target_functor = general_under_faction_control
status_functor = check_smart_under_faction_control_staged
status_functor_params = freedom
stage_complete = 1
on_init = %=find_smart_under_faction_control(bar_dolg_general_petrenko_stalker_task_2_id:freedom)%
precondition = {=all_avail_smart_stayed_squad_count_ge_by_faction(1:nil:false:freedom)} true, false
on_complete = %=complete_task_inc_goodwill(50:dolg) =reward_random_money(8500:9500) =reward_stash(true) =inc_task_stage(bar_dolg_general_petrenko_stalker_task_2) =pstor_reset(bar_dolg_general_petrenko_stalker_task_2_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_2_target_id)%
on_fail = %=fail_task_dec_goodwill(25:dolg) =pstor_reset(bar_dolg_general_petrenko_stalker_task_2_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_2_target_id)%
on_cancel = %=pstor_reset(bar_dolg_general_petrenko_stalker_task_2_id) =pstor_reset(bar_dolg_general_petrenko_stalker_task_2_target_id)%

;--------------------------------------------------------------------------------------------------
; FIND MUTANT PARTS FOR DUTY TASK-

[bar_dolg_general_petrenko_stalker_task_3]
icon = ui_inGame2_Nochnaya_ohota
prior = 50
storyline = false
title = jup_b6_scientist_tech_task_3_name
title_functor = general_fetch_task
descr = jup_b6_scientist_tech_task_3_text
descr_functor = general_fetch_task
job_descr = jup_b6_scientist_tech_task_3_about
fetch_descr = jup_b6_scientist_tech_task_3_fetch_about
fetch_func = %=setup_rare_mutant_fetch_task(bar_dolg_general_petrenko_stalker_task_3_fetch)%
stage_complete = 1
; precondition = {=random_chance(50)} true, false
repeat_timeout = 43200
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = jup_b6_scientist_tech_task_3_fetch_finish
on_complete = %=complete_task_inc_goodwill(50:dolg) =reward_stash(true) =reward_item_cost_mult_and_remove(bar_dolg_general_petrenko_stalker_task_3_fetch:1.9) =inc_task_stage(jup_b6_scientist_tech_task_3)%


;--------------------------------------------------------------------------------------------------
; FIND LEVEL 1 TOOLKIT FOR MANGUN TASK-

[bar_visitors_stalker_mechanic_task_1]
icon = ui_inGame2_Instrumenti
prior = 10
storyline = false
title = bar_visitors_stalker_mechanic_task_1_name
title_functor = general_fetch_task
descr = bar_visitors_stalker_mechanic_task_1_text
descr_functor = general_fetch_task
job_descr = bar_visitors_stalker_mechanic_task_1_about
fetch_descr = bar_visitors_stalker_mechanic_task_1_fetch_about
fetch_func = %=setup_generic_fetch_task(bar_visitors_stalker_mechanic_task_1_fetch:1:itm_repairkit_tier_1)%
stage_complete = 1
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = bar_visitors_stalker_mechanic_task_1_fetch_finish
on_complete = %+bar_visitors_stalker_mechanic_upgrade_tier_1 =complete_task_inc_goodwill(50:dolg) =reward_item_cost_mult_and_remove(bar_visitors_stalker_mechanic_task_1_fetch:0.8) =inc_task_stage(bar_visitors_stalker_mechanic_task_1)%
precondition = {-bar_visitors_stalker_mechanic_upgrade_tier_1} true, false


;--------------------------------------------------------------------------------------------------
; FIND LEVEL 2 TOOLKIT FOR MANGUN TASK-

[bar_visitors_stalker_mechanic_task_2]
icon = ui_inGame2_Instrumenti
prior = 10
storyline = false
title = bar_visitors_stalker_mechanic_task_2_name
title_functor = general_fetch_task
descr = bar_visitors_stalker_mechanic_task_2_text
descr_functor = general_fetch_task
job_descr = bar_visitors_stalker_mechanic_task_2_about
fetch_descr = bar_visitors_stalker_mechanic_task_2_fetch_about
fetch_func = %=setup_generic_fetch_task(bar_visitors_stalker_mechanic_task_2_fetch:1:itm_repairkit_tier_2)%
stage_complete = 1
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = bar_visitors_stalker_mechanic_task_2_fetch_finish
on_complete = %+bar_visitors_stalker_mechanic_upgrade_tier_2 =complete_task_inc_goodwill(50:dolg) =reward_item_cost_mult_and_remove(bar_visitors_stalker_mechanic_task_2_fetch:0.8) =inc_task_stage(bar_visitors_stalker_mechanic_task_2)%
precondition = {+bar_visitors_stalker_mechanic_upgrade_tier_1 -bar_visitors_stalker_mechanic_upgrade_tier_2} true, false


;--------------------------------------------------------------------------------------------------
; FIND LEVEL 3 TOOLKIT FOR MANGUN TASK-

[bar_visitors_stalker_mechanic_task_3]
icon = ui_inGame2_Instrumenti
prior = 10
storyline = false
title = bar_visitors_stalker_mechanic_task_3_name
title_functor = general_fetch_task
descr = bar_visitors_stalker_mechanic_task_3_text
descr_functor = general_fetch_task
job_descr = bar_visitors_stalker_mechanic_task_3_about
fetch_descr = bar_visitors_stalker_mechanic_task_3_fetch_about
fetch_func = %=setup_generic_fetch_task(bar_visitors_stalker_mechanic_task_3_fetch:1:itm_repairkit_tier_3)%
stage_complete = 1
status_functor = actor_has_fetch_item
target_functor = general_fetch_task
task_complete_descr = bar_visitors_stalker_mechanic_task_3_fetch_finish
on_complete = %+bar_visitors_stalker_mechanic_upgrade_tier_3 =complete_task_inc_goodwill(50:dolg) =reward_item_cost_mult_and_remove(bar_visitors_stalker_mechanic_task_3_fetch:0.8) =inc_task_stage(bar_visitors_stalker_mechanic_task_3)%
precondition = {+bar_visitors_stalker_mechanic_upgrade_tier_2 -bar_visitors_stalker_mechanic_upgrade_tier_3} true, false
