Added New Mods and Profiles Folders

This is a complete rebuild of the modpack, with all new mods and updates for 1.5.3 of Anomaly.
This commit is contained in:
2025-01-14 05:07:53 -05:00
parent 85c665b107
commit 376b4b9689
21217 changed files with 546254 additions and 0 deletions
@@ -0,0 +1,530 @@
---Ìîè ôóíêöèè -----
local aditional_spawn_table = {
-- {x, y, z, level_vertex_id, game_vertex_id, êîë-âî}
-- spawn_bol_o1 = {['af_ah_o1'] = {242.14581298828,5.3199117660522,53.268936157227, 292647, 63}},
spawn_bol_o1 = {['af_ah_o1'] = {241.87088012695,5.9297779083252,52.383800506592, 293187, 63}},
spawn_bol_o2 = {['af_ah_o2'] = {386.03338623047,0.98510533571243,314.71539306641, 400778, 270}},
spawn_bol_e1 = {['af_ah_e1'] = {459.04193115234,1.9701368808746,-7.0784845352173, 448532, 246}},
spawn_agr_pda = {['kovalev_pda_item'] = {47.145408630371,8.4094705581665,-12.874572753906, 238350, 1013}},
spawn_agr_g1 = {['af_ah_g1'] = {-199.63502502441,0.90268939733505,-28.170597076416, 29987, 943}},
spawn_agr_g2 = {['af_ah_g2'] = {22.595127105713,6.0576524734497,-275.8801574707, 218591, 1046}},
spawn_agr_h1 = {['af_ah_h1'] = {-195.37408447266,1.1277058124542,66.171974182129, 19691, 970}},
spawn_yan_o1 = {['af_ah_o1'] = {-174.13641357422,3.2181444168091,-143.85270690918, 5663, 2195}},
spawn_yan_h1 = {['af_ah_h1'] = {-41.927017211914,-13.217215538025,-246.43304443359, 48764, 2197}},
spawn_yan_h2 = {['af_ah_h2'] = {175.21632385254,2.2580873966217,89.942222595215, 147072, 2213}},
spawn_dt_o1 = {['af_ah_o1'] = {-126.15940856934,-1.9097385406494,123.05704498291, 41994, 1821}},
spawn_dt_e1 = {['af_ah_e1'] = {-266.98266601563,3.8934457302094,167.24801635742, 5398, 1851}},
spawn_dt_e2 = {['af_ah_e2'] = {-242.76332092285,-5.0310530662537,85.509910583496, 12572, 1892}},
spawn_yan_e1 = {['af_ah_e1'] = {88.04581451416,0.9254247546196,-61.850219726563, 108615, 2247}},
spawn_yan_e2 = {['af_ah_e2'] = {89.392547607422,-0.0059276223182678,-7.53919506073, 108333, 2234}},
spawn_yan_g1 = {['af_ah_g1'] = {-0.77743142843246,27.662294387817,-11.827794075012, 68524, 2217}},
spawn_td_o1 = {['af_ah_o1'] = {-6.3827834129333,10.674922943115,-179.35498046875, 161161, 1630}},
spawn_td_o2 = {['af_ah_o2'] = {126.88205718994,2.4974358081818,-483.04809570313, 309930, 1622}},
spawn_td_e1 = {['af_ah_e1'] = {121.47485351563,12.745860099792,-49.468452453613, 302078, 1491}},
spawn_kt_g1 = {['af_ah_g1'] = {-153.09321594238,-8.7200832366943,-94.427383422852, 243570, 5119}},
spawn_kt_o1 = {['af_ah_o1'] = {266.24267578125,21.628379821777,-277.0832824707, 797231, 5207}},
spawn_kt_h1 = {['af_ah_h1'] = {-301.37066650391,16.750459671021,-121.78722381592, 34211, 5263}},
spawn_sv_pda = {['pirogov_pda_item'] = {102.02368164063,-5.1749172210693,156.94705200195, 253604, 645}},
spawn_sv_g1 = {['af_ah_g1'] = {-255.91717529297,4.1241917610168,98.584175109863, 4340, 692}},
spawn_sv_h1 = {['af_ah_h1'] = {106.09580993652,2.1096873283386,-137.30087280273, 237993, 668}},
spawn_mil_h1 = {['af_ah_h1'] = {104.25748443604,-7.7414011955261,167.05085754395, 372272, 2015}},
spawn_mil_g1 = {['af_ah_g1'] = {-157.77574157715,-0.27874371409416,10.363350868225, 154022, 2186}},
spawn_mil_o1 = {['af_ah_o1'] = {-247.53811645508,-17.218084335327,225.62403869629, 81174, 2130}},
spawn_les_pda = {['strelok_pda_item'] = {-76.873001098633,-4.3313798904419,-164.41079711914, 14445, 2792}},
spawn_les_o1 = {['af_ah_o1'] = {219.65069580078,-7.3071460723877,-94.532341003418, 137835, 2773}},
spawn_les_e1 = {['af_ah_e1'] = {-121.0258102417,-5.4002523422241,-42.273204803467, 7481, 2772}},
spawn_lim_s1 = {['af_ah_s1'] = {71.559020996094,11.673633575439,256.08560180664, 58203, 2473}},
spawn_rad_pda = {['chernov_pda_item'] = {662.60522460938,-43.904781341553,171.93785095215, 227308, 2537}},
-- Ñíîðê1
spawn_rad_r1 = {['af_ah_r1'] = {470.09167480469,-47.758029937744,-265.94635009766, 156143, 2690}},
-- Âåðòîëåò
spawn_rad_r2 = {['af_ah_r2'] = {356.06051635742,-39.192668914795,-197.50382995605, 97838, 2723}},
-- Çîìáè 2 êàíîí
spawn_rad_r3 = {['af_ah_r3'] = {551.74591064453,-48.829395294189,-88.514717102051, 191604, 2667}},
spawn_mg_o1 = {['af_ah_o1'] = { -134.83152770996,2.9880950450897,32.194671630859, 55687, 2361}},
spawn_mg_g1 = {['af_ah_g1'] = {159.51693725586,4.3780035972595,-61.599414825439, 234620, 2332}},
spawn_up_g1 = {['af_ah_g1'] = {226.7353515625,12.497895240784,-126.44523620605, 1104135, 4477}},
spawn_up_h1 = {['af_ah_h1'] = {240.87431335449,16.29806137085,-306.95077514648, 1122230, 4477}},
spawn_up_h2 = {['af_ah_h2'] = {82.844253540039,7.2727770805359,19.8655128479, 860122, 4698}},
spawn_up_e1 = {['af_ah_e1'] = {-374.17404174805,5.0997858047485,385.88662719727, 115301, 4581}},
spawn_up_e2 = {['af_ah_e2'] = {-184.40615844727,5.8987579345703,-66.753799438477, 407076, 4539}},
spawn_up_g2 = {['af_ah_g2'] = {-409.46270751953,3.3450148105621,9.6419630050659, 31416, 4523}},
spawn_p_h1 = {['af_ah_h1'] = {136.44596862793,30.190256118774,239.75834655762, 294108, 5045}},
spawn_p_g1 = {['af_ah_g1'] = {73.222862243652,10.05225276947,123.31704711914, 293323, 5045}},
spawn_p_g2 = {['af_ah_g2'] = {-39.609481811523,2.2897946834564,349.08999633789, 59084, 2946}},
spawn_p_e1 = {['af_ah_e1'] = {46.502857208252,-1.7335567474365,-17.505851745605, 159425, 3018}},
spawn_zat_pda = {['vorobushkin_pda_item'] = {-445.25088500977,6.1879630088806,46.998878479004, 117515, 4151}},
spawn_zat_h1 = {['af_ah_h1'] = {-399.41204833984,-6.0142226219177,183.90542602539, 183046, 4398}},
spawn_zat_h2 = {['af_ah_h2'] = {-316.50579833984,32.358577728271,-159.77275085449, 344948, 4158}},
spawn_zat_g1 = {['af_ah_g1'] = {-125.387840271,-7.0910167694092,-225.74705505371, 690469, 4142}},
spawn_zat_g2 = {['af_ah_g2'] = {433.74664306641,34.359256744385,-191.26034545898, 1676984, 4172}},
spawn_zat_o1 = {['af_ah_o1'] = {389.83050537109,0.49227422475815,438.83108520508, 1661766, 4172}},
spawn_gen_f1 = {['af_ah_f1'] = {11.673232078552,38.033100128174,-232.00248718262, 211717, 3505}}
}
----Ñïàâí ôóíêöèÿ ----
local function ah_spawn(name)
local tbl = aditional_spawn_table[name]
for k, v in pairs(tbl) do
for i = 1, (v[6] or 1) do
alife():create(k, vector():set(v[1], v[2], v[3]), v[4], v[5])
end
end
end
function give_simple_detector(first_speaker, second_speaker)
dialogs.relocate_item_section(second_speaker, "detector_simple", "in",1)
end
function give_expert_detector(first_speaker, second_speaker)
dialogs.relocate_item_section(second_speaker, "detector_elite", "in",1)
end
function give_ah_gramota(first_speaker, second_speaker)
dialogs.relocate_item_section(second_speaker, "ah_gramota", "in",1)
end
----Ñîçäàíèå ôðàçû äëÿ ó÷åíûõ, ïî ëèíèþ ñþæåòà----
function create_story_line_phrase()
local ah_level_counter=1
if has_alife_info("ahi_kovalev_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_kovalev_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_chernov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_chernov_6_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_vorobushkin_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_vorobushkin_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
printf("Óðîâåíü_"..ah_level_counter)
if ah_level_counter >= 15 then
give_info("ahi_goto_scabinsky")
printf("Èäåì ê Ñêàáèíñêîìó")
end
return game.translate_string("story_line_dialog_"..ah_level_counter)
end
----Ñîçäàíèå ôðàçû îòâåòà äëÿ ãã, ïî ñþæåòó----
function create_story_line_answer_phrase()
local ah_level_counter=1
if has_alife_info("ahi_kovalev_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_kovalev_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_markov_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_pirogov_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_chernov_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_chernov_6_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_juk_3_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_vorobushkin_1_quest_end") then ah_level_counter = ah_level_counter + 1
end
if has_alife_info("ahi_vorobushkin_2_quest_end") then ah_level_counter = ah_level_counter + 1
end
return game.translate_string("story_line_answer_"..ah_level_counter)
end
--- Ïðîâåðÿåì à â ìîíîëèòå ëè èãðîê ---
function check_community_actor(first_speaker, second_speaker)
return (db.actor:character_community() == "actor_monolith" )
--db.actor "monolith"
--if npc:character_community() ~= "(dolg)" then
-- npc:set_character_community("dolg", 0, 0)
--end
end
function ah_signal(first_speaker, second_speaker)
--- get_console():execute("Òóòòèäó_ÁÈÁÈÁ")
--- local se_obj = get_story_se_object( "kovalev_pda_item" )
--- local stash_id = alun_utils.load_var( db.actor, "kovalev_pda_item_id", nil )
printf("Òóòòèäó_ÁÈÁÈÁ")
news_manager.send_tip(db.actor,"Quest1_title", nil, "seeker", nil, 3000)
end
function redirect_give_quest()
if not has_alife_info("ahi_kovalev_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_kovalev_quest_start")
disable_info("ahi_redirect_kovalev_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_kovalev_quest")
elseif not has_alife_info("ahi_markov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_markov_quest_start")
disable_info("ahi_redirect_markov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_markov_quest")
elseif not has_alife_info("ahi_pirogov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_pirogov_quest_start")
disable_info("ahi_redirect_pirogov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_pirogov_quest")
elseif not has_alife_info("ahi_chernov_6_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_chernov_quest_start")
disable_info("ahi_redirect_chernov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_chernov_quest")
elseif not has_alife_info("ahi_juk_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_juk_quest_start")
disable_info("ahi_redirect_juk_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_juk_quest")
elseif not has_alife_info("ahi_vorobushkin_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_vorobushkin_quest_start")
disable_info("ahi_redirect_vorobushkin_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_vorobushkin_quest")
end
end
function redirect_give_quest_small_revers()
if not has_alife_info("ahi_chernov_6_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_chernov_quest_start")
disable_info("ahi_redirect_chernov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_chernov_quest")
elseif not has_alife_info("ahi_pirogov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_pirogov_quest_start")
disable_info("ahi_redirect_pirogov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_pirogov_quest")
elseif not has_alife_info("ahi_markov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_markov_quest_start")
disable_info("ahi_redirect_markov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_markov_quest")
elseif not has_alife_info("ahi_kovalev_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_kovalev_quest_start")
disable_info("ahi_redirect_kovalev_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_kovalev_quest")
elseif not has_alife_info("ahi_juk_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_juk_quest_start")
disable_info("ahi_redirect_juk_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_juk_quest")
elseif not has_alife_info("ahi_vorobushkin_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_vorobushkin_quest_start")
disable_info("ahi_redirect_vorobushkin_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_vorobushkin_quest")
end
end
function redirect_give_quest_revers()
if not has_alife_info("ahi_vorobushkin_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_vorobushkin_quest_start")
disable_info("ahi_redirect_vorobushkin_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_vorobushkin_quest")
elseif not has_alife_info("ahi_juk_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_juk_quest_start")
disable_info("ahi_redirect_juk_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_juk_quest")
elseif not has_alife_info("ahi_chernov_6_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_chernov_quest_start")
disable_info("ahi_redirect_chernov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_chernov_quest")
elseif not has_alife_info("ahi_pirogov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_pirogov_quest_start")
disable_info("ahi_redirect_pirogov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_pirogov_quest")
elseif not has_alife_info("ahi_markov_3_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_markov_quest_start")
disable_info("ahi_redirect_markov_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_markov_quest")
elseif not has_alife_info("ahi_kovalev_2_quest_end") then
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_kovalev_quest_start")
disable_info("ahi_redirect_kovalev_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_kovalev_quest")
end
end
function redirect_give_quest_skabinsky()
give_info("ahi_redirect_quest_inprogress")
give_info("ahi_redirect_skabinsky_quest_start")
disable_info("ahi_redirect_skabinsky_quest_end")
task_manager.get_task_manager():give_task("ah_redirect_to_skabinsky_quest")
end
function give_fail_quest_skabinsky()
give_info("ahi_redirect_quest_inprogress")
task_manager.get_task_manager():give_task("ah_fail_skabinsky_quest")
end
function ah_fail_timer()
if not has_alife_info("ah_fail_step_1") then
give_info("ah_fail_step_1")
printf("Ïåðâàÿ îøèáêà")
elseif not has_alife_info("ah_fail_step_2") then
give_info("ah_fail_step_2")
printf("Âòîðàÿ îøèáêà")
elseif not has_alife_info("ah_fail_step_3") then
give_info("ah_fail_step_3")
printf("Òðåòüÿ îøèáêà")
end
end
function kovalev_give_quest1()
--- ah_spawn('spawn_bol_o1')
--- ah_spawn('spawn_bol_o2')
--- ah_spawn('spawn_bol_e1')
task_manager.get_task_manager():give_task("ah_kovalev_quest1")
task_manager.get_task_manager():give_task("ah_bol_o1_kovalev_quest1")
task_manager.get_task_manager():give_task("ah_bol_g1_kovalev_quest1")
task_manager.get_task_manager():give_task("ah_bol_e1_kovalev_quest1")
end
function kovalev_give_quest2()
--- ah_spawn('spawn_agr_pda')
--- ah_spawn('spawn_agr_g1')
--- ah_spawn('spawn_agr_g2')
--- ah_spawn('spawn_agr_h1')
task_manager.get_task_manager():give_task("ah_kovalev_quest2")
task_manager.get_task_manager():give_task("ah_agr_pda_kovalev_quest2")
task_manager.get_task_manager():give_task("ah_agr_g1_kovalev_quest2")
task_manager.get_task_manager():give_task("ah_agr_g2_kovalev_quest2")
task_manager.get_task_manager():give_task("ah_agr_h1_kovalev_quest2")
end
function markov_give_quest1()
--- ah_spawn('spawn_yan_o1')
--- ah_spawn('spawn_yan_h1')
--- ah_spawn('spawn_yan_h2')
task_manager.get_task_manager():give_task("ah_markov_quest1")
task_manager.get_task_manager():give_task("ah_yan_o1_markov_quest1")
task_manager.get_task_manager():give_task("ah_yan_h1_markov_quest1")
task_manager.get_task_manager():give_task("ah_yan_g1_markov_quest1")
end
function markov_give_quest2()
--- ah_spawn('spawn_dt_o1')
--- ah_spawn('spawn_dt_e1')
--- ah_spawn('spawn_dt_e2')
task_manager.get_task_manager():give_task("ah_markov_quest2")
task_manager.get_task_manager():give_task("ah_dt_o1_markov_quest2")
task_manager.get_task_manager():give_task("ah_dt_e1_markov_quest2")
task_manager.get_task_manager():give_task("ah_dt_e2_markov_quest2")
end
function markov_give_quest3()
--- ah_spawn('spawn_yan_e1')
--- ah_spawn('spawn_yan_e2')
--- ah_spawn('spawn_yan_g1')
task_manager.get_task_manager():give_task("ah_markov_quest3")
task_manager.get_task_manager():give_task("ah_yan_e1_markov_quest3")
task_manager.get_task_manager():give_task("ah_yan_e2_markov_quest3")
task_manager.get_task_manager():give_task("ah_yan_g1_markov_quest3")
end
function pirogov_give_quest1()
ah_spawn('spawn_td_o1')
--- ah_spawn('spawn_td_o2')
--- ah_spawn('spawn_td_e1')
task_manager.get_task_manager():give_task("ah_pirogov_quest1")
task_manager.get_task_manager():give_task("ah_td_o1_pirogov_quest1")
task_manager.get_task_manager():give_task("ah_td_o2_pirogov_quest1")
task_manager.get_task_manager():give_task("ah_td_e1_pirogov_quest1")
end
function pirogov_give_quest2()
--- ah_spawn('spawn_kt_g1')
--- ah_spawn('spawn_kt_o1')
--- ah_spawn('spawn_kt_h1')
task_manager.get_task_manager():give_task("ah_pirogov_quest2")
task_manager.get_task_manager():give_task("ah_kt_g1_pirogov_quest2")
task_manager.get_task_manager():give_task("ah_kt_o1_pirogov_quest2")
task_manager.get_task_manager():give_task("ah_kt_h1_pirogov_quest2")
end
function pirogov_give_quest3()
--- ah_spawn('spawn_sv_pda')
--- ah_spawn('spawn_sv_g1')
ah_spawn('spawn_sv_h1')
task_manager.get_task_manager():give_task("ah_pirogov_quest3")
task_manager.get_task_manager():give_task("ah_sv_pda_pirogov_quest3")
task_manager.get_task_manager():give_task("ah_sv_g1_pirogov_quest3")
task_manager.get_task_manager():give_task("ah_sv_h1_pirogov_quest3")
end
function chernov_give_quest1()
ah_spawn('spawn_mil_h1')
ah_spawn('spawn_mil_g1')
ah_spawn('spawn_mil_o1')
task_manager.get_task_manager():give_task("ah_chernov_quest1")
task_manager.get_task_manager():give_task("ah_mil_h1_chernov_quest1")
task_manager.get_task_manager():give_task("ah_mil_g1_chernov_quest1")
task_manager.get_task_manager():give_task("ah_mil_o1_chernov_quest1")
end
function chernov_give_quest3()
--- ah_spawn('spawn_les_pda')
--- ah_spawn('spawn_les_o1')
--- ah_spawn('spawn_les_e1')
task_manager.get_task_manager():give_task("ah_chernov_quest3")
task_manager.get_task_manager():give_task("ah_les_pda_chernov_quest3")
task_manager.get_task_manager():give_task("ah_les_o1_chernov_quest3")
task_manager.get_task_manager():give_task("ah_les_e1_chernov_quest3")
end
function chernov_give_quest4()
ah_spawn('spawn_lim_s1')
task_manager.get_task_manager():give_task("ah_chernov_quest4")
end
function chernov_give_quest5()
ah_spawn('spawn_rad_pda')
ah_spawn('spawn_rad_r1')
ah_spawn('spawn_rad_r2')
ah_spawn('spawn_rad_r3')
task_manager.get_task_manager():give_task("ah_chernov_quest5")
task_manager.get_task_manager():give_task("ah_rad_pda_chernov_quest5")
--- task_manager.get_task_manager():give_task("ah_rad_r1_chernov_quest5")
--- task_manager.get_task_manager():give_task("ah_rad_r2_chernov_quest5")
--- task_manager.get_task_manager():give_task("ah_rad_r3_chernov_quest5")
end
function chernov_give_quest6()
--- ah_spawn('spawn_mg_o1')
--- ah_spawn('spawn_mg_g1')
task_manager.get_task_manager():give_task("ah_chernov_quest6")
task_manager.get_task_manager():give_task("ah_mg_o1_chernov_quest6")
task_manager.get_task_manager():give_task("ah_mg_g1_chernov_quest6")
end
function juk_give_quest1()
ah_spawn('spawn_up_g1')
ah_spawn('spawn_up_h1')
ah_spawn('spawn_up_h2')
task_manager.get_task_manager():give_task("ah_juk_quest1")
task_manager.get_task_manager():give_task("ah_up_g1_juk_quest1")
task_manager.get_task_manager():give_task("ah_up_h1_juk_quest1")
task_manager.get_task_manager():give_task("ah_up_h2_juk_quest1")
end
function juk_give_quest2()
ah_spawn('spawn_up_e1')
ah_spawn('spawn_up_e2')
ah_spawn('spawn_up_g2')
task_manager.get_task_manager():give_task("ah_juk_quest2")
task_manager.get_task_manager():give_task("ah_up_e1_juk_quest2")
task_manager.get_task_manager():give_task("ah_up_e2_juk_quest2")
task_manager.get_task_manager():give_task("ah_up_g2_juk_quest2")
end
function juk_give_quest3()
ah_spawn('spawn_p_h1')
ah_spawn('spawn_p_g1')
ah_spawn('spawn_p_g2')
ah_spawn('spawn_p_e1')
task_manager.get_task_manager():give_task("ah_juk_quest3")
task_manager.get_task_manager():give_task("ah_p_h1_juk_quest3")
task_manager.get_task_manager():give_task("ah_p_g1_juk_quest3")
task_manager.get_task_manager():give_task("ah_p_g2_juk_quest3")
task_manager.get_task_manager():give_task("ah_p_e1_juk_quest3")
end
function vorobushkin_give_quest1()
ah_spawn('spawn_zat_pda')
ah_spawn('spawn_zat_h1')
ah_spawn('spawn_zat_h2')
task_manager.get_task_manager():give_task("ah_vorobushkin_quest1")
task_manager.get_task_manager():give_task("ah_zat_pda_vorobushkin_quest1")
task_manager.get_task_manager():give_task("ah_zat_h1_vorobushkin_quest1")
task_manager.get_task_manager():give_task("ah_zat_h2_vorobushkin_quest1")
end
function vorobushkin_give_quest2()
ah_spawn('spawn_zat_g1')
ah_spawn('spawn_zat_o1')
ah_spawn('spawn_zat_g2')
task_manager.get_task_manager():give_task("ah_vorobushkin_quest2")
task_manager.get_task_manager():give_task("ah_zat_g1_vorobushkin_quest2")
task_manager.get_task_manager():give_task("ah_zat_o1_vorobushkin_quest2")
task_manager.get_task_manager():give_task("ah_zat_g2_vorobushkin_quest2")
end
function skabinsky_give_quest1()
--- ah_spawn('spawn_gen_f1')
task_manager.get_task_manager():give_task("ah_skabinsky_quest1")
task_manager.get_task_manager():give_task("ah_gen_f1_skabinsky_quest1")
end
@@ -0,0 +1,88 @@
function kuznecov_find_document_1()
task_manager.get_task_manager():give_task("kuznecov_find_document_1")
end
function is_has_document_agr_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_1_quest_case") ~= nil
end
function transfer_agr_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_1_quest_case")
end
function kuznecov_find_document_2()
task_manager.get_task_manager():give_task("kuznecov_find_document_2")
end
function is_has_document_x18_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_2_lab_x18_documents") ~= nil
end
function transfer_x18_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_2_lab_x18_documents")
end
function kuznecov_find_document_3()
task_manager.get_task_manager():give_task("kuznecov_find_document_3")
end
function turn_off_bra()
task_manager.get_task_manager():give_task("turn_off_brain_scorcher")
end
function is_has_document_x16_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_3_lab_x16_documents") ~= nil
end
function transfer_x16_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_3_lab_x16_documents")
end
function kuznecov_find_document_4()
task_manager.get_task_manager():give_task("kuznecov_find_document_4")
end
function is_has_document_x10_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_4_lab_x10_documents") ~= nil
end
function transfer_x10_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_4_lab_x10_documents")
end
function kuznecov_find_document_5()
task_manager.get_task_manager():give_task("kuznecov_find_document_5")
end
function is_has_document_x8_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_5_lab_x8_documents") ~= nil
end
function transfer_x8_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_5_lab_x8_documents")
end
function kuznecov_find_document_6()
task_manager.get_task_manager():give_task("kuznecov_find_document_6")
end
function is_has_document_jupugr_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_6_jup_ug_documents") ~= nil
end
function transfer_jupugr_document_to_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_6_jup_ug_documents")
end
function kuznecov_find_document_7()
task_manager.get_task_manager():give_task("kuznecov_find_document_7")
end
function is_has_document_contrbunker_kuznec(first_speaker, second_speaker)
return first_speaker:object("main_story_7_mon_con_documents") ~= nil
end
function transfer_document_contrbunker_kuznec(first_speaker, second_speaker)
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "main_story_7_mon_con_documents")
end
@@ -0,0 +1,464 @@
--[[
Storyline: Hidden Threat
Version: 1.0
Autor: Longreed
Last Edit: 06/12/2021
]]--
------------------------- Полковник Кузнецов ---------------------------
--- D1 Phrase first ---
function get_phrase_dialog_kuznetsov_d1_first(first_speaker, second_speaker)
if not has_alife_info ("dialog_kuznetsov_first_flag") then
local phrase = game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d1_first_1")
return strformat(phrase, utils_slht.actor_name())
end
return game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d1_2_1")
end
--- D1 Phrase 1 ---
function get_phrase_dialog_kuznetsov_d1_1(first_speaker, second_speaker)
local phrase = game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d1_1_1")
if not has_alife_info ("dialog_kuznetsov_7_flag") then
local path = game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d1_1_0")
phrase = path .. " " .. phrase
end
return phrase or "Error! Phrase 1: none"
end
--- D1 Phrase 7 ---
function precond_dialog_kuznetsov_d1_7(first_speaker, second_speaker)
if has_alife_info ("dialog_kuznetsov_4_flag") or
has_alife_info ("dialog_kuznetsov_5_flag") or
has_alife_info ("dialog_kuznetsov_6_flag") then return true end
return false
end
--- D4 Phrase first ---
function get_phrase_dialog_kuznetsov_d4_first(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_task_2_start") and
not has_alife_info ("hidden_threat_task_2_complete") then
return game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d4_first_1")
end
return game.translate_string("st_sl_hidden_threat_dialog_kuznetsov_d4_first_2")
end
--- D4 Phrase 1 ---
function postcond_dialog_kuznetsov_d4_1(first_speaker, second_speaker)
if utils_slht.reward_table and utils_slht.reward_table["Task2Reward"] then
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, utils_slht.reward_table["Task2Reward"], 1)
end
end
--- D4 Phrase 2 ---
function precond_dialog_kuznetsov_d4_2(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_task_2_start") and
not has_alife_info ("hidden_threat_task_2_complete") then
return false
end
return true
end
--- D5 Phrase first ---
function precond_dialog_kuznetsov_d5_first(first_speaker, second_speaker)
if db.actor:object("isg_patch") then return true end
return false
end
--- D5 Phrase 2 ---
function postcond_dialog_kuznetsov_d5_2(first_speaker, second_speaker)
if db.actor:object("isg_patch") then
xr_effects.remove_item(first_speaker, second_speaker,{"isg_patch"})
end
end
--- D5 Phrase 3 ---
function postcond_dialog_kuznetsov_d5_3(first_speaker, second_speaker)
if utils_slht.reward_table and utils_slht.reward_table["Task3Reward"] then
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, utils_slht.reward_table["Task3Reward"], 1)
end
end
--- D6 Phrase first ---
function precond_dialog_kuznetsov_d6_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_usb_quest_task_4") then return true end
return false
end
--- D6 Phrase 1 ---
function postcond_dialog_kuznetsov_d6_1(first_speaker, second_speaker)
if db.actor:object("sl_ht_usb_quest_task_4") then
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_usb_quest_task_4"})
end
end
-------------------------- Выживший сталкер ----------------------------
--- Phrase 2 ---
function get_phrase_dialog_survived_2(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_second_task_1_complete") then
return game.translate_string("st_sl_hidden_threat_dialog_survived_2_2")
end
return game.translate_string("st_sl_hidden_threat_dialog_survived_2_1")
end
--- Phrase 3 ---
function get_phrase_dialog_survived_3(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_second_task_1_complete") then
return game.translate_string("st_sl_hidden_threat_dialog_survived_3_2")
end
return game.translate_string("st_sl_hidden_threat_dialog_survived_3_1")
end
-------------------------- Лейтенант Ложкин ----------------------------
--- D1 Phrase first ---
function postcond_dialog_spooner_d1_first(first_speaker, second_speaker)
local descr = game.translate_string("st_sl_hidden_threat_second_task_1_stage_0_title")
local icon = "ui_iconsTotal_storyline"
db.actor:give_talk_message2(descr, "", icon, "iconed_answer_item")
end
--- D2 Phrase first ---
function get_phrase_dialog_spooner_d2_first(first_speaker, second_speaker)
if has_alife_info ("dialog_spooner_outfit_flag") then
return game.translate_string("st_sl_hidden_threat_dialog_spooner_d2_first_2")
end
return game.translate_string("st_sl_hidden_threat_dialog_spooner_d2_first_1")
end
--- D2 Phrase 1 ---
function get_phrase_dialog_spooner_d2_1(first_speaker, second_speaker)
local phrase = game.translate_string("st_sl_hidden_threat_dialog_spooner_d2_1_1")
return strformat(phrase, utils_slht.actor_name()) or "Error! Phrase 1: none"
end
function postcond_dialog_spooner_d2_1(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "helm_tactic", 1)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "specops_outfit", 1)
end
--- D2 Phrase 3 ---
function postcond_dialog_spooner_d2_3(first_speaker, second_speaker)
local descr = game.translate_string("st_sl_hidden_threat_second_task_2_stage_0_title")
local icon = "ui_iconsTotal_storyline"
db.actor:give_talk_message2(descr, "", icon, "iconed_answer_item")
end
--- D3 Phrase first ---
function precond_dialog_spooner_d3_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_spooner_quest_package") or
has_alife_info ("hidden_threat_second_task_2_complete") then
return true
end
return false
end
function get_phrase_dialog_spooner_d3_first(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_second_task_2_complete") then
return game.translate_string("st_sl_hidden_threat_dialog_spooner_d3_first_2")
end
return game.translate_string("st_sl_hidden_threat_dialog_spooner_d3_first_1")
end
--- D3 Phrase 1 ---
function postcond_dialog_spooner_d3_1(first_speaker, second_speaker)
if db.actor:object("sl_ht_spooner_quest_package") then
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_spooner_quest_package"})
db.actor:give_info_portion ("hidden_threat_second_task_2_complete")
end
end
--- D3 Phrase 3 ---
function postcond_dialog_spooner_d3_3(first_speaker, second_speaker)
local title = game.translate_string("st_sl_hidden_threat_spooner_notes_title")
local descr = game.translate_string("st_sl_hidden_threat_spooner_notes_descr")
local icon = "ui_icon_news_trx_common"
db.actor:give_talk_message2(title, descr, icon, "iconed_answer_item")
SendScriptCallback("actor_on_interaction", "notes", nil, "note_from_spooner")
end
--- D4 Phrase first ---
function precond_dialog_spooner_d4_first(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_all")
end
--- D4 Phrase 2 ---
function precond_dialog_spooner_d4_2(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_1")
end
function postcond_dialog_spooner_d4_2(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_1")
end
--- D4 Phrase 3 ---
function precond_dialog_spooner_d4_3(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_2")
end
function postcond_dialog_spooner_d4_3(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_2")
end
--- D4 Phrase 4 ---
function precond_dialog_spooner_d4_4(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_3")
end
function postcond_dialog_spooner_d4_4(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_3")
end
--- D4 Phrase 5 ---
function precond_dialog_spooner_d4_5(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_4")
end
function postcond_dialog_spooner_d4_5(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_4")
end
--- D4 Phrase 6 ---
function precond_dialog_spooner_d4_6(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_5")
end
function postcond_dialog_spooner_d4_6(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_5")
end
--- D4 Phrase 7 ---
function precond_dialog_spooner_d4_7(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_6")
end
function postcond_dialog_spooner_d4_7(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_6")
end
--- D4 Phrase 8 ---
function precond_dialog_spooner_d4_8(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_7")
end
function postcond_dialog_spooner_d4_8(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_7")
end
--- D4 Phrase 9 ---
function precond_dialog_spooner_d4_9(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_8")
end
function postcond_dialog_spooner_d4_9(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_8")
end
--- D4 Phrase 10 ---
function precond_dialog_spooner_d4_10(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_9")
end
function postcond_dialog_spooner_d4_10(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_9")
end
--- D4 Phrase 11 ---
function precond_dialog_spooner_d4_11(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_10")
end
function postcond_dialog_spooner_d4_11(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_10")
end
--- D4 Phrase 12 ---
function precond_dialog_spooner_d4_12(first_speaker, second_speaker)
return utils_slht.check_ammo_with_actor("ammo_11")
end
function postcond_dialog_spooner_d4_12(first_speaker, second_speaker)
utils_slht.exchange_ammo_with_actor(first_speaker, second_speaker, "ammo_11")
end
---------------------------- Майор Журов -------------------------------
--- Phrase first ---
function precond_dialog_jurov_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_accounting_report") then return true end
return false
end
--- Phrase 1 ---
function get_phrase_dialog_jurov_1(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_task_1_stage_2") or
has_alife_info ("hidden_threat_task_1_stage_3") then
return game.translate_string("st_sl_hidden_threat_dialog_jurov_1_2")
end
return game.translate_string("st_sl_hidden_threat_dialog_jurov_1_1")
end
function postcond_dialog_jurov_1(first_speaker, second_speaker)
if db.actor:object("sl_ht_accounting_report") then
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_accounting_report"})
end
if has_alife_info ("hidden_threat_task_1_stage_2") or
has_alife_info ("hidden_threat_task_1_stage_3") then
postcond_dialog_jurov_3(first_speaker, second_speaker)
db.actor:give_info_portion("hidden_threat_second_task_1_complete")
end
end
--- Phrase 3 ---
function postcond_dialog_jurov_3(first_speaker, second_speaker)
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 2500)
end
--- Phrase 4 ---
function postcond_dialog_jurov_4(first_speaker, second_speaker)
utils_slht.bribe_exclusive_2_hours_stalker()
end
--- Phrase 5 ---
function precond_dialog_jurov_5(first_speaker, second_speaker)
if has_alife_info ("hidden_threat_second_task_1_complete") or
has_alife_info ("hidden_threat_task_1_stage_2") or
has_alife_info ("hidden_threat_task_1_stage_3") then
return true
end
return false
end
-------------------- Ст.лейтенант Кириллов -----------------------------
--- D1 Phrase 1 ---
function postcond_dialog_kirillov_d1_1(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sl_ht_walkie_talkie", 1)
end
--- D2 Phrase first ---
function precond_dialog_kirillov_d2_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_pda_isg_leader") then return true end
return false
end
--- D2 Phrase 1 ---
function postcond_dialog_kirillov_d2_1(first_speaker, second_speaker)
if db.actor:object("sl_ht_pda_isg_leader") then
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_pda_isg_leader"})
end
end
--- D3 Phrase 1 ---
function postcond_dialog_kirillov_d3_1(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sl_ht_usb_quest_task_4", 1)
end
-------------- Рандомный командир(Темная долина) -----------------------
--- Phrase first ---
function precond_dialog_val_leader_squad_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_walkie_talkie") then return true end
return false
end
--- Phrase 2 ---
function postcond_dialog_val_leader_squad_2(first_speaker, second_speaker)
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_walkie_talkie"})
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 2500)
end
---------------- Полковник Дегтярёв(Агропром) --------------------------
--- D2 Phrase first ---
function precond_dialog_degtyarev_d2_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_case_quest_task_5") then return true end
return false
end
--- D2 Phrase 2 ---
function postcond_dialog_degtyarev_d2(first_speaker, second_speaker)
if db.actor:object("sl_ht_case_quest_task_5") then
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "sl_ht_case_quest_task_5")
end
if utils_slht.reward_table and utils_slht.reward_table["Task5Reward"] then
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, utils_slht.reward_table["Task5Reward"], 1)
end
end
--- D3 Phrase first ---
function precond_dialog_degtyarev_d3_first(first_speaker, second_speaker)
if has_alife_info("dialog_degtyarev_1_flag") and
has_alife_info("dialog_degtyarev_2_flag") and
has_alife_info("dialog_degtyarev_3_flag") then return false end
return true
end
--- D4 Phrase first ---
function get_phrase_dialog_degtyarev_d4_first(first_speaker, second_speaker)
local phrase = game.translate_string("st_sl_hidden_threat_dialog_degtyarev_d4_first_1")
return strformat(phrase, utils_slht.actor_name()) or "Error! Phrase first: none"
end
--- D4 Phrase 3 ---
function get_phrase_dialog_degtyarev_d4_3(first_speaker, second_speaker)
if not has_alife_info("dialog_degtyarev_5_flag") then
return game.translate_string("st_sl_hidden_threat_dialog_degtyarev_d4_3_1")
end
return game.translate_string("st_sl_hidden_threat_dialog_degtyarev_d4_3_2")
end
--- D4 Phrase 5 ---
function postcond_dialog_degtyarev_d4_5(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sl_ht_voice_recorder_task_6", 1)
end
--- D5 Phrase first ---
function precond_dialog_degtyarev_d5_first(first_speaker, second_speaker)
if db.actor:object("sl_ht_voice_recorder_task_6") then return true end
return false
end
--- D5 Phrase 1 ---
function postcond_dialog_degtyarev_d5_1(first_speaker, second_speaker)
if db.actor:object("sl_ht_voice_recorder_task_6") then
xr_effects.remove_item(first_speaker, second_speaker,{"sl_ht_voice_recorder_task_6"})
end
end
--- D6 Phrase first ---
function precond_dialog_degtyarev_d6_first(first_speaker, second_speaker)
if has_alife_info("aes2_monolith_camp_1_isg_squad_death") and
has_alife_info("aes2_monolith_camp_2_isg_squad_death") then return true end
return false
end
----------------- Майор Верещагин(Агропром) ----------------------------
--- D2 Phrase first ---
function precond_dialog_vereshagin_d2_first(first_speaker, second_speaker)
if
has_alife_info("pas_b400_fake_isg_squad_death")
and has_alife_info("pas_b400_elevator_isg_squad_death")
and has_alife_info("pas_b400_track_isg_squad_death")
and has_alife_info("pas_b400_tunnel_isg_squad_death")
and has_alife_info("pas_b400_hall_isg_squad_death")
and has_alife_info("pas_b400_hall_isg_leader_squad_death")
-- and has_alife_info("pas_b400_hall_isg_sniper_squad_death")
then
return true
end
return false
end
--- D2 Phrase 1 ---
function postcond_dialog_vereshagin_d2_1(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "wpn_pkm_zulus", 1)
end
---------------------- Общие фразы -------------------------------------
--- Ph1 ---
function get_phrase_dialog_all_1(first_speaker, second_speaker)
return game.translate_string("st_sl_hidden_threat_dialog_all_1_" ..
tostring(math.random(1,4))) or "Error! Phrase All 1: none"
end
--- Ph2 ---
function get_phrase_dialog_all_2(first_speaker, second_speaker)
return game.translate_string("st_sl_hidden_threat_dialog_all_2_" ..
tostring(math.random(1,3))) or "Error! Phrase All 2: none"
end
@@ -0,0 +1,33 @@
ads_npcs = {
["ah_sarik"] = 1,
["ah_bol_kovalev"] = 1,
["ah_yan_markov"] = 1,
["ah_dark_pirogov"] = 1,
["ah_mil_chernov"] = 1,
["ah_up_juk"] = 1,
["ah_zat_vorobushkin"] = 1,
["ah_aes_skabinsky"] = 1,
["ah_aes_skabinsky_final"] = 1,
["dragun"] = 1,
["brodyaga"] = 1,
["gamajun"] = 1,
["kvartet"] = 1,
["vasil_nevezuchi"] = 1,
}
function npc_on_before_hit(npc,shit,bone_id,flags)
local sec = npc:section()
if ads_npcs[sec] == 1 then
if shit.draftsman:id() == db.actor:id() and game_relations.is_factions_enemies(get_actor_true_community(), character_community(npc)) then
-- shit.power = shit.power
elseif shit.draftsman:id() == db.actor:id() then
shit.power = shit.power * 0.01
else
shit.power = 0
end
end
end
function on_game_start()
RegisterScriptCallback("npc_on_before_hit",npc_on_before_hit)
end
@@ -0,0 +1,226 @@
--[[
Storyline: Hidden Threat
Version: 1.0
Autor: Longreed
Last Edit: 21/12/2021
]]--
------------------------- Variables ---------------------------------------------
local uptime = 5
local cond_rank = 1000
---------------------------------------------------------------------------------
local function hidden_threat_update()
ResetTimeEvent("cycle","stht_update",uptime)
if not has_alife_info ("hidden_threat_disabled") then
if not utils_slht.valid_faction_actor() then
db.actor:give_info_portion("hidden_threat_disabled")
end
if utils_slht.debug_mode == true then cond_rank = 0 end
if not has_alife_info ("hidden_threat_start") and
db.actor:character_rank() >= cond_rank then
utils_slht.HTCreateNews("kuznetsov", "st_sl_hidden_threat_msg_start", 0, true, true)
db.actor:give_info_portion("hidden_threat_start")
end
else
RemoveTimeEvent("cycle","stht_update")
end
end
local function actor_on_info_callback(actor,info,obj)
if info == "hidden_threat_task_1_complete" then
utils_slht.HTCreateTimeEvent("TimeEventTask3Msg",7200, hidden_threat.sl_hidden_threat_init_task_2)
elseif info == "hidden_threat_task_3_complete" then
utils_slht.HTCreateTimeEvent("TimeEventTask4Msg",60, hidden_threat.sl_hidden_threat_init_task_4)
elseif info == "hidden_threat_task_4_stage_5" then
utils_slht.HTCreateTimeEvent("TimeEventTask4Stg6Msg", 86400, hidden_threat.sl_hidden_threat_task_4_act_6_msg)
elseif info == "hidden_threat_task_4_complete" then
utils_slht.HTCreateTimeEvent("TimeEventTask5Msg", 60, hidden_threat.sl_hidden_threat_init_task_5)
elseif info == "hidden_threat_task_5_complete" then
utils_slht.HTCreateTimeEvent("TimeEventTask6Msg", 14400, hidden_threat.sl_hidden_threat_init_task_6)
elseif info == "hidden_threat_task_6_stage_2" then
utils_slht.HTCreateTimeEvent("TimeEventTask6Stg2", 172800, hidden_threat.sl_hidden_threat_task_6_act_3)
elseif info == "hidden_threat_task_6_complete" then
utils_slht.HTCreateTimeEvent("TimeEventTask7Msg", 10800, hidden_threat.sl_hidden_threat_init_task_7)
elseif info == "hidden_threat_complete" then
xr_effects.ht_run_postprocess(nil,nil,{"fade_in_out"})
if xr_conditions.squad_exist(nil,nil, {"agr_1_6_ht_vereshagin_squad"}) then
xr_effects.remove_squad(nil,nil,{"agr_1_6_ht_vereshagin_squad"})
end
db.actor:give_info_portion("hidden_threat_disabled")
end
end
------------------------------- Tasks ----------------------------------
local msg
--- Task 1 ---
function sl_hidden_threat_task_1()
if not has_alife_info ("hidden_threat_task_1_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_1")
db.actor:give_info_portion("hidden_threat_task_1_start")
end
end
--- Task 2 ---
function sl_hidden_threat_init_task_2()
if has_alife_info("bar_deactivate_radar_done") then
msg = "st_sl_hidden_threat_msg_task_3_start"
else
msg = "st_sl_hidden_threat_msg_task_2_start"
utils_slht.HTCreateTimeEvent("TimeEventTask3",10, hidden_threat.sl_hidden_threat_task_2)
end
utils_slht.HTCreateNews("kuznetsov", msg, 0, true, true)
db.actor:give_info_portion("hidden_threat_task_3_msg")
end
function sl_hidden_threat_task_2()
if not has_alife_info ("hidden_threat_task_2_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_2")
db.actor:give_info_portion("hidden_threat_task_2_start")
utils_slht.create_reward("Task2Reward", "item_outfit_attach")
end
end
--- Task 3 ---
function sl_hidden_threat_task_3()
if not has_alife_info ("hidden_threat_task_3_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_3")
db.actor:give_info_portion("hidden_threat_task_3_start")
utils_slht.create_reward("Task3Reward", "item_artifacts_container_2")
end
end
--- Task 4 ---
function sl_hidden_threat_init_task_4()
msg = "st_sl_hidden_threat_msg_task_4_start"
utils_slht.HTCreateNews("kirillov", msg, 0, true, true)
utils_slht.HTCreateTimeEvent("TimeEventTask4",5, hidden_threat.sl_hidden_threat_task_4)
db.actor:give_info_portion("hidden_threat_task_4_msg")
end
function sl_hidden_threat_task_4()
if not has_alife_info ("hidden_threat_task_4_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_4")
db.actor:give_info_portion("hidden_threat_task_4_start")
end
end
function sl_hidden_threat_task_4_act_6_msg()
msg = "st_sl_hidden_threat_msg_task_4_stg_6_msg"
utils_slht.HTCreateNews("kirillov", msg, 0, true, true)
utils_slht.HTCreateTimeEvent("TimeEventTask4",5, hidden_threat.sl_hidden_threat_task_4_act_6)
db.actor:give_info_portion("hidden_threat_task_4_stage_6_msg")
end
function sl_hidden_threat_task_4_act_6()
db.actor:give_info_portion("hidden_threat_task_4_stage_6")
end
--- Task 5 ---
function sl_hidden_threat_init_task_5()
msg = "st_sl_hidden_threat_msg_task_5_start"
utils_slht.HTCreateNews("gorobez", msg, 0, true, true)
utils_slht.HTCreateTimeEvent("TimeEventTask5",5, hidden_threat.sl_hidden_threat_task_5)
db.actor:give_info_portion("hidden_threat_task_5_msg")
end
function sl_hidden_threat_task_5()
if not has_alife_info ("hidden_threat_task_5_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_5")
db.actor:give_info_portion("hidden_threat_task_5_start")
utils_slht.create_reward("Task5Reward", "item_outfit_plate")
end
end
--- Task 6 ---
function sl_hidden_threat_init_task_6()
msg = "st_sl_hidden_threat_msg_task_6_start"
utils_slht.HTCreateNews("degtyarev", msg, 0, true, true)
utils_slht.HTCreateTimeEvent("TimeEventTask6",5, hidden_threat.sl_hidden_threat_task_6)
db.actor:give_info_portion("hidden_threat_task_6_msg")
end
function sl_hidden_threat_task_6()
if not has_alife_info ("hidden_threat_task_6_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_6")
db.actor:give_info_portion("hidden_threat_task_6_start")
end
end
function sl_hidden_threat_task_6_act_3()
db.actor:give_info_portion("hidden_threat_task_6_stage_3")
end
--- Task 7 ---
function sl_hidden_threat_init_task_7()
msg = "st_sl_hidden_threat_msg_task_7_start"
utils_slht.HTCreateNews("kuznetsov", msg, 0, true, true)
utils_slht.HTCreateTimeEvent("TimeEventTask7",5, hidden_threat.sl_hidden_threat_task_7)
db.actor:give_info_portion("hidden_threat_task_7_msg")
end
function sl_hidden_threat_task_7()
if not has_alife_info ("hidden_threat_task_7_start") then
task_manager.get_task_manager():give_task("sl_hidden_threat_task_7")
db.actor:give_info_portion("hidden_threat_task_7_start")
end
end
--- Second Task 1 ---
function sl_hidden_threat_second_task_1(first_speaker, second_speaker)
dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sl_ht_accounting_report", 1)
task_manager.get_task_manager():give_task("sl_hidden_threat_second_task_1")
end
--- Second Task 2 ---
function sl_hidden_threat_second_task_2(first_speaker, second_speaker)
task_manager.get_task_manager():give_task("sl_hidden_threat_second_task_2")
end
------------------------------- Callbacks ----------------------------------
local function actor_on_first_update()
if not utils_slht.valid_faction_actor() and not has_alife_info("hidden_threat_disabled") then
db.actor:give_info_portion("hidden_threat_disabled")
printf("![SLHT] Storyline | Hidden Threat : disabled")
else
if has_alife_info("hidden_threat_disabled") and
not has_alife_info("hidden_threat_complete") then
printf("![SLHT] Storyline | Hidden Threat : disabled")
else
printf("-[SLHT] Storyline | Hidden Threat : enabled")
CreateTimeEvent("cycle","stht_update", uptime, hidden_threat_update )
end
end
end
function on_game_start()
RegisterScriptCallback("actor_on_info_callback", actor_on_info_callback)
RegisterScriptCallback("actor_on_first_update", actor_on_first_update)
end
@@ -0,0 +1,380 @@
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
@@ -0,0 +1,434 @@
--[[
Storyline: Hidden Threat
Version: 1.0
Autor: Longreed
Last Edit: 01/11/2021
]]--
------------------------- Variables ---------------------------------------------
local stage_status_f = {}
local campfire_flag = nil
------------------------- Функтор TARGET ----------------------------------------
task_functor.hidden_threat_functor_target = function(task_id,field,p,tsk)
if not (tsk or tsk.stage) then return nil end
local sec = tostring(task_id) .. "_" .. tostring(tsk.stage)
local target_task = utils_slht.task_table:r_string_ex(sec,"target") or ""
local target_type = utils_slht.task_table:r_string_ex(sec,"target_type") or ""
local targets_map_spot = {}
local str = utils_slht.task_table:r_string_ex(sec,"enemy_map_spot") or ""
if str ~= "" then targets_map_spot = str_explode(str,",") end
if (target_type == "smart") then
local smart = SIMBOARD.smarts_by_names[target_task]
if smart then return smart and smart.id end
elseif (target_type == "squad") then
local squad = get_story_squad(target_task)
if squad then return squad and squad.id end
elseif (target_type == "item") then
local item = get_story_se_item(target_task)
if item then return item.id end
elseif (target_type == "map_spot") then
if targets_map_spot then utils_slht.set_enemy_map_spot(targets_map_spot) end
elseif (target_type == "restr") then
local restr = get_story_se_object(target_task)
if restr then return restr and restr.id or nil end
end
return nil
end
------------------------- Функтор TITLE/DESCR -----------------------------------
task_functor.hidden_threat_functor_string = function(task_id,field,p,tsk)
if not (tsk) then return end
local str, str_path
if (field == "title") then str_path = "_title"
elseif (field == "descr") then str_path = "_descr" end
str = "st_" .. tostring(task_id) .. "_stage_" .. tostring(tsk.stage) .. str_path
return game.translate_string(str) or ""
end
------------------------- Функтор STATUS ----------------------------------------
task_status_functor.hidden_threat_functor_status = function(tsk,task_id)
if not (tsk) then return end
local ret = stage_status_f[tsk.stage] and stage_status_f[tsk.stage](task_id) or tsk.stage
if tonumber(ret) then
tsk.stage = ret
else
return ret
end
end
--- Stage first ---
stage_status_f[0] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if has_alife_info ("hidden_threat_task_1_stage_1") then
xr_effects.create_squad(nil,nil,{"esc_survived_stalker_squad", "esc_smart_terrain_5_7"})
return 1
end
--- Task 3 ---
elseif (task_id == "sl_hidden_threat_task_3") then
if utils_slht.actor_in_smart("jup_b47", 10) then
xr_effects.create_squad(nil,nil,{"jup_b8_army_dead_squad", "jup_b8_smart_terrain"})
if xr_conditions.squad_exist(nil,nil, {"jup_b8_psy_dog_squad"}) then
xr_effects.kill_squad(nil,nil,{"jup_b8_psy_dog_squad"})
end
return 1
end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if has_alife_info ("dialog_kirillov_1_flag") then
xr_effects.clear_smart_terrain(nil,nil,{"val_smart_terrain_1_2","true"})
xr_effects.create_squad(nil,nil,{"val_1_2_army_defense_squad", "val_smart_terrain_1_2"})
return 1
end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if has_alife_info("pri_a17_prisoner") then return 1 end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("dialog_degtyarev_4_flag") then
utils_slht.cit_spawn_ph_radio()
return 1
end
--- Task 7 ---
elseif (task_id == "sl_hidden_threat_task_7") then
if has_alife_info("hidden_threat_task_7_stage_1") then return 1 end
--- Second Task 2 ---
elseif (task_id == "sl_hidden_threat_second_task_2") then
if db.actor:object("sl_ht_spooner_quest_package") then
db.actor:give_info_portion("hidden_threat_second_task_2_box")
return 1
end
end
return 0
end
--- Stage 1 ---
stage_status_f[1] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if has_alife_info("hidden_threat_task_1_stage_3") then
xr_effects.clear_smart_terrain(nil,nil,{"ds2_domik_st","true"})
return 3
elseif has_alife_info("esc_survived_stalker_squad_death") then
db.actor:give_info_portion("hidden_threat_task_1_stage_2")
return 2
end
--- Task 3 ---
elseif (task_id == "sl_hidden_threat_task_3") then
if xr_conditions.actor_in_zone(db.actor,nil,{"jup_a9_cam_2"}) then
if not xr_conditions.squad_exist(nil,nil, {"jup_b8_isg_attack_squad"}) then
xr_effects.create_squad(nil,nil,{"jup_b8_isg_attack_squad", "jup_b8_smart_terrain"})
end
end
if has_alife_info ("jup_b8_isg_attack_squad_death") then
return 2
end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if has_alife_info ("val_1_2_army_combat") then
utils_slht.val_1_2_attack_msg_sound()
xr_effects.clear_smart_terrain(nil,nil,{"val_smart_terrain_8_7","true"})
xr_effects.clear_smart_terrain(nil,nil,{"val_smart_terrain_9_6","true"})
xr_effects.create_squad(nil,nil,{"val_1_2_attack_isg_squad", "val_smart_terrain_1_2"})
return 2
end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if has_alife_info("hidden_threat_task_5_stage_2") then
xr_effects.clear_smart_terrain(nil,nil,{"pri_b35_military","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pri_sim_5","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pri_b305_dogs","true"})
xr_effects.create_squad(nil,nil,{"pri_b35_military_isg_sniper_squad", "pri_b35_military"})
xr_effects.create_squad(nil,nil,{"pri_b35_military_isg_guard_squad", "pri_b35_military"})
return 2
end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("hidden_threat_task_6_stage_2") then return 2 end
--- Task 7 ---
elseif (task_id == "sl_hidden_threat_task_7") then
if has_alife_info("hidden_threat_task_7_stage_2") then
xr_effects.clear_smart_terrain(nil,nil,{"pri_a15","true"})
xr_effects.clear_smart_terrain(nil,nil,{"jup_b208","true"})
xr_effects.create_squad(nil,nil,{"pri_a15_ht_sbu_squad", "pri_a15"})
xr_effects.create_squad(nil,nil,{"jup_b208_ht_sbu_squad", "jup_b208"})
xr_effects.create_squad(nil,nil,{"jup_b208_ht_sbu_agent_squad", "jup_b208"})
if not txr_routes.is_route_discovered("jup","jup_u") then
txr_routes.open_route("jup","jup_u",true)
end
return 2
end
--- Second Task 2 ---
elseif (task_id == "sl_hidden_threat_second_task_2") then
if has_alife_info("hidden_threat_second_task_2_box") and
not db.actor:object("sl_ht_spooner_quest_package") then return 0 end
if has_alife_info("hidden_threat_second_task_2_complete") then return "complete" end
end
return 1
end
--- Stage 2 ---
stage_status_f[2] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if has_alife_info("hidden_threat_task_1_stage_3") then
xr_effects.clear_smart_terrain(nil,nil,{"ds2_domik_st","true"})
return 3
end
--- Task 3 ---
elseif (task_id == "sl_hidden_threat_task_3") then
if db.actor:object("isg_patch") then return 3 end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if has_alife_info("val_1_2_attack_isg_squad_death") then return 3 end
if db.actor:object("sl_ht_pda_isg_leader") then return 4 end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if utils_slht.actor_in_smart("pri_b35_military", 100) and
not has_alife_info("pri_b35_mercs_spawn_scene") then
xr_effects.clear_smart_terrain(nil,nil,{"pri_b35_mercs","true"})
xr_effects.create_squad(nil,nil,{"pri_b35_mercs_ht_degtyarev_squad", "pri_b35_mercs"})
xr_effects.create_squad(nil,nil,{"pri_b35_mercs_ht_strelok_squad", "pri_b35_mercs"})
xr_effects.create_squad(nil,nil,{"pri_b35_mercs_ht_agents_sbu_squad", "pri_b35_mercs"})
xr_effects.create_squad(nil,nil,{"pri_b35_mercs_ht_isg_squad", "pri_b35_mercs"})
db.actor:give_info_portion("pri_b35_mercs_spawn_scene")
end
if has_alife_info("pri_b35_mercs_ht_degtyarev_squad_death") then
return "fail"
end
if has_alife_info("pri_b35_military_isg_sniper_squad_death") then
return 3
end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("hidden_threat_task_6_stage_3") then return 3 end
--- Task 7 ---
elseif (task_id == "sl_hidden_threat_task_7") then
if has_alife_info("hidden_threat_task_7_stage_3") then
xr_effects.ht_run_postprocess(nil,nil,{"fade_out"})
xr_effects.setup_companion_task(nil,nil,{"jup_ht_companion_army_squad","jup_b208"})
if xr_conditions.squad_exist(nil,nil, {"jup_b208_ht_sbu_agent_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_b208_ht_sbu_agent_squad"})
end
return 3
end
end
return 2
end
--- Stage 3 ---
stage_status_f[3] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if has_alife_info("ds2_domik_st_ht_cut_scene_start") then
if xr_conditions.squad_exist(nil,nil, {"esc_survived_stalker_squad"}) then
xr_effects.remove_squad(nil,nil,{"esc_survived_stalker_squad"})
end
return 4
end
--- Task 3 ---
elseif (task_id == "sl_hidden_threat_task_3") then
if not db.actor:object("isg_patch") then return 2 end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if db.actor:object("sl_ht_pda_isg_leader") then return 4 end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if has_alife_info("pri_b35_mercs_ht_isg_squad_death") then
return 4
end
if has_alife_info("pri_b35_mercs_ht_degtyarev_squad_death") then
return "fail"
end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if db.actor:object("sl_ht_voice_recorder_task_6") then return 4 end
--- Task 7 ---
elseif (task_id == "sl_hidden_threat_task_7") then
if not has_alife_info("ht_jupiter_und_spawn_1") then
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_fake","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_elevator","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_track","true"})
xr_effects.create_squad(nil,nil,{"pas_b400_fake_isg_squad", "pas_b400_fake"})
xr_effects.create_squad(nil,nil,{"pas_b400_elevator_isg_squad", "pas_b400_elevator"})
xr_effects.create_squad(nil,nil,{"pas_b400_track_isg_squad", "pas_b400_track"})
db.actor:give_info_portion("ht_jupiter_und_spawn_1")
end
if level.name() == "jupiter_underground" then return 4 end
end
return 3
end
--- Stage 4 ---
stage_status_f[4] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if not has_alife_info ("ds2_domik_st_ht_cut_scene_end") then
if has_alife_info("ds2_domik_st_ht_cut_scene_2_flag") and
not has_alife_info("ds2_domik_st_ht_cut_scene_3_flag") then
utils_slht.map_spot_campfire("ds2_domik_st", true)
end
else
utils_slht.map_spot_campfire("ds2_domik_st", false)
return 5
end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if has_alife_info("hidden_threat_task_4_stage_5") then return 5 end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if has_alife_info("pri_b35_mercs_ht_degtyarev_squad_death") then
return "fail"
end
if has_alife_info("hidden_threat_task_5_stage_5") then
utils_slht.pri_b304_spawn_agent_case()
return 5
end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("hidden_threat_task_6_stage_5") then
xr_effects.ht_alife_release_object(nil,nil,{"cit_ht_ph_quest_radio"})
xr_effects.clear_smart_terrain(nil,nil,{"aes_smart_terran_soldier","true"})
xr_effects.clear_smart_terrain(nil,nil,{"aes_smart_terrain_monolit_blockpost4","true"})
xr_effects.create_squad(nil,nil,{"aes_sm_monolith_blokpost4_monolith_squad","aes_smart_terrain_monolit_blockpost4"})
xr_effects.create_squad(nil,nil,{"aes_sm_monolith_blokpost4_merck_squad","aes_smart_terrain_monolit_blockpost4"})
xr_effects.create_squad(nil,nil,{"aes_sm_soldier_army_squad", "aes_smart_terran_soldier"})
if not txr_routes.is_route_discovered("zat","aes1") then
txr_routes.open_route("zat","aes1",true)
end
return 5
end
--- Task 7 ---
elseif (task_id == "sl_hidden_threat_task_7") then
if level.name() ~= "jupiter_underground" then return 3 end
if not has_alife_info("ht_jupiter_und_spawn_2") then
if has_alife_info("pas_b400_fake_isg_squad_death") and
has_alife_info("pas_b400_elevator_isg_squad_death") and
has_alife_info("pas_b400_track_isg_squad_death") then
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_downstairs","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_tunnel","true"})
xr_effects.clear_smart_terrain(nil,nil,{"pas_b400_hall","true"})
xr_effects.create_squad(nil,nil,{"pas_b400_tunnel_isg_squad", "pas_b400_tunnel"})
xr_effects.create_squad(nil,nil,{"pas_b400_hall_isg_squad", "pas_b400_hall"})
xr_effects.create_squad(nil,nil,{"pas_b400_hall_isg_leader_squad", "pas_b400_hall"})
db.actor:give_info_portion("ht_jupiter_und_spawn_2")
end
end
if not has_alife_info("jup_und_hall_sniper") then
if has_alife_info("jup_und_hall_door") then
xr_effects.create_squad(nil,nil,{"pas_b400_hall_isg_sniper_squad", "pas_b400_hall"})
db.actor:give_info_portion("jup_und_hall_sniper")
else
if xr_conditions.actor_in_zone(db.actor,nil,{"pas_b400_sr_track_door_in"}) then
db.actor:give_info_portion("jup_und_hall_door")
end
end
end
if has_alife_info("pas_b400_tunnel_isg_squad_death") and
has_alife_info("pas_b400_hall_isg_squad_death") and
has_alife_info("pas_b400_hall_isg_leader_squad_death") then
xr_effects.ht_run_postprocess(nil,nil,{"fade_out"})
if xr_conditions.squad_exist(nil,nil, {"jup_ht_companion_army_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_ht_companion_army_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"jup_b208_ht_sbu_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_b208_ht_sbu_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_a15_ht_sbu_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_a15_ht_sbu_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_hall_isg_sniper_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_hall_isg_sniper_squad"})
db.actor:give_info_portion("pas_b400_hall_isg_sniper_squad_death")
end
return 5
end
end
return 4
end
--- Stage 5 ---
stage_status_f[5] = function(task_id)
--- Task 1 ---
if (task_id == "sl_hidden_threat_task_1") then
if has_alife_info ("hidden_threat_task_1_complete") then return "complete" end
--- Task 4 ---
elseif (task_id == "sl_hidden_threat_task_4") then
if has_alife_info("hidden_threat_task_4_stage_6") then return 6 end
--- Task 5 ---
elseif (task_id == "sl_hidden_threat_task_5") then
if db.actor:object("sl_ht_case_quest_task_5") then
xr_effects.create_squad(nil,nil,{"agr_1_6_ht_degtyarev_squad", "agr_smart_terrain_1_6_near_2"})
return 6
end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("hidden_threat_task_6_stage_6") then
xr_effects.clear_smart_terrain(nil,nil,{"aes2_monolith_camp1","true"})
xr_effects.clear_smart_terrain(nil,nil,{"aes2_monolith_camp2","true"})
xr_effects.create_squad(nil,nil,{"aes2_monolith_camp_1_isg_squad", "aes2_monolith_camp1"})
xr_effects.create_squad(nil,nil,{"aes2_monolith_camp_2_isg_squad", "aes2_monolith_camp2"})
if not txr_routes.is_route_discovered("aes1","aes2") then
txr_routes.open_route("aes1","aes2",true)
end
return 6
end
end
return 5
end
--- Stage 6 ---
stage_status_f[6] = function(task_id)
--- Task 4 ---
if (task_id == "sl_hidden_threat_task_4") then
if has_alife_info("hidden_threat_task_4_stage_7") then return 7 end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if level.name() == "l12_stancia_2" then
if xr_conditions.squad_exist(nil,nil, {"aes_sm_monolith_blokpost4_monolith_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes_sm_monolith_blokpost4_monolith_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"aes_sm_monolith_blokpost4_merck_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes_sm_monolith_blokpost4_merck_squad"})
end
if campfire_flag == nil then
utils_slht.turn_on_campfires_by_smart("aes2_monolith_camp1")
utils_slht.turn_on_campfires_by_smart("aes2_monolith_camp2")
campfire_flag = true
end
return 7
end
utils_slht.aes_companion_squad_in_level()
end
return 6
end
--- Stage 7 ---
stage_status_f[7] = function(task_id)
--- Task 4 ---
if (task_id == "sl_hidden_threat_task_4") then
if has_alife_info("hidden_threat_task_4_complete") then return "complete" end
--- Task 6 ---
elseif (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("aes2_monolith_camp_1_isg_squad_death") and
has_alife_info("aes2_monolith_camp_2_isg_squad_death") then
if xr_conditions.squad_exist(nil,nil, {"aes_sm_soldier_army_squad"}) then
xr_effects.ht_run_postprocess(nil,nil,{"fade_in_out"})
xr_effects.remove_squad(nil,nil,{"aes_sm_soldier_army_squad"})
end
return 8
end
utils_slht.aes_companion_squad_in_level()
end
return 7
end
--- Stage 8 ---
stage_status_f[8] = function(task_id)
--- Task 6 ---
if (task_id == "sl_hidden_threat_task_6") then
if has_alife_info("hidden_threat_task_6_complete") then return "complete" end
end
return 8
end
@@ -0,0 +1,689 @@
--[[
Storyline: Hidden Threat
Version: 1.0
Autor: Longreed
Last Edit: 06/12/2021
]]--
--- Debug mode On/Off ---
debug_mode = false
------------------------- Variables ---------------------------------------------
local uptime = 5
local queue_time_event = {}
reward_table = {}
--- ini ---
task_table = ini_file("misc\\tasks_hidden_threat.ltx")
local ammo_table = ini_file("items\\settings\\hidden_threat_spooner_barter.ltx")
-- npc table --
local npc_table = {
["kuznetsov"] = {"agr_kuznetsov_name", "ui_inGame2_Kuznetsov"},
["sidorovich"] = {"escape_trader_name", "ui_inGame2_sid"},
["kirillov"] = {"agr_smart_terrain_1_6_army_mechanic_stalker_name","ui_inGame2_Kirilov"},
["gorobez"] = {"st_hidden_threat_ser_gorobez_name", "ui_inGame2_Soldier_1"},
["degtyarev"] = {"st_hidden_threat_degtyarev_name", "ui_inGame2_Hero"}
}
-- postprocces table --
local postprocc_table = {
["deimos1"] = "deimos1.ppe",
["fade_out"] = "fade_out.ppe",
["fade_in"] = "fade_in.ppe",
["fade_in_out"] = "fade_in_out.ppe",
["snd_shock"] = "snd_shock.ppe",
["black"] = "black.ppe",
["blur"] = "blur.ppe"
}
-- points --
local actor_pos = {}
points = {
[1] = {vector():set(285.556274414063,-0.688713014125824,-188.317260742188),710944,1245}, -- ds spawn cut scene 1
[2] = {vector():set(258.280914306641,-0.519319772720337,-188.304870605469),678708,1405}, -- ds spawn cut scene 2
[3] = {vector():set(97.806350708008,0.44343876838684,-45.561874389648),280846,1029}, -- agr dead courier
[4] = {vector():set(98.331954956055,0.47475481033325,-44.798767089844),280847,1029}, -- agr quest package
[5] = {vector():set(-124.27033616602,0.68663150072098,-265.50639358163),71235,4889}, -- pri agent's case
[6] = {vector():set(297.92715454102,-0.50883787870407,-300.18185424805),356805,5024}, -- pri safe teleport actor
[7] = {vector():set(50.256832122803,-0.2864902317524,-188.7834777832),265063,5009}, -- pri end scene teleport actor
[8] = {vector():set(-171.45,8.52,-220.71),33561,2410} -- cit quest radio
}
local month_table = {
[1] = 31,
[2] = 28,
[3] = 31,
[4] = 30,
[5] = 31,
[6] = 30,
[7] = 31,
[8] = 31,
[9] = 30,
[10] = 31,
[11] = 30,
[12] = 31
}
---------------------------------------------------------------------------------
function valid_faction_actor()
local actor_com = get_actor_true_community()
local factions = { ["army"] = true }
if actor_com and factions[actor_com] then
return true
end
return false
end
function actor_name(color)
local name = db.actor:character_name()
if color == true then
name = "%c[255,0,255,255]" .. name .. "%c[default]"
end
return name
end
function map_spot_campfire(smart, mode)
local get_id_campfire = function()
local smart_campfires = db.campfire_table_by_smart_names[smart]
if smart_campfires ~= nil and is_not_empty(smart_campfires) then
for k,v in pairs (smart_campfires) do
if v.campfire then return k end
end
end
return nil
end
local cf_id = get_id_campfire(smart)
if mode == true and cf_id and level.map_has_object_spot(cf_id, "green_location") == 0 then
level.map_add_object_spot_ser(cf_id, "green_location", "st_sl_hidden_threat_map_spot_cf")
elseif mode == false and cf_id and level.map_has_object_spot(cf_id, "green_location") ~= 0 then
level.map_remove_object_spot(cf_id, "green_location")
end
end
function set_enemy_map_spot(squads)
if is_empty(squads) then return end
for i=1, #squads do
local squad = get_story_squad(squads[i])
if squad then
if db.actor:position():distance_to_sqr(squad.position) > 500 then
if (squad:clsid() == clsid.online_offline_group_s) then
if (squad.id and level.map_has_object_spot(squad.id,"red_location") == 0) then
level.map_add_object_spot(squad.id, "red_location", "st_ui_pda_task_unknown_enemy")
end
end
else
if (squad:clsid() == clsid.online_offline_group_s) then
if (squad.id and level.map_has_object_spot(squad.id,"red_location") == 1) then
level.map_remove_object_spot(squad.id, "red_location")
end
end
end
end
end
end
function turn_on_campfires_by_smart(smart)
local smart_campfires = db.campfire_table_by_smart_names[smart]
if smart_campfires ~= nil and is_not_empty(smart_campfires) then
for k,v in pairs (smart_campfires) do
if (v.campfire and (not v.campfire:is_on())) then
v.campfire:turn_on()
end
end
end
end
function actor_in_smart(smart, dist)
local smart = SIMBOARD.smarts_by_names[smart]
if (smart.position:distance_to(db.actor:position()) <= (dist or 5)) then
return true
end
return false
end
function create_reward(flag, sec)
if not flag or not sec then
if debug_mode then
printf("[SLHT] Flag or Section: not found")
end
return
end
local reward = nil
local str = task_table:r_string_ex(sec,"items") or ""
local str_path = task_table:r_string_ex(sec,"container") or "none"
local reward_items = str_explode(str,",")
if #reward_items > 0 then
reward = reward_items[math.random(1,#reward_items)]
if str_path ~= "none" then
reward = reward .. "_" .. str_path
else
if math.random() > 0.75 then reward = reward .. "_up" end
end
reward_table[flag] = reward
end
if debug_mode then
local txt = game.translate_string("st_" .. tostring(reward) .. "_name")
printf("[SLHT] %s | Item = %s", tostring(flag), txt)
end
return
end
function end_bribe_exclusive()
utils_slht.HTCreateNews("sidorovich", "st_sl_hidden_threat_msg_armistice_end", 0, true, true)
xr_bribe.cmd.bribes_reset()
end
function bribe_exclusive_2_hours_stalker()
xr_bribe.set_bribe("stalker", 0, 12000)
--- Postpone ---
local title = game.translate_string("st_sl_hidden_threat_msg_armistice_title")
local msg = game.translate_string("st_sl_hidden_threat_msg_armistice_msg")
local path = "%c[green]" .. game.translate_string("st_sl_hidden_threat_msg_armistice_path") .. "%c[default]"
local icon = "ui_inGame2_PD_Diplomat"
msg = strformat(msg, path)
db.actor:give_talk_message2(title, msg, icon, "iconed_answer_item")
---------------
HTCreateNews("sidorovich", "st_sl_hidden_threat_msg_armistice_start", 10, true, true)
HTCreateTimeEvent("slht_bribe", 7200, end_bribe_exclusive)
end
function HTCreateNews(who,str,timeout,actor_msg,color)
if not npc_table[who] then
if debug_mode then
printf("![SLHT] Wrong parametr 'who=%s' for news!!!",tostring(who))
end
return
end
local msg = game.translate_string(str) or nil
local npc_name = game.translate_string(npc_table[who][1]) or nil
local npc_icon = npc_table[who][2] or nil
if actor_msg == true then
msg = strformat(msg, actor_name(color))
end
if npc_name and npc_icon and msg then
dynamic_news_helper.send_tip(msg, npc_name, timeout, 10, npc_icon, "news", "npc")
else
if debug_mode then
printf("![SLHT] Wrong 'npc_table=%s' for news!!!",tostring(who))
end
end
end
function check_ammo_with_actor(sec)
local ammo_section = utils_data.parse_ini_section_to_array(ammo_table,sec)
if not ammo_section then
printf("[SLHT]!Warning: couldn't load file gamedata/configs/items/settings/hidden_threat_spooner_barter.ltx, feature disabled!")
return false
end
for k,v in pairs(ammo_section) do
local t = str_explode(v,",") or {}
if #t > 3 then
local amount = utils_item.get_amount(db.actor, t[1], 1)
assert(tonumber(t[2]), "value: must be a number")
if amount >= tonumber(t[2]) then return true end
end
end
return false
end
function exchange_ammo_with_actor(a,b,sec)
if check_ammo_with_actor(sec) then
local str = ammo_table:r_string_ex(sec, sec .. "_value") or ""
local t = str_explode(str,",") or {}
if #t > 3 then
assert(tonumber(t[2]), "value: must be a number")
assert(tonumber(t[4]), "value: must be a number")
dialogs.relocate_item_section_from_actor(a, b, t[1], tonumber(t[2]))
dialogs.relocate_item_section_to_actor(a, b, t[3], tonumber(t[4]))
end
end
end
function val_1_2_attack_msg_sound()
local header = game.translate_string("st_sl_hidden_threat_darkvalley_msg_header")
local msg = game.translate_string("st_sl_hidden_threat_darkvalley_msg_text")
local ui_sender = "ui_inGame2_Soldier_2"
xr_sound.set_sound_play(db.actor:id(), "val_attack_isg_sound")
db.actor:give_game_news(header, msg, ui_sender, 0, 2000)
end
function pri_b304_spawn_agent_case()
alife_create("sl_ht_case_quest_task_5", points[5][1],points[5][2],points[5][3])
end
function cit_spawn_ph_radio()
alife_create("cit_ht_ph_quest_radio", points[8][1],points[8][2],points[8][3])
end
function aes_companion_squad_in_level()
if xr_conditions.squad_exist(nil,nil, {"aes_sm_soldier_army_squad"}) then
if (level.name() ~= "l12_stancia_2" and level.name() ~= "l12_stancia") then
if has_alife_info("aes_companion_squad") then
xr_effects.remove_task_companion(nil,nil,{"aes_sm_soldier_army_squad"})
xr_effects.teleport_squad(nil,nil,{"aes_sm_soldier_army_squad","aes_smart_terran_soldier_home_1"})
db.actor:disable_info_portion("aes_companion_squad")
end
elseif (level.name() == "l12_stancia_2" or level.name() == "l12_stancia") then
if not has_alife_info("aes_companion_squad") then
xr_effects.add_task_companion(nil,nil,{"aes_sm_soldier_army_squad"})
local squad = get_story_squad("aes_sm_soldier_army_squad")
squad:set_squad_position(db.actor:position(),db.actor:level_vertex_id(),db.actor:game_vertex_id())
db.actor:give_info_portion("aes_companion_squad")
end
end
end
end
-------------------------- Addons itms_manager -----------------------------------
itms_manager.ht_use_spooner_package_random = function(obj)
local t = {
[1] = "ammo_9x19_fmj",
[2] = "ammo_11.43x23_fmj",
[3] = "ammo_5.56x45_fmj",
[4] = "ammo_7.62x51_fmj"
}
local pick = {}
for i=1,#t do
if (#pick < 6) and (math.random(100) < 50) then
pick[#pick+1] = t[i]
end
end
pick = #pick > 1 and pick or {t[1],t[2],t[3],t[4]}
utils_item.delay_event(pick, {obj:id()}, "package_content", true, 5)
if has_alife_info("hidden_threat_second_task_2_box") then
db.actor:give_info_portion("hidden_threat_second_task_2_fail")
end
end
-------------------------- Addons xr_effects --------------------------------------
xr_effects.ht_hit_obj_on_job = function(actor,npc,p)
local h = hit()
local board = SIMBOARD
local smart = p[1] and board and board.smarts_by_names[p[1]]
local obj = smart and smart.npc_by_job_section["logic@"..p[2]]
obj = obj and level.object_by_id(obj)
if not obj or not obj:alive() then
return false
end
h:bone("bip01_head")
h.power = 2
h.impulse = 12
h.direction = vec_sub(npc:position(), obj:position())
h.draftsman = sid or npc
h.type = hit.wound
obj:hit(h)
end
xr_effects.ht_ds_domik_st_prestart_cut_scene = function(actor,npc,p)
if not p[1] then return end
assert(tonumber(p[1]), 'value must be a number')
local ind = tonumber(p[1])
db.actor:set_actor_position(patrol("ds2_ht_actor_cam_position_walk"):point(0))
local se_obj = alife_create("hidden_threat_spirit", points[ind][1],points[ind][2],points[ind][3])
utils_obj.switch_online(se_obj.id)
end
xr_effects.ht_npc_set_visual = function(actor,npc,p)
npc:set_visual_name(db.actor:get_visual_name())
for i=2, 3 do
if db.actor:item_in_slot(i) ~= nil then
xr_effects.spawn_item_to_npc(nil,npc,{db.actor:item_in_slot(i):section()})
end
end
end
xr_effects.ht_run_cam_effector_global = function(actor,npc,p)
local loop, num = false, (1000 + math.random(100))
if p[2] and type(p[2]) == "number" and p[2] > 0 then
num = p[2]
end
if p[3] and p[3] == "true" then
loop = true
end
local fov = device().fov
if p[4] ~= nil and type(p[4]) == "number" then
fov = p[4]
end
level.add_cam_effector("camera_effects\\" .. p[1] .. ".anm", num, loop, "xr_effects.cam_effector_callback", fov)
end
xr_effects.ht_run_postprocess = function(actor,npc,p)
if p and p[1] and postprocc_table[p[1]] then
local num = 2000 + math.random(100)
local looped = false
if(p[2] and type(p[2]) == "number" and p[2]>0) then num = p[2] end
if p[3] and p[3] == "true" then looped = true end
level.add_pp_effector(postprocc_table[p[1]], num, looped)
if debug_mode then
printf("[SLHT] Adding postprocces [%s] | ID = %s | looped = %s", tostring(p[1]), tostring(num), tostring(looped))
end
else
if debug_mode then
printf("[SLHT] Postprocces [%s] is no set!", tostring(p[1]))
end
end
end
xr_effects.ht_stop_postprocess = function(actor,npc,p)
if p and p[1] then
assert(tonumber(p[1]),"value: must be a number")
level.remove_pp_effector(tonumber(p[1]))
end
end
xr_effects.ht_remove_npc = function(actor,npc,p)
if not p or not p[1] then return end
local npc = get_story_se_object(tostring(p[1]))
if npc ~= nil then
xr_effects.remove_npc(nil,nil,{tostring(p[1])})
end
end
xr_effects.ht_add_mine = function(actor,npc,p)
local pos = vector():set(db.actor:position().x - 1,db.actor:position().y,db.actor:position().z)
alife_create("tch_ht_quest_mine_blow",pos,db.actor:level_vertex_id(),db.actor:game_vertex_id())
end
xr_effects.actor_add_item = function(actor,npc,p)
if p and p[1] then
alife_create_item(p[1],db.actor)
news_manager.relocate_item(db.actor,"in",p[1])
end
end
xr_effects.ht_init_second_task_2 = function(actor,npc,p)
alife_create("agr_dead_courier", points[3][1],points[3][2],points[3][3]):on_death()
alife_create("sl_ht_spooner_quest_package",points[4][1],points[4][2],points[4][3])
end
xr_effects.ht_fail_storyline_task_5 = function(actor,npc,p)
if xr_conditions.squad_exist(nil,nil, {"pri_army_ser_gorobez_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_army_ser_gorobez_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_isg_guard_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_isg_guard_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_isg_leader_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_isg_leader_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_isg_agent_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_isg_agent_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_b35_mercs_ht_strelok_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_b35_mercs_ht_strelok_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"agr_1_6_ht_degtyarev_squad"}) then
xr_effects.remove_squad(nil,nil,{"agr_1_6_ht_degtyarev_squad"})
end
end
xr_effects.ht_fail_storyline_task_6 = function(actor,npc,p)
xr_effects.ht_alife_release_object(cit_ht_ph_quest_radio)
if xr_conditions.squad_exist(nil,nil, {"aes_sm_monolith_blokpost4_monolith_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes_sm_monolith_blokpost4_monolith_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"aes_sm_monolith_blokpost4_merck_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes_sm_monolith_blokpost4_merck_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"aes_sm_soldier_army_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes_sm_soldier_army_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"agr_1_6_ht_degtyarev_squad"}) then
xr_effects.remove_squad(nil,nil,{"agr_1_6_ht_degtyarev_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"aes2_monolith_camp_1_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes2_monolith_camp_1_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"aes2_monolith_camp_2_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"aes2_monolith_camp_2_isg_squad"})
end
end
xr_effects.ht_fail_storyline_task_7 = function(actor,npc,p)
if xr_conditions.squad_exist(nil,nil, {"agr_1_6_ht_vereshagin_squad"}) then
xr_effects.remove_squad(nil,nil,{"agr_1_6_ht_vereshagin_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pri_a15_ht_sbu_squad"}) then
xr_effects.remove_squad(nil,nil,{"pri_a15_ht_sbu_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"jup_b208_ht_sbu_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_b208_ht_sbu_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"jup_b208_ht_sbu_agent_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_b208_ht_sbu_agent_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"jup_ht_companion_army_squad"}) then
xr_effects.remove_squad(nil,nil,{"jup_ht_companion_army_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_fake_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_fake_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_elevator_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_elevator_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_track_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_track_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_tunnel_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_tunnel_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_hall_isg_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_hall_isg_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_hall_isg_leader_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_hall_isg_leader_squad"})
end
if xr_conditions.squad_exist(nil,nil, {"pas_b400_hall_isg_sniper_squad"}) then
xr_effects.remove_squad(nil,nil,{"pas_b400_hall_isg_sniper_squad"})
end
end
xr_effects.ht_pri_b35_teleport_actor = function(actor,npc,p)
if p and p[1] and p[1] == "safe" then
actor_pos = {[1] = vector():set(db.actor:position()),
[2] = db.actor:level_vertex_id(),
[3] = db.actor:game_vertex_id()}
db.actor:set_actor_position(points[6][1],points[6][2],points[6][3])
else
if actor_pos and #actor_pos > 0 then
db.actor:set_actor_position(actor_pos[1],actor_pos[2],actor_pos[3])
actor_pos = {}
else
db.actor:set_actor_position(points[7][1],points[7][2],points[7][3])
end
end
end
xr_effects.ht_pri_a17_play_sound = function(actor,npc,p)
xr_sound.set_sound_play(db.actor:id(), "pri_actor_heart_sound")
end
xr_effects.ht_alife_release_object = function(actor,npc,p)
if p and p[1] then
local sim = alife()
for i=1,65534 do
local obj = sim:object(i)
if obj then
local sec = obj:section_name() or ""
if sec == tostring(p[1]) then
sim:release(obj,true)
if debug_mode then
printf("~[SLHT] Alife release [%s]", tostring(p[1]))
end
break
end
end
end
end
end
---------------------------------------------------------------------------------------------------------
local HTTimeEventUpdate = function()
ResetTimeEvent("cycle","slht_update_time_event",uptime)
local curr = utils_data.CTime_to_table(game.get_game_time())
for k,v in pairs(queue_time_event) do
if (curr.Y > v.ETime.Y) or
(curr.Y == v.ETime.Y and curr.M > v.ETime.M) or
(curr.Y == v.ETime.Y and curr.M == v.ETime.M and curr.D > v.ETime.D) or
(curr.Y == v.ETime.Y and curr.M == v.ETime.M and curr.D == v.ETime.D and curr.h > v.ETime.h) or
(curr.Y == v.ETime.Y and curr.M == v.ETime.M and curr.D == v.ETime.D and curr.h == v.ETime.h and curr.m > v.ETime.m) or
(curr.Y == v.ETime.Y and curr.M == v.ETime.M and curr.D == v.ETime.D and curr.h == v.ETime.h and curr.m == v.ETime.m and curr.s > v.ETime.s) then
if debug_mode then
printf("[SLHT] TimeEventDisabled | ID: %s", tostring(k))
printf("*** Day:%s Time:%s:%s:%s",
tostring(curr.D),
tostring(curr.h),
tostring(curr.m),
tostring(curr.s)) end
queue_time_event[k].EFunc(unpack(queue_time_event[k].EArgs))
empty_table(queue_time_event[k].ETime)
empty_table(queue_time_event[k].EArgs)
queue_time_event[k].EFunc = nil
queue_time_event[k] = nil
end
end
end
local HTFormatTime = function(value, curr_time)
if not value then return nil end
if not curr_time then return nil end
local v = tonumber(value)
local t = {
Y = curr_time.Y,
M = curr_time.M,
D = curr_time.D + math.floor(v/86400),
h = curr_time.h + math.floor((v - (math.floor(v/86400)*86400))/3600),
m = curr_time.m + math.floor((v - (math.floor(v/3600)*3600))/60),
s = curr_time.s + (v - (math.floor(v/60)*60)),
ms = curr_time.ms
}
if t.s >= 60 then t.s = t.s - 60 t.m = t.m + 1 end
if t.m >= 60 then t.m = t.m - 60 t.h = t.h + 1 end
if t.h >= 24 then t.h = t.h - 24 t.D = t.D + 1 end
if t.D > month_table[t.M] then t.D = t.D - month_table[t.M] t.M = t.M + 1 end
if t.M > 12 then t.M = 1 t.Y = t.Y + 1 end
return t
end
HTCreateTimeEvent = function(teid,value,func,...)
if not teid or not value or not func then return end
if type(value) ~= "number" then return end
value = tonumber(value)
local curr = utils_data.CTime_to_table(game.get_game_time())
if queue_time_event and not queue_time_event[teid] then
local event_time = HTFormatTime(value,curr)
if not event_time or type(event_time) ~= "table" then return end
queue_time_event[teid] = {}
queue_time_event[teid].ETime = event_time
queue_time_event[teid].EFunc = func
queue_time_event[teid].EArgs = {...}
if debug_mode then
printf("[SLHT] TimeEventEnabled | ID: %s", tostring(teid))
printf("*** Value: %s seconds",tostring(value))
printf("*** Start: Day:%s Time:%s:%s:%s",
tostring(curr.D),
tostring(curr.h),
tostring(curr.m),
tostring(curr.s))
printf("*** End: Day:%s Time:%s:%s:%s",
tostring(event_time.D),
tostring(event_time.h),
tostring(event_time.m),
tostring(event_time.s))
end
return true
end
end
--code demonized
xr_effects.clear_scene_from_monsters = function(actor, npc, p)
local smart_name = p[1]
if not smart_name then
printf("Hidden Threat, no smart specified")
return
end
local smart = SIMBOARD.smarts_by_names[smart_name]
if not smart then
printf("Hidden Threat, no smart found with name %s", smart_name)
return
end
local clean_distance = (p[2] or 60) ^ 2
for i = 1, 65534 do
local se_obj = alife_object(i)
if se_obj and IsMonster(nil, se_obj:clsid()) then
local dist = smart.position:distance_to_sqr(se_obj.position)
if dist <= clean_distance then
printf("Hidden Threat, cleaning scene from monster %s, dist_sqr %s", se_obj:name(), dist)
alife():release(se_obj)
end
end
end
end
--code demonized end
local function save_state(m_data)
m_data.slht_queue_time_event = queue_time_event
m_data.slht_reward_table = reward_table
end
local function load_state(m_data)
queue_time_event = m_data.slht_queue_time_event or {}
reward_table = m_data.slht_reward_table or {}
end
local function on_game_load()
CreateTimeEvent("cycle", "slht_update_time_event", uptime, HTTimeEventUpdate)
end
function on_game_start()
RegisterScriptCallback("on_game_load", on_game_load)
RegisterScriptCallback("save_state",save_state)
RegisterScriptCallback("load_state",load_state)
end