local time_global = time_global local time_interval = 10000 local tg = 0 local gc = game.translate_string function actor_on_update() local t = time_global() if t < tg then return end tg = t + time_interval local hours = level.get_time_hours() local level_name = level.name() if (db.actor:object("cs_informer_pda") ~= nil) and (not has_alife_info("cs_task2_start")) and has_alife_info("cs_task1_start") then db.actor:give_info_portion("cs_task2_start") task_manager.get_task_manager():give_task("cs_story_task2") end if (db.actor:object("bar_case") ~= nil) and (not has_alife_info("bar_case_have")) then db.actor:give_info_portion("bar_case_have") alife(l08_yantar):create("snork_cs_strong",vector():set(-61.414897918701,1.2449436187744,-148.25701904297),39582,2223) alife(l08_yantar):create("m_controller_normal2",vector():set(-38.140983581543,0.48093682527542,-146.32695007324),50578,2258) end if (db.actor:object("cs_deshefrator") ~= nil) and (not has_alife_info("cs_task8_storytask_start")) then task_manager.get_task_manager():give_task("cs_task8_storytask") news_manager.send_tip(db.actor, gc("cs_task8_news3"), 1, nil, 15000) db.actor:give_info_portion("cs_task8_storytask_start") end if (db.actor:object("pda_shmatko") ~= nil) and (not has_alife_info("dolg_story_task_3_dop_started")) then task_manager.get_task_manager():give_task("dolg_story_task_3_dop") db.actor:give_info_portion("dolg_story_task_3_dop_started") end if (db.actor:object("pda_pinya") ~= nil) and (not has_alife_info("dolg_story_task_4_dop_started")) then task_manager.get_task_manager():give_task("dolg_story_task_4_dop") db.actor:give_info_portion("dolg_story_task_4_dop_started") end if (db.actor:object("pda_barbos") ~= nil) and (not has_alife_info("pda_barbos_found")) then db.actor:give_info_portion("pda_barbos_found") alife(l10_red_forest):create("snork_cs_strong",vector():set(-15.210734367371,-2.5547621250153,-219.93609619141),52999,2764) end if (db.actor:object("pda_tango") ~= nil) and (not has_alife_info("pda_tango_found")) then db.actor:give_info_portion("pda_tango_found") alife(l10_red_forest):create("bloodsucker_cs_normal",vector():set(116.27769470215,-2.9433076381683,-314.80520629883),102209,2785) end if (db.actor:object("pda_tribun") ~= nil) and (not has_alife_info("pda_tribun_found")) then db.actor:give_info_portion("pda_tribun_found") alife(l10_red_forest):create("burer_cs_normal",vector():set(176.04179382324,-0.21944612264633,-207.09704589844),116088,2805) end if (has_alife_info("kuznecov_task_4_zavercheno")) and (has_alife_info("document_x10_kuznecov")) and (not has_alife_info("come_to_aes_vidan")) then task_manager.get_task_manager():give_task("come_to_aes") news_manager.send_tip(db.actor, gc("kvartet_1"), 4, army, 30000) db.actor:give_info_portion("come_to_aes_vidan") end if has_alife_info("monolith_defense_squad_1_death") and has_alife_info("monolith_defense_squad_2_death") and has_alife_info("monolith_defense_squad_3_death") and not has_alife_info("road_clear") then db.actor:give_info_portion("road_clear") task_manager.get_task_manager():give_task("assault_gen") news_manager.send_tip(db.actor, gc("kvartet_3"), 4, army, 30000) end if has_alife_info("monolith_defense_squad_gen_death") and not has_alife_info("zadacha_vipolnena") then db.actor:give_info_portion("zadacha_vipolnena") news_manager.send_tip(db.actor, gc("kvartet_4"), 4, army, 30000) end if has_alife_info("mil_smart_terrain_7_7_freedom_leader_stalker_squad_dead") and not has_alife_info("zadacha_vipolnena_1") then db.actor:give_info_portion("zadacha_vipolnena_1") news_manager.send_tip(db.actor, gc("st_cherep_1"), 4, nil, 30000) end if (hours>=21) and (hours<23) and (not has_alife_info("cs_task1_start")) and has_alife_info("cs_story_task0_done") then news_manager.send_tip(db.actor, gc("cs_task1_news"), 4, csky, 30000) news_manager.send_tip(db.actor, gc("cs_task1_news1"), 7, nil, 30000) db.actor:give_info_portion("cs_task1_start") task_manager.get_task_manager():give_task("cs_story_task1") alife(k00_marsh):create("cs_informer",vector():set(105.97696685791,1.1209254264832,332.66290283203),201708,84):on_death() end if (hours>=12) and (hours<22) and (not has_alife_info("holod_soobshil")) and has_alife_info("cs_story_task2_done") then news_manager.send_tip(db.actor, gc("cs_task1_news2"), 1, csky, 30000) db.actor:give_info_portion("holod_soobshil") task_manager.get_task_manager():give_task("cs_story_task3_start") end if (hours>=5) and (hours<12) and (not has_alife_info("cs1_fail")) and has_alife_info("cs_task1_start") then db.actor:give_info_portion("cs1_fail") end end function attack_aes1(first_speaker, second_speaker) task_manager.get_task_manager():give_task("army_assault_1") news_manager.send_tip(db.actor, gc("kvartet_2"), 4, army, 30000) end function attack_aes2(first_speaker, second_speaker) task_manager.get_task_manager():give_task("army_assault_2") news_manager.send_tip(db.actor, gc("kvartet_5"), 4, army, 10000) end function attack_aes3(first_speaker, second_speaker) task_manager.get_task_manager():give_task("army_assault_3") news_manager.send_tip(db.actor, gc("kvartet_5"), 4, army, 10000) end function maks_quest_1_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("maks_quest_1") end function cherep_quest_1_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cherep_quest_1") end function seriy_quest_1_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("seriy_quest_1") end function jurov_quest_1_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("jurov_quest_1") end function cs_story_task0() local x= -257.66229248047 local y= 0.67916983366013 local z= -108.30141448975 local level_vertex= 14858 local game_vertex_id= 163 alife(k00_marsh):create("cs_anom_pribor",vector():set(x,y,z),level_vertex,game_vertex_id) task_manager.get_task_manager():give_task("cs_story_task0") end function barmen_task1() local x= -65.248710632324 local y= 1.2446894645691 local z= -148.64331054688 local level_vertex= 38052 local game_vertex_id= 2223 alife(l08_yantar):create("bar_case",vector():set(x,y,z),level_vertex,game_vertex_id) task_manager.get_task_manager():give_task("barmen_task1") end function have_cs_pda(first_speaker, second_speaker) return ( (db.actor:object("cs_informer_pda") ~= nil)) end function have_cs_pribor(first_speaker, second_speaker) return ( (db.actor:object("cs_anom_pribor") ~= nil)) end function cs_story_task0_end(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "cs_anom_pribor") end function cs_story_task2_end(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "cs_informer_pda") end function proverka_ranga(actor) local rank = ranks.get_obj_rank_name(actor) if (rank == "experienced" or rank == "professional" or rank == "veteran" or rank == "expert" or rank == "master" or rank == "legend") then return true else return false end end function proverka_ranga1(actor) local rank = ranks.get_obj_rank_name(actor) if (rank == "novice" or rank == "trainee") then return true else return false end end function have_art_juravl(first_speaker, second_speaker) return ( (db.actor:object("af_night_star_lead_box_bandit_task_1") ~= nil)) end function relocate_art_juravl(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "af_night_star_lead_box_bandit_task_1") end function give_art_juravl(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "af_night_star_lead_box_bandit_task_1") end function bandit_task1(first_speaker, second_speaker) task_manager.get_task_manager():give_task("bandit_task1") end function have_bar_case(first_speaker, second_speaker) return ( (db.actor:object("bar_case") ~= nil)) end function relocate_bar_case(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "bar_case") end function boroda_task1(first_speaker, second_speaker) task_manager.get_task_manager():give_task("boroda_task1") end function cs_task3_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task3_storytask") end function cs_task0_ambush_renegade(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task0_ambush_renegade_story") end function cs_task0_ambush_renegade_2(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task0_ambush_renegade_story2") end function cs_task0_ambush_renegade_3(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task0_ambush_renegade_story3") end function give_money_20000(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 20000) end function have_money_20000(first_speaker, second_speaker) return db.actor:money() >= 20000 end function give_money_10000(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 10000) end function have_money_10000(first_speaker, second_speaker) return db.actor:money() >= 10000 end function give_money_5000(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 5000) end function have_money_5000(first_speaker, second_speaker) return db.actor:money() >= 5000 end function cs_task4_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task4_storytask") end function cs_task5_start(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task5_storytask") end function cs_task6_storytask(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task6_storytask") end function cs_task7_storytask(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task7_storytask") end function ohotnik_task1() local x= -217.7313079834 local y= 4.4898195266724 local z= 179.87519836426 local level_vertex= 22294 local game_vertex_id= 1850 alife(l06_rostok):create("wpn_bm16_ohotnik",vector():set(x,y,z),level_vertex,game_vertex_id) task_manager.get_task_manager():give_task("ohotnik_task1") end function have_ohotnik_task1(first_speaker, second_speaker) return ( (db.actor:object("wpn_bm16_ohotnik") ~= nil)) end function relocate_ohotnik_task1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_bm16_ohotnik") end function cs_task8_deshifrator_have(first_speaker, second_speaker) return ( (db.actor:object("cs_deshefrator") ~= nil)) end function cs_task8_deshifrator(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "cs_deshefrator") end function cs_end_story(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task9_storytask") task_manager.get_task_manager():give_task("cs_task10_storytask") end function cs_task11_storytask(first_speaker, second_speaker) task_manager.get_task_manager():give_task("cs_task11_storytask") end function dolg_story_task_1(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_1") end function dolg_story_task_2(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_2") end function dolg_story_task_1_dop(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_1_dop") alife(l02_garbage):create("freon",vector():set(156.14549255371,-0.61046588420868,-189.81704711914),292988,750):on_death() end function dolg_story_task_1_dop_reward(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "wpn_toz34_m3",1) end function recolate_dolg_task1_pda1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_flibuster") end function recolate_dolg_task1_pda(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_freon") end function dolg_task1_pda1(first_speaker, second_speaker) return ( (db.actor:object("pda_flibuster") ~= nil)) end function dolg_task1_pda(first_speaker, second_speaker) return ( (db.actor:object("pda_freon") ~= nil)) end function dolg_task4_pdapr(first_speaker, second_speaker) return ( (db.actor:object("pda_pinya") ~= nil)) end function dolg_story_task_4_pda(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_pinya") end function dolg_story_task_4_pda1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_pinya") dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "wpn_vintorez",1) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "ammo_9x39_pab9",5) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bag_medkit_2",1) end function dolg_story_task_2_dop(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_2_dop") end function dolg_story_task_3(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_3") alife(k02_trucks_cemetery):create("shmatko",vector():set(69.024261474609,4.2719812393188,56.722690582275),535393,5304):on_death() alife(k02_trucks_cemetery):create("sim_default_duty_1",vector():set(58.96622467041,3.6014313697815,60.900428771973),521633,5304):on_death() alife(k02_trucks_cemetery):create("sim_default_duty_2",vector():set(78.0078125,4.4732160568237,70.226112365723),546058,5304):on_death() end function dolg_story_task_4(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_4") alife(l07_military):create("pinya",vector():set(-261.25204467773,-22.531833648682,278.73748779297),71002,2041):on_death() alife(l07_military):create("sim_default_military_5",vector():set(-248.07293701172,-22.156795501709,287.17080688477),81230,2062):on_death() alife(l07_military):create("sim_default_military_5",vector():set(-235.64768981934,-20.317403793335,279.80844116211),90058,2062):on_death() end function dolg_story_task_5(first_speaker, second_speaker) task_manager.get_task_manager():give_task("dolg_story_task_5") alife(l10_red_forest):create("barbos",vector():set(-29.497421264648,-2.519168138504,-220.1439666748),40906,2764):on_death() alife(l10_red_forest):create("tango",vector():set(106.89953613281,-3.3275420665741,-306.78326416016),101251,2762):on_death() alife(l10_red_forest):create("tribun",vector():set(178.21212768555,-0.18895435333252,-198.24349975586),117567,2805):on_death() end function give_task_esc_military_docs_poisk() task_manager.get_task_manager():give_task("esc_military_docs_task") alife():create("military_escape_docs",vector():set(-140.94975280762,-23.429815292358,-359.5514831543),114065,451) end function check_esc_military_docs_in_actor(first_speaker, second_speaker) return db.actor:object("military_escape_docs") end function relocate_esc_military_docs_to_wolf(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "military_escape_docs") end function on_game_start() RegisterScriptCallback("actor_on_update",actor_on_update) end