------- GENERAL Functions -------- local HI = has_alife_info local GI = give_info local DI = disable_info function NI(str) return not (has_alife_info(str)) end function on_game_start() RegisterScriptCallback("actor_on_item_use", use_item_strange_meat_1) RegisterScriptCallback("actor_on_item_use", use_item_strange_meat_1_2) RegisterScriptCallback("actor_on_item_use", use_item_strange_meat_2) RegisterScriptCallback("actor_on_item_use", use_item_strange_meat_2_2) RegisterScriptCallback("actor_on_item_use", use_item_radio_micro_quest) end ------- NLTP-Ashes scripts ------- --- Function used to spawn a simulation squad, at a given point in space. --- @param sec string --- @param pos vector --- @param lvid number --- @param gvid number --- @param smart cse_alife_smart_zone --- @return cse_alife_online_offline_group function spawn_squad(sec,pos,lvid,gvid,smart) if not validate_params({sec,pos,lvid,gvid,"spawn_squad"}) then return end local squad = alife_create(sec, pos, lvid, gvid) if squad then squad:create_npc(smart, pos, lvid, gvid) if smart then SIMBOARD:assign_squad_to_smart(squad, smart.id) else SIMBOARD:assign_squad_to_smart(squad) end for k in squad:squad_members() do local se_obj = k.object or k.id and alife_object(k.id) if (se_obj) then SIMBOARD:setup_squad_and_group(se_obj) SendScriptCallback("squad_on_npc_creation",squad,se_obj,smart) end end return squad else printf("![Brotherhood] ERROR | Utils | Failed to create squad (%s)",sec) return end end --- Function used to check if all necessary parameters were correctly passed to a function. --- Last element of the table has to be the name of the function calling validate_params. --- Use like this : 'if not validate_params({param_1,param_1,"my_function"}) then return end' --- @param params table --- @return boolean function validate_params(params) local index = 1 for i,_ in pairs(params) do if i ~= index then printf("![WG] ERROR | Utils | Missing argument no %s for '%s()'!",index,params[#params]) return false end index = index + 1 end return true end function poluchit_po_litsu(actor, npc) npc:force_set_goodwill(-5000, actor) end function give_task(name) task_manager.get_task_manager():give_task(name) end -------Stories from the Zone -------- ------ Brotherhood rewards ------ function transfer_brotherhood_reward_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bottle_metal", 1) end function transfer_brotherhood_reward_2(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "cigar2", 1) end ---- Bellerophon Quests ---- function give_task_bellerophon_chimera_1() dialogs_brotherhood.give_task('give_task_bellerophon_chimera_1') end function relocation_bellerophon_1() local squad = get_story_se_object("bellerophon_squad") local pos = vector():set( 30.001893997192,-11.701859474182,-278.17437744141 ) if (pos and squad) then TeleportSquad(squad,pos,79573,2281) GI("relocation_bellerophon_1") end end function transfer_stolya_for_bellerophon(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka_quality", 1) end ------Butcher Quest 1 (now 3) ------ function give_task_kill_pack_dogs_1() dialogs_brotherhood.give_task('give_task_kill_pack_dogs_1') end function is_has_package_vybegallo() if db.actor:object("quest_package_vybegallo") then return true end return false end function transfer_package_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_vybegallo") dialogs.relocate_money_to_actor(first_speaker, second_speaker, 7500) end ------Butcher Quest 2 ------ function give_task_kill_pack_boars_1() dialogs_brotherhood.give_task('give_task_kill_pack_boars_1') end function transfer_grenades_boars(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "grenade_f1", 2) end ------Butcher Quest 3 ------ function give_task_kill_pack_snorks_1() dialogs_brotherhood.give_task('give_task_kill_pack_snorks_1') end function transfer_bandage_snorks(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bandage") end ------Butcher Quest 4 ------ function give_task_kill_pack_snorks_2() dialogs_brotherhood.give_task('give_task_kill_pack_snorks_2') end function give_meet_vybegallo_quest() dialogs_brotherhood.give_task('give_meet_vybegallo_quest') end function transfer_bandages_snorks(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bandage", 2) end function relocation_ilya_1() local squad = get_story_se_object("bellerophon_squad") local pos = vector():set( 20.758554458618,0.15221303701401,11.817081451416 ) if (pos and squad) then TeleportSquad(squad,pos,217755,1026) GI("relocation_ilya_1_init") end end ---- Butcher Quest 5 ---- function give_rescue_orion_quest() dialogs_brotherhood.give_task('give_rescue_orion_quest') end function transfer_supplies_agru_controller(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bandage", 2) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "ammo_12x70_buck", 2) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "medkit_scientic", 1) end function transfer_supplies_agru_controller_2(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "drug_psy_blockade", 2) end function xr_effects.spawn_hunter_orion_dead() local pos = vector():set( 112.4231262207,-6.9253225326538,-34.570152282715 ) local se_obj = alife_create( "hunter_orion", pos, 9264, 3727 ) if (se_obj) then se_obj:kill() end if ( not se_obj ) then printe("!ERROR: unable to spawn hunter_orion" ) end end function spawn_sarpedon() local smart_2 = SIMBOARD.smarts_by_names["agr_smart_terrain_4_4"] local squad = SIMBOARD:create_squad(smart_2,"sarpedon_squad") end ------ Trapper Quests ------ --- Chimera 1 function give_task_trapper_chimera_1() dialogs_brotherhood.give_task('give_task_trapper_chimera_1') end function is_has_boar_meat_for_bait() local cnt = utils_item.get_amount(db.actor, "mutant_part_boar_chop") if (cnt >= 6) then return true end return false end function give_task_trapper_chimera_2() dialogs_brotherhood.give_task('give_task_trapper_chimera_2') end function transfer_boar_chimera_trapper(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "meat_boar", 6) end function transfer_chimera_bait_trapper(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "quest_chimera_bait_brotherhood") end function transfer_trapper_recording_device(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "radio_micro_quest") end function is_has_trapper_bait_no() if db.actor:object("quest_chimera_bait_brotherhood") then return false end return true end function is_has_trapper_bait_yes() if db.actor:object("quest_chimera_bait_brotherhood") then return true end return false end function trapper_chimera_is_dead() local obj = get_story_se_object("trapper_chimera_2") if HI("trapper_chimera_2_dead") then if obj then local commander = alife_object(obj:commander_id()) if commander and commander:alive() then DI("trapper_chimera_2_dead") return false else return true end end elseif NI("trapper_chimera_2_dead") then return false end end function trapper_chimera_is_alive() local obj = get_story_se_object("trapper_chimera_2") if HI("trapper_chimera_2_dead") then if obj then local commander = alife_object(obj:commander_id()) if commander and commander:alive() then DI("trapper_chimera_2_dead") return true else return false end end elseif NI("trapper_chimera_2_dead") then return true end end function is_has_recording_device() if db.actor:object("radio_micro_quest") then return true end return false end function is_has_recording_device_no() if db.actor:object("radio_micro_quest") then return false end return true end function transfer_trapper_chimera_bounty_2(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 10000) end function transfer_radio_to_trapper(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "radio_micro_quest") end function reset_trapper_chimera_2() DI("trapper_chimera_3_init_timed") DI("trapper_chimera_2_init_timed") DI("trapper_chimera_2_recording_done") DI("trapper_chimera_record_in_place") DI("trapper_chimera_3_init") DI("trapper_chimera_2_init") DI("trapper_chimera_record_set") end --- Trapper Missing hunters --- -- Hunter 1 -- function give_task_trapper_missing_hunter_1() dialogs_brotherhood.give_task('give_task_trapper_missing_hunter_1') end function give_task_trapper_missing_hunter_2() dialogs_brotherhood.give_task('give_task_trapper_missing_hunter_2') end function give_task_trapper_missing_hunter_3() dialogs_brotherhood.give_task('give_task_trapper_missing_hunter_3') end ----- Butcher Legendary ---- function give_butcher_legendary_1() dialogs_brotherhood.give_task('give_butcher_legendary_1') end function pseudo_dynamic_spawn_legendary_1() local pos = db.actor:position() local smart_1 = SIMBOARD.smarts_by_names["mar_smart_terrain_7_7"] ---north east - smart 1 local smart_2 = SIMBOARD.smarts_by_names["mar_smart_terrain_6_7"] ---north west - smart 2 local smart_3 = SIMBOARD.smarts_by_names["mar_smart_terrain_4_7"] ---south - smart 3 local smrt_1 = SIMBOARD.smarts[smart_1.id] local smrt_2 = SIMBOARD.smarts[smart_2.id] local smrt_3 = SIMBOARD.smarts[smart_3.id] local dist_1 = (db.actor:position():distance_to(smart_1.position)) local dist_2 = (db.actor:position():distance_to(smart_2.position)) local dist_3 = (db.actor:position():distance_to(smart_3.position)) local distance = 10 local pos_1 = vector():set( 229.9093170166,0.73001974821091,172.14596557617 ) --- smart 1 south local pos_2 = vector():set( 193.70741271973,0.87180489301682,108.35623168945 ) --- samrt 1 east local pos_3 = vector():set( 71.255294799805,0.83956271409988,102.07247924805 ) --- smart 2 North local pos_4 = vector():set( 59.722770690918,0.56484937667847,145.73992919922 ) --- smart 2 west local pos_5 = vector():set( -42.557529449463,0.49137985706329,118.64920043945 ) --- smart 3 east local pos_6 = vector():set( -34.978141784668,0.53491681814194,164.68092346191 ) --- samrt 3 south local dyst_1 = (pos:distance_to(pos_1)) local dyst_2 = (pos:distance_to(pos_2)) local dyst_3 = (pos:distance_to(pos_3)) local dyst_4 = (pos:distance_to(pos_4)) local dyst_5 = (pos:distance_to(pos_5)) local dyst_6 = (pos:distance_to(pos_6)) if (dist_1 < dist_2) and (dist_1 < dist_3) then --- smart 1 if (dyst_1 < dyst_2) and (dyst_1 > distance) then --- dyst 1 trigger spawn_legendary_calydonian_boar_1() elseif (dyst_1 < dyst_2) and (dyst_1 < distance) then --- dyst 2 trigger spawn_legendary_calydonian_boar_2() elseif (dyst_2 < dyst_1) and (dyst_2 > distance) then --- dyst 2 trigger spawn_legendary_calydonian_boar_2() elseif (dyst_2 < dyst_1) and (dyst_2 < distance) then --- dyst 1 trigger spawn_legendary_calydonian_boar_1() end elseif (dist_2 < dist_1) and (dist_2 < dist_3) then ---smart 2 if (dyst_3 < dyst_4) and (dyst_3 > distance) then --- dyst 3 trigger spawn_legendary_calydonian_boar_3() elseif (dyst_3 < dyst_4) and (dyst_3 < distance) then --- dyst 4 trigger spawn_legendary_calydonian_boar_4() elseif (dyst_4 < dyst_3) and (dyst_4 > distance) then --- dyst 4 trigger spawn_legendary_calydonian_boar_4() elseif (dyst_4 < dyst_3) and (dyst_4 < distance) then --- dyst 3 trigger spawn_legendary_calydonian_boar_3() end elseif (dist_3 < dist_1) and (dist_3 < dist_2) then if (dyst_5 < dyst_6) and (dyst_5 > distance) then --- dyst 5 trigger spawn_legendary_calydonian_boar_5() elseif (dyst_5 < dyst_6) and (dyst_5 < distance) then --- dyst 6 trigger spawn_legendary_calydonian_boar_6() elseif (dyst_6 < dyst_5) and (dyst_6 > distance) then --- dyst 6 trigger spawn_legendary_calydonian_boar_6() elseif (dyst_6 < dyst_5) and (dyst_6 < distance) then --- dyst 5 trigger spawn_legendary_calydonian_boar_5() end end end function spawn_legendary_calydonian_boar_1() local pos_1 = vector():set( 229.9093170166,0.73001974821091,172.14596557617 ) --- smart 1 south local lvid_1 = 283409 local gvid_1 = 220 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_1, lvid_1, gvid_1) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_1, lvid_1, gvid_1) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_1, lvid_1, gvid_1) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_1, lvid_1, gvid_1) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_1, lvid_1, gvid_1) GI("legendary_boar_reinforcment_3_spawned") end end function spawn_legendary_calydonian_boar_2() local pos_2 = vector():set( 193.70741271973,0.87180489301682,108.35623168945 ) --- samrt 1 east local lvid_2 = 257374 local gvid_2 = 349 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_2, lvid_2, gvid_2) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_2, lvid_2, gvid_2) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_2, lvid_2, gvid_2) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_2, lvid_2, gvid_2) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_2, lvid_2, gvid_2) GI("legendary_boar_reinforcment_3_spawned") end end function spawn_legendary_calydonian_boar_3() local pos_3 = vector():set( 71.255294799805,0.83956271409988,102.07247924805 ) --- smart 2 North local lvid_3 = 180674 local gvid_3 = 112 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_3, lvid_3, gvid_3) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_3, lvid_3, gvid_3) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_3, lvid_3, gvid_3) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_3, lvid_3, gvid_3) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_3, lvid_3, gvid_3) GI("legendary_boar_reinforcment_3_spawned") end end function spawn_legendary_calydonian_boar_4() local pos_4 = vector():set( 59.722770690918,0.56484937667847,145.73992919922 ) --- smart 2 west local lvid_4 = 174270 local gvid_4 = 112 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_4, lvid_4, gvid_4) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_4, lvid_4, gvid_4) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_4, lvid_4, gvid_4) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_4, lvid_4, gvid_4) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_4, lvid_4, gvid_4) GI("legendary_boar_reinforcment_3_spawned") end end function spawn_legendary_calydonian_boar_5() local pos_5 = vector():set( -42.557529449463,0.49137985706329,118.64920043945 ) --- smart 3 east local lvid_5 = 120939 local gvid_5 = 69 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_5, lvid_5, gvid_5) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_5, lvid_5, gvid_5) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_5, lvid_5, gvid_5) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_5, lvid_5, gvid_5) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_5, lvid_5, gvid_5) GI("legendary_boar_reinforcment_3_spawned") end end function spawn_legendary_calydonian_boar_6() local pos_6 = vector():set( -34.978141784668,0.53491681814194,164.68092346191 ) --- samrt 3 south local lvid_6 = 125376 local gvid_6 = 70 if NI("legendary_boar_calydonian_spawned") then news_manager.send_tip(db.actor, game.translate_string("st_calydonian_boar_spawned_1"), 0, "communication", 11000, 1) local se_squad_1 = spawn_squad("legendary_pack_boars_calydonian", pos_6, lvid_6, gvid_6) local se_squad_2 = spawn_squad("legendary_pack_boars_calydonian_guard", pos_6, lvid_6, gvid_6) GI("legendary_boar_calydonian_spawned") return end if HI("legendary_pack_boars_calydonian_guard_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_1_spawned") then local se_squad_3 = spawn_squad("legendary_pack_boars_reinf_1", pos_6, lvid_6, gvid_6) GI("legendary_boar_reinforcment_1_spawned") end if HI("legendary_pack_boars_reinf_1_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_2_spawned") then local se_squad_4 = spawn_squad("legendary_pack_boars_reinf_2", pos_6, lvid_6, gvid_6) GI("legendary_boar_reinforcment_2_spawned") end if HI("legendary_pack_boars_reinf_2_dead") and NI("legendary_pack_boars_calydonian_dead") and NI("legendary_boar_reinforcment_3_spawned") then local se_squad_5 = spawn_squad("legendary_pack_boars_reinf_3", pos_6, lvid_6, gvid_6) GI("legendary_boar_reinforcment_3_spawned") end end function reset_legendary_hunt_2() DI("legendary_pack_boars_1_spawned") DI("legendary_pack_boars_2_spawned") DI("legendary_pack_boars_3_spawned") DI("legendary_pack_boars_1_dead") DI("legendary_pack_boars_2_dead") DI("legendary_pack_boars_3_dead") DI("legendary_boar_calydonian_spawned") DI("legendary_pack_boars_calydonian_guard_dead") DI("legendary_boar_reinforcment_1_spawned") DI("legendary_pack_boars_reinf_1_dead") DI("legendary_boar_reinforcment_2_spawned") DI("legendary_pack_boars_reinf_2_dead") DI("legendary_boar_reinforcment_3_spawned") DI("legendary_pack_boars_reinf_3_dead") DI("player_fled_from_calydonian_boar") end function xr_effects.release_legendary_hunt_2() local squad_1 = get_story_se_object("legendary_pack_boars_1") local squad_2 = get_story_se_object("legendary_pack_boars_2") local squad_3 = get_story_se_object("legendary_pack_boars_3") local squad_4 = get_story_se_object("legendary_pack_boars_calydonian_guard") local squad_5 = get_story_se_object("legendary_pack_boars_reinf_1") local squad_6 = get_story_se_object("legendary_pack_boars_reinf_2") local squad_7 = get_story_se_object("legendary_pack_boars_reinf_3") local squad_8 = get_story_se_object("legendary_pack_boars_calydonian") if (squad_1) then alife_release(squad_1) end if (squad_2) then alife_release(squad_2) end if (squad_3) then alife_release(squad_3) end if (squad_4) then alife_release(squad_4) end if (squad_5) then alife_release(squad_5) end if (squad_6) then alife_release(squad_6) end if (squad_7) then alife_release(squad_7) end if (squad_8) then alife_release(squad_8) end end function transfer_reward_legendary_boar_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "wpn_svd_cyclops") end ---- Alyosha Shyogolov ---- function give_alyosha_shyogolov_trouble_1() dialogs_brotherhood.give_task('give_alyosha_shyogolov_trouble_1') end function set_alyosha_shyogolov_as_companion_1(a,b) local squad = get_story_squad("alyosha_shyogolov_squad") axr_companions.add_special_squad(squad) end function dismiss_alyosha_shyogolov_as_companion_1(a,b) local squad = get_story_squad("alyosha_shyogolov_squad") if NI("alyosha_shyogolov_0_done") then axr_companions.dismiss_special_squad(squad) end end function give_alyosha_shyogolov_trouble_2() dialogs_brotherhood.give_task('give_alyosha_shyogolov_trouble_2') end function is_has_bh_mozgotlen_documents() if db.actor:object("bh_mozgotlen_documents") then return true end return false end function transfer_bh_mozgotlen_documents_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "bh_mozgotlen_documents") end function give_alyosha_shyogolov_trouble_3() dialogs_brotherhood.give_task('give_alyosha_shyogolov_trouble_3') end function give_alyosha_shyogolov_trouble_4() dialogs_brotherhood.give_task('give_alyosha_shyogolov_trouble_4') end function give_alyosha_shyogolov_trouble_5() dialogs_brotherhood.give_task('give_alyosha_shyogolov_trouble_5') end --- Quest 3 function relocation_alyosha_1() local squad = get_story_se_object("alyosha_shyogolov_squad") local pos = vector():set( -67.114974975586,3.663382768631,114.72267150879 ) if (pos and squad) then TeleportSquad(squad,pos,608040,4599) DI("alyosha_shyogolov_1_you_arrived") GI("relocated_alyosha_shyogolov_1") end end function relocation_nr_ecologist_rydzyk_1() local squad = get_story_se_object("nr_ecologist_rydzyk_squad") local pos = vector():set( -216.47917175293,-3.557053565979,79.757942199707 ) if (pos and squad) then TeleportSquad(squad,pos,350794,4531) GI("nr_ecologist_rydzyk_relocation_1") end end function relocation_nr_ecologist_1() local squad = get_story_se_object("nr_ecologist_1_squad") local pos = vector():set( -215.28471374512,-3.56827044487,75.60816192627 ) if (pos and squad) then TeleportSquad(squad,pos,351965,4531) GI("nr_ecologist_1_relocation_1") end end function relocation_nr_ecologist_2() local squad = get_story_se_object("nr_ecologist_2_squad") local pos = vector():set( -213.26760864258,-3.5684111118317,68.279556274414 ) if (pos and squad) then TeleportSquad(squad,pos,355482,4531) GI("nr_ecologist_2_relocation_1") end end --- Quest 4 function alyosha_shyogolov_4_1(speaker, listener) return string.format(game.translate_string("alyosha_shyogolov_4_1"), alife():actor():character_name()) end function alyosha_shyogolov_6_18(speaker, listener) return string.format(game.translate_string("alyosha_shyogolov_6_18"), alife():actor():character_name()) end function is_night_alyosha() local hrs = level.get_time_hours() if (hrs >= 22) and (hrs < 24) then return true end return false end function is_day_alyosha() local hrs = level.get_time_hours() if (hrs >= 0) and (hrs < 22) then return true end return false end function relocation_alyosha_2() local squad = get_story_se_object("alyosha_shyogolov_squad") local pos = vector():set( 270.51989746094,27.592041015625,-222.35821533203 ) if (pos and squad) then TeleportSquad(squad,pos,1164066,4693) DI("relocated_alyosha_shyogolov_1") GI("relocated_alyosha_shyogolov_2") end end function relocation_alyosha_3() local squad = get_story_se_object("alyosha_shyogolov_squad") local pos = vector():set( 126.01683807373,-7.3208603858948,190.79092407227 ) if (pos and squad) then TeleportSquad(squad,pos,1182909,4457) DI("relocated_alyosha_shyogolov_2") GI("relocated_alyosha_shyogolov_3") end end function change_faction_erast_1() local npc = get_story_se_object("erast_fandorin") local convert = level.object_by_id(npc.id) local squad = get_story_se_object("erast_fandorin_squad") convert:set_character_community("army", 0, 0 ) db.actor:set_community_goodwill("ecolog", -2000) end function change_faction_erast_2() local npc = get_story_se_object("erast_fandorin") local convert = level.object_by_id(npc.id) local squad = get_story_se_object("erast_fandorin_squad") convert:set_character_community("ecolog", 0, 0 ) end function relocation_erast_fandorin_1() local squad = get_story_se_object("erast_fandorin_squad") local pos = vector():set( 337.31549072266,26.735898971558,-255.1216583252 ) if (pos and squad) then TeleportSquad(squad,pos,1254956,4694) GI("erast_fandorin_relocation_1") end end function relocation_erast_fandorin_2() local squad = get_story_se_object("erast_fandorin_squad") local pos = vector():set( -207.43057250977,-3.7736539840698,71.709953308105 ) if (pos and squad) then TeleportSquad(squad,pos,366212,4486) DI("erast_fandorin_relocation_1") GI("erast_fandorin_relocation_2") end end function nr_ambush_release() local squad_1 = get_story_se_object("nr_ambush_squad_1") local squad_2 = get_story_se_object("nr_ambush_squad_2") local squad_3 = get_story_se_object("nr_ambush_squad_3") local squad_4 = get_story_se_object("nr_ambush_squad_4") local squad_5 = get_story_se_object("nr_ambush_squad_5") local squad_6 = get_story_se_object("nr_ambush_squad_6") local squad_7 = get_story_se_object("nr_ambush_squad_7") local squad_8 = get_story_se_object("nr_ambush_squad_8") local squad_9 = get_story_se_object("erast_fandorin_squad") if (squad_1) then alife_release(squad_1) end if (squad_2) then alife_release(squad_2) end if (squad_3) then alife_release(squad_3) end if (squad_4) then alife_release(squad_4) end if (squad_5) then alife_release(squad_5) end if (squad_6) then alife_release(squad_6) end if (squad_7) then alife_release(squad_7) end if (squad_8) then alife_release(squad_8) end if (squad_9) then if HI("erast_fandorin_dead") then alife_release(squad_9) elseif NI("erast_fandorin_dead") then relocation_erast_fandorin_2() end end news_manager.send_tip(db.actor, game.translate_string("Squads should release"), 1, "ecolog", 11000, 1) end ---- Dolg Butcher ---- function give_meet_aspirin_quest_1() dialogs_brotherhood.give_task('give_meet_aspirin_quest_1') end function give_meet_aspirin_quest_2() dialogs_brotherhood.give_task('give_meet_aspirin_quest_2') end function give_meet_voronin_quest_1() dialogs_brotherhood.give_task('give_meet_voronin_quest_1') end function give_dolg_bloodsucker_village_1() dialogs_brotherhood.give_task('give_dolg_bloodsucker_village_1') end function transfer_dolg_bloodsucker_village_raid_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "batteries_dead", 2) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "device_torch_nv_1") dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "medkit") dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "drug_coagulant", 2) end ---Dolg Hunter botched --- function give_dolg_bloodsucker_village_2() dialogs_brotherhood.give_task('give_dolg_bloodsucker_village_2') end function spawn_artyom_bloodsucker_wounded() local smart_2 = SIMBOARD.smarts_by_names["bar_dolg_general"] local squad = SIMBOARD:create_squad(smart_2,"dolg_artyom_bloodsucker_squad") end function xr_effects.spawn_dolg_sergey_bloodsucker_dead() local pos = vector():set( -281.60269165039,-22.027982711792,193.5417175293 ) local se_obj = alife_create( "dolg_sergey_bloodsucker", pos, 55874, 2029 ) if (se_obj) then se_obj:kill() end if ( not se_obj ) then printe("!ERROR: unable to spawn dolg_sergey_bloodsucker" ) end end function xr_effects.spawn_dolg_vadim_bloodsucker_dead() local pos = vector():set( -228.06121826172,-21.856832504272,210.08169555664 ) local se_obj = alife_create( "dolg_vadim_bloodsucker", pos, 95993, 2055 ) if (se_obj) then se_obj:kill() end if ( not se_obj ) then printe("!ERROR: unable to spawn dolg_vadim_bloodsucker" ) end end function xr_effects.spawn_dolg_sasha_bloodsucker_dead() local pos = vector():set( -300.43096923828,-22.203056335449,290.10729980469 ) local se_obj = alife_create( "dolg_sasha_bloodsucker", pos, 81237, 2058 ) if (se_obj) then se_obj:kill() end if ( not se_obj ) then printe("!ERROR: unable to spawn dolg_sasha_bloodsucker" ) end end function transfer_dolg_bloodsucker_village_killer_patches(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "killer_patch", 3) end function transfer_dolg_bloodsucker_village_botched_money_1(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 15000) end function transfer_dolg_bloodsucker_village_botched_money_2(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 20000) end -- Dolg Hunter payback -- function give_dolg_bloodsucker_village_3() dialogs_brotherhood.give_task('give_dolg_bloodsucker_village_3') end function transfer_morphine_to_artyom(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "morphine") end function is_has_moprhine_artyom() if db.actor:object("morphine") then return true end return false end function artyom_bloodsucker_overdose() local npc = get_story_object("dolg_artyom_bloodsucker") if npc then npc:kill(npc) end end function poluchit_po_ebala(actor, npc, p) local squad = get_story_squad("dolg_ilya_bloodsucker_squad") local commander = alife_object(squad:commander_id()) if squad == nil then printf("There is no squad with id[%s]", tostring(story_id)) return end squad:set_squad_relation("enemy") commander:force_set_goodwill(-5000, actor) npc:force_set_goodwill(-5000, actor) end function poluchit_po_ebala_2(actor, npc, p) local squad = get_story_squad("dolg_ilya_bloodsucker_2_squad") local commander = alife_object(squad:commander_id()) if squad == nil then printf("There is no squad with id[%s]", tostring(story_id)) return end squad:set_squad_relation("enemy") commander:force_set_goodwill(-5000, actor) npc:force_set_goodwill(-5000, actor) end ----Forester ---- function is_has_mutanthammer_actor() if db.actor:object("wpn_saiga12s_mutanthammer") then return true end return false end function transfer_mutanthammer_to_forester(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_saiga12s_mutanthammer") end function transfer_mutanthammer_from_forester(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "wpn_saiga12s_mutanthammer") end ---- Legendary Mutants ---- --- Vlad and Drakul --- function is_has_bloodsucker_hearts_10() local cnt = utils_item.get_amount(db.actor, "mutant_part_heart_bloodsucker") if (cnt >= 5) then return true end return false end function is_night_vlad_drakul() local hrs = level.get_time_hours() if (hrs >= 21) or (hrs < 1) then return true end return false end function is_day_vlad_drakul() local hrs = level.get_time_hours() if (hrs >= 1) and (hrs < 21) then return true end return false end function vlad_drakul_task_reset() DI("forester_news_legendary_1") DI("forester_news_legendary_2") DI("hunt_vlad_drakul_1_init") DI("legendary_bloodsucker_1_dead") DI("forester_news_legendary_3") DI("give_forester_hunt_vlad_drakul_fail") DI("forester_legendary_2_done") end function give_forester_hunt_vlad_drakul() dialogs_brotherhood.give_task('give_forester_hunt_vlad_drakul') end function is_has_trenchcoat_forester() if db.actor:object("trenchcoat_green_outfit_brotherhood_forester") then return true end return false end function transfer_trenchcoat_to_forester(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "trenchcoat_green_outfit_brotherhood_forester") end function transfer_trenchoat_from_forester(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "trenchcoat_green_outfit_brotherhood_forester") end function is_has_trenchcoat_forester_on() if db.actor:item_in_slot(7) ~= nil and db.actor:item_in_slot(7):section() == "trenchcoat_green_outfit_brotherhood_forester" then return true end return false end ---- Vybegallo ---- --- Quest 1 -- function give_vybegallo_pseudogiant() dialogs_brotherhood.give_task('give_vybegallo_pseudogiant') end function is_has_eye_vybegallo() if db.actor:object("mutant_part_pseudogigant_eye") then return true end return false end function transfer_eye_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "mutant_part_pseudogigant_eye") end function is_has_hand_vybegallo() if db.actor:object("mutant_part_pseudogigant_hand") then return true end return false end function transfer_hand_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "mutant_part_pseudogigant_hand") end function is_has_hide_vybegallo() if db.actor:object("hide_pseudogiant") then return true end return false end function transfer_hide_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "hide_pseudogigant") end function is_has_fracture_vybegallo() local cnt = utils_item.get_amount(db.actor, "mutant_part_fracture_hand") if (cnt >= 2) then return true end return false end function transfer_fracture_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "mutant_part_fracture_hand", 2) end function is_has_bloodsucker_vybegallo() if db.actor:object("mutant_part_heart_bloodsucker") then return true end return false end function transfer_bloodsucker_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "mutant_part_heart_bloodsucker") end function transfer_reward_from_vybegallo_parts(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 10000) end function give_sakharov_order_vybegallo_quest() dialogs_brotherhood.give_task('give_sakharov_order_vybegallo_quest') end function is_has_order_for_vybegallo() if db.actor:object("sakharov_order_vybegallo") then return true end return false end function transfer_sakharov_order_vybegallo_to_actor(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sakharov_order_vybegallo") end function transfer_sakharov_order_to_vybegallo(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "sakharov_order_vybegallo") end function hiding_vybegallo() local squad = get_story_se_object("vybegallo_squad") local pos = vector():set( 42.025260925293,10.499049186707,16.939895629883 ) if (pos and squad) then TeleportSquad(squad,pos,3591,3715) GI("vybegallo_hiding") end end function give_vybegallo_satisfied_man() dialogs_brotherhood.give_task('give_vybegallo_satisfied_man') end function transfer_vybegallo_satisfied_man_prototype(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "af_grid_prototype") end ---in news_tips_icons Sakharov is written Saharov--- function sakharov_vybegallo_1_info() news_manager.send_tip(db.actor, game.translate_string("st_sakharov_vybegallo_1_info"), 3, "saharov", 11000, 1) end function xr_effects.spawn_vybegallo_order_mercenary() local pos = vector():set( 348.31338500977,34.241146087646,-398.91174316406 ) alife():create('vybegallo_order_mercenary', pos, 1546321, 4138) end function xr_effects.spawn_vybegallo_order_mercenary_2() local pos = vector():set( -33.994609832764,2.2611196041107,37.711166381836 ) alife():create('vybegallo_order_mercenary', pos, 112749, 2391) end function is_has_vybegallo_order_mercenary() if db.actor:object("vybegallo_order_mercenary") then return true end return false end function transfer_vybegallo_order_mercenary(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vybegallo_order_mercenary") end function transfer_hush_money_vybegallo(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 5000) end function give_vybegallo_must_die() dialogs_brotherhood.give_task('give_vybegallo_must_die') end ---- Escape ---- ---Sidorovich--- function give_sidorovich_railway_assault() dialogs_brotherhood.give_task('give_sidorovich_railway_assault') end function transfer_grenade_railway_assault(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "grenade_f1") end function is_has_no_grenade_railway_assault() if db.actor:object("grenade_f1") or db.actor:object("grenade_rgd5") then return false end return true end function is_has_vodka_for_grenade_assault_1() if db.actor:object("bottle_metal") then return true end return false end function is_has_vodka_for_grenade_assault_2() if db.actor:object("vodka") then return true end return false end function is_has_vodka_for_grenade_assault_3() if db.actor:object("vodka2") then return true end return false end function is_has_vodka_for_grenade_assault_4() if db.actor:object("vodka_quality") then return true end return false end function transfer_vodka_for_grenade_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "bottle_metal", 1) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 5}) end function transfer_vodka_for_grenade_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka", 1) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 10}) end function transfer_vodka_for_grenade_3(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka2", 1) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 15}) end function transfer_vodka_for_grenade_4(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka_quality", 1) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 30}) end function send_railway_assault_message_1() news_manager.send_tip(db.actor, game.translate_string("st_assault_railway_info_1"), 1, "stalker", 11000, 1) news_manager.send_tip(db.actor, game.translate_string("st_assault_railway_info_2"), 4, "csky", 11000, 1) end function give_sidorovich_railway_assault_2() dialogs_brotherhood.give_task('give_sidorovich_railway_assault_2') end -- Fake Artifact-- function transfer_fake_artifact_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "af_gold_fish_fake_1") end function is_has_fake_artifact_1() if db.actor:object("af_gold_fish_fake_1") then return true end return false end function transfer_fake_artifact_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "af_gold_fish_fake_1") end function transfer_fake_artifact_3(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "af_gold_fish_fake_2_lead_box") end function give_sidorovich_fake_artifact_1() dialogs_brotherhood.give_task('give_sidorovich_fake_artifact_1') end function transfer_money_sidorovich_bribe(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 10000) end function give_tambov_debt_1() dialogs_brotherhood.give_task('give_tambov_debt_1') end function xr_effects.tambov_debt_1_info() news_manager.send_tip(db.actor, game.translate_string("st_tambov_debt_1_info"), 3, "default", 11000, 1) news_manager.send_tip(db.actor, game.translate_string("st_tambov_debt_2_info"), 6, "ecolog", 11000, 1) end ---- Shlitzer function give_shlitzer_smuggling_1() dialogs_brotherhood.give_task('give_shlitzer_smuggling_1') end function transfer_money_shlitzer_reward(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 8000) end function transfer_shlitzer_smuggling_bag_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "quest_package_shlitzer") end function transfer_shlitzer_smuggling_bag_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_shlitzer") dialogs.relocate_money_to_actor(first_speaker, second_speaker, 8000) end function transfer_shlitzer_smuggling_bag_3(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_shlitzer") end function give_shlitzer_smuggling_2() dialogs_brotherhood.give_task('give_shlitzer_smuggling_2') end function transfer_shlitzer_smuggling_case_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "quest_package_shlitzer_2") end function transfer_shlitzer_smuggling_case_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_shlitzer_2") end function is_has_shlitzer_bag_1() if db.actor:object("quest_package_shlitzer") then return true end return false end function is_has_shlitzer_case_1() if db.actor:object("quest_package_shlitzer_2") then return true end return false end function change_faction_bh_ironchain() local npc = get_story_se_object("bh_ironchain") local convert = level.object_by_id(npc.id) convert:set_character_community("bandit", 0, 0 ) local squad = get_story_squad("bh_ironchain_2_squad") local commander = alife_object(squad:commander_id()) if squad == nil then printf("There is no squad with id[%s]", tostring(story_id)) return end squad:set_squad_relation("enemy") commander:force_set_goodwill(-5000, actor) npc:force_set_goodwill(-5000, actor) end function give_shlitzer_smuggling_3() dialogs_brotherhood.give_task('give_shlitzer_smuggling_3') end function xr_effects.reset_bh_badger_logic() DI("bh_shlitzer_smuggling_done") DI("bh_shlitzer_smuggling_start") DI("bh_shlitzer_smuggling_1") DI("bh_shlitzer_smuggling_2") DI("bh_shlitzer_smuggling_3") DI("bh_shlitzer_smuggling_4") DI("bh_badger_deal_done") news_manager.send_tip(db.actor, game.translate_string("Reset works, don't forget to delete this"), nil, "communication", 6000) end function relocation_pollox_and_castor() local squad = get_story_se_object("csky_assault_esc_5_7_leader") local squad_2 = get_story_se_object("stalker_assault_esc_5_9_leader") local pos_1 = vector():set( 5.9352240562439,0.86977106332779,295.33111572266 ) local pos_2 = vector():set( 3.3982691764832,0.87022680044174,295.80453491211 ) if (pos_1 and squad) then TeleportSquad(squad,pos_1,309330,442) end if (pos_2 and squad_2) then TeleportSquad(squad_2,pos_2,306528,446) end GI("castor_pollox_relocation_init") end function bh_smuggling_player_execution() local pos_1 = vector():set( -134.43222045898,-30.139472961426,-393.75299072266 ) --- exec 1 local pos_2 = vector():set( -137.74774169922,-30.139163970947,-393.99801635742 ) --- exec 2 local se_squad = spawn_squad("bh_lockdown_execution_squad", pos_1, 120479, 373) local se_squad_2 = spawn_squad("bh_lockdown_execution_squad_2", pos_2, 116478, 373) local out_position = vector():set( -135.63259887695,-30.247434616089,-399.60668945313 ) db.actor:set_actor_position(out_position) end function give_tambov_debt_2() dialogs_brotherhood.give_task('give_tambov_debt_2') end function transfer_money_tambov(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 10000) end function tambov_5000_money(first_speaker, second_speaker) return first_speaker:money() >= 5000 end function tambov_5000_money_pay(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 5000) end function tambov_17500_money(first_speaker, second_speaker) return first_speaker:money() >= 17500 end function tambov_17500_money_pay(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 17500) end --- Sakharov and other scientists --- function sakharov_fake_artifact_money_pay(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 10000) end function sakharov_fake_artifact_has_money(first_speaker, second_speaker) return first_speaker:money() >= 10000 end function is_has_fake_artifact_2() if db.actor:object("af_gold_fish_fake_2_lead_box") then return true end return false end function transfer_fake_artifact_box_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "af_gold_fish_fake_2_lead_box") end -----Market Share ----- function give_meet_marlo_chris_quest_1() dialogs_brotherhood.give_task('give_meet_marlo_chris_quest_1') end function give_meet_marlo_chris_quest_2() dialogs_brotherhood.give_task('give_meet_marlo_chris_quest_2') end function give_meet_marlo_chris_quest_3() dialogs_brotherhood.give_task('give_meet_marlo_chris_quest_3') end function marlo_stanfield_start_dialog_3(speaker, listener) return string.format(game.translate_string("marlo_stanfield_start_dialog_3"), alife():actor():character_name()) end function transfer_drinking_marlo_1(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 2000) end function has_drinking_hawaiian_1(first_speaker, second_speaker) return first_speaker:money() >= 2000 end function transfer_drinking_hawaiian_1(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 2000) end function ms_sidorovich_beatup(first_speaker, second_speaker) local actor = dialogs.who_is_actor(first_speaker, second_speaker) if (actor.health < 0.1) then local hit_power_ms = 0.01 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) elseif (actor.health >= 0.1) and (actor.health < 0.15) then local hit_power_ms = 0.07 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) elseif (actor.health >= 0.15) and (actor.health < 0.25) then local hit_power_ms = 0.1 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) elseif (actor.health >= 0.25) and (actor.health < 0.5) then local hit_power_ms = 0.2 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) elseif (actor.health >= 0.5) and (actor.health < 0.75) then local hit_power_ms = 0.3 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) elseif (actor.health >= 0.75) then local hit_power_ms = 0.4 local h = hit() h.direction = VEC_ZERO h.draftsman = actor h.type = hit.shock h:bone("bip01_spine") h.power = hit_power_ms h.impulse = 0.001 actor:hit(h) end end ---Start Up--- function give_marlo_pda() dialogs_brotherhood.give_task('give_marlo_pda') end function is_has_mercenary_pda_marlo() if db.actor:object("itm_pda_mercenary_1") then return true end return false end function transfer_mercenary_pda_to_chris(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "itm_pda_mercenary_1") end function give_intercept_courrier_1() dialogs_brotherhood.give_task('give_intercept_courrier_1') end function xr_effects.zaton_mercenary_courrier_deathrattle() news_manager.send_tip(db.actor, game.translate_string("st_zaton_mercenary_courrier_deathrattle_info"), 0, "killer", 11000, 1) end function is_has_mercenary_usb_marlo() if db.actor:object("itm_usb_mercenary_1") then return true end return false end function transfer_broken_mercenary_pda_to_actor(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "broken_pda") end function transfer_broken_mercenary_pda_from_actor(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "broken_pda") end function transfer_new_mercenary_pda_to_actor(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "device_pda_1") end function transfer_mercenary_usb_to_chris(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "itm_usb_mercenary_1") end function transfer_mercenary_usb_back(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "itm_usb_mercenary_1") end function give_intercept_courrier_2() dialogs_brotherhood.give_task('give_intercept_courrier_2') end function give_intercept_delivery_1() dialogs_brotherhood.give_task('give_intercept_delivery_1') end function xr_effects.spawn_reinforcment_mercenary_1() local smart = SIMBOARD.smarts_by_names["jup_b202"] local squad = SIMBOARD:create_squad(smart,"jupiter_mercenary_2_squad") news_manager.send_tip(db.actor, game.translate_string("st_chris_asset_interception_info_2"), 2, "stalker", 11000, 1) end function xr_effects.spawn_mercenary_supplies_1() local pos = vector():set( 157.05603027344,1.2640976905823,218.27989196777 ) local se_obj = alife_create("quest_package_mercenary_1", pos, 983812, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_1" ) end end function xr_effects.spawn_mercenary_supplies_2() local pos = vector():set( 158.90191650391,1.2653551101685,218.26203918457 ) local se_obj = alife_create("quest_package_mercenary_2", pos, 987409, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_2" ) end end function xr_effects.spawn_mercenary_supplies_3() local pos = vector():set( 160.69065856934,1.2892243862152,218.36166381836 ) local se_obj = alife_create("quest_package_mercenary_3", pos, 991009, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_3" ) end end function xr_effects.spawn_mercenary_supplies_4() local pos = vector():set( 157.33737182617,1.2653121948242,215.8713684082 ) local se_obj = alife_create("quest_package_mercenary_4", pos, 984999, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_4" ) end end function xr_effects.spawn_mercenary_supplies_5() local pos = vector():set( 159.13275146484,1.2654616832733,216.0887298584 ) local se_obj = alife_create("quest_package_mercenary_5", pos, 987406, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_5" ) end end function xr_effects.spawn_mercenary_supplies_6() local pos = vector():set( 160.92427062988,1.2653577327728,216.09620666504 ) local se_obj = alife_create("quest_package_mercenary_6", pos, 991006, 4493 ) if ( not se_obj ) then printe("!ERROR: unable to spawn quest_package_mercenary_6" ) end end function is_has_chris_mercenary_supply_1() if db.actor:object("quest_package_mercenary_1") then return true end return false end function is_has_chris_mercenary_supply_2() if db.actor:object("quest_package_mercenary_2") then return true end return false end function is_has_chris_mercenary_supply_3() if db.actor:object("quest_package_mercenary_3") then return true end return false end function is_has_chris_mercenary_supply_4() if db.actor:object("quest_package_mercenary_4") then return true end return false end function is_has_chris_mercenary_supply_5() if db.actor:object("quest_package_mercenary_5") then return true end return false end function is_has_chris_mercenary_supply_6() if db.actor:object("quest_package_mercenary_6") then return true end return false end function transfer_chris_mercenary_supply_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_1") end function transfer_chris_mercenary_supply_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_2") end function transfer_chris_mercenary_supply_3(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_3") end function transfer_chris_mercenary_supply_4(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_4") end function transfer_chris_mercenary_supply_5(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_5") end function transfer_chris_mercenary_supply_6(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "quest_package_mercenary_6") end --- Owl documents --- function xr_effects.spawn_ms_owl_documents_1() local pos = vector():set( 447.71743774414,32.602996826172,-455.80853271484 ) alife():create('ms_owl_documents_1', pos, 1427937, 4700) end function is_has_ms_owl_documents_1_owl() if db.actor:object("ms_owl_documents_1") then return true end return false end function transfer_ms_owl_documents_1_to_owl(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "ms_owl_documents_1") end function give_hostile_takeover_main() dialogs_brotherhood.give_task('give_hostile_takeover_main') end function give_diplomatic_takeover_main() dialogs_brotherhood.give_task('give_diplomatic_takeover_main') end --- What a Night --- function give_what_a_night() dialogs_brotherhood.give_task('give_what_a_night') end function create_stash_and_transfer_items() --- courtesy of xcvb local se_obj = alife_create("inv_backpack", db.actor:position(), db.actor:level_vertex_id(), db.actor:game_vertex_id()) if se_obj then local txt = strformat(game.translate_string("st_itm_stash_of_character"), db.actor:character_name()) level.map_add_object_spot_ser(se_obj.id, "treasure", txt) local m_data = alife_storage_manager.get_state() if not (m_data.player_created_stashes) then m_data.player_created_stashes = {} end local bp = db.actor:item_in_slot(13) m_data.player_created_stashes[se_obj.id] = bp:section() alife_release_id(bp:id()) CreateTimeEvent("transfer_to_bp_e", "transfer_to_bp_a", 0.5, transf_itms, se_obj.id) end end function transf_itms(stash_id) --- courtesy of xcvb local stash = level.object_by_id(stash_id) if stash then local function itr(_, itm) if not (string.find(itm:section(), "outfit")) then db.actor:transfer_item(itm, stash) end end db.actor:iterate_inventory(itr, db.actor) end return true end function blackout_drink() xr_effects.disable_ui_only(db.actor, nil) level.add_cam_effector("camera_effects\\surge_02.anm", 10, false, "bind_stalker_ext.anabiotic_callback") level.add_pp_effector("surge_fade.ppe", 11, false) _G.mus_vol = get_console_cmd(2,"snd_volume_music") _G.amb_vol = get_console_cmd(2,"snd_volume_eff") exec_console_cmd("snd_volume_music 0") exec_console_cmd("snd_volume_eff 0") level.change_game_time(0,10,0) surge_manager.get_surge_manager().time_forwarded = true psi_storm_manager.get_psi_storm_manager().time_forwarded = true level_weathers.get_weather_manager():forced_weather_change() end function blackout_teleportation() local out_position = vector():set( 293.83453369141,0.39302235841751,25.673402786255 ) db.actor:set_actor_position(out_position) end function xr_effects.spawn_blackout_knife() local pos = vector():set( 290.24829101563,0.66161745786667,24.540012359619 ) alife():create('wpn_knife3', pos, 328476, 189) end function xr_effects.spawn_blackout_shotgun() local pos = vector():set( 297.06683349609,-0.20075908303261,24.5491065979 ) alife():create('wpn_bm16', pos, 333148, 189) end function drink_with_me() level.add_cam_effector("camera_effects\\drunk.anm", 10, false, "bind_stalker_ext.anabiotic_callback") end function give_zakuski_drinking(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "sausage") end function is_has_blackout_backpack() if db.actor:item_in_slot(13) ~= nil then return true end return false end ----- Rush to the North ---- function give_barman_brainscorcher_1(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "vodka_quality", 1) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 25}) end --- Scamlok --- function spawn_scamlok_1() local smart_2 = SIMBOARD.smarts_by_names["bar_dolg_general"] local squad = SIMBOARD:create_squad(smart_2,"nr_scamlok_squad") end function is_has_scamlok_money_1(first_speaker, second_speaker) return first_speaker:money() >= 10000 end function is_has_scamlok_money_2(first_speaker, second_speaker) return first_speaker:money() >= 20000 end function pay_scamlok_1(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 10000) end function pay_scamlok_2(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 20000) end function give_barman_scamlok_sad(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "vodka", 1) end function scamlok_flees_1() local squad_1 = get_story_se_object("nr_scamlok_squad") if (squad_1) then alife_release(squad_1) end end function give_task_join_scamlok_1() dialogs_brotherhood.give_task('give_task_join_scamlok_1') end function give_task_escort_sorokin_1() dialogs_brotherhood.give_task('give_task_escort_sorokin_1') end function give_money_escort_sorokin_1(first_speaker, second_speaker) dialogs.relocate_money_to_actor(first_speaker, second_speaker, 8000) end function give_back_money_escort_sorokin_1(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 8000) xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", 10}) end function is_has_sorokin_money_1(first_speaker, second_speaker) return first_speaker:money() >= 8000 end --- Fanatic --- function give_task_fanat_rookie_training_1() dialogs_brotherhood.give_task('give_task_fanat_rookie_training_1') end function is_has_echo_fanatic_rookie_1() if db.actor:object("detector_simple") then return true end return false end function is_has_vodka_fanatic_rookie_1() if db.actor:object("vodka") then return true end return false end function is_has_container_fanatic_rookie_1() if db.actor:object("lead_box") then return true end return false end function is_has_shotgun_fanatic_rookie_2() local cnt = utils_item.get_amount(db.actor, "ammo_12x70_buck") if (cnt >= 20) then return true end return false end function transfer_rookie_detector_fanatic_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "detector_simple") end function transfer_rookie_ammo_fanatic_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "ammo_12x70_buck", 2) end function transfer_rookie_vodka_fanatic_3(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka") end function transfer_rookie_container_fanatic_2(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "lead_box") end function nr_iliaz_scam_money(first_speaker, second_speaker) return first_speaker:money() >= 1000 end function transfer_rookie_scam_fanatic_2(first_speaker, second_speaker) dialogs.relocate_money_from_actor(first_speaker, second_speaker, 1000) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "af_cristall_flower_lead_box") xr_effects.inc_faction_goodwill_to_actor(db.actor, nil, {"stalker", -150}) end ----- Strange Meat ------ function give_task_nr_strange_meat() dialogs_brotherhood.give_task('give_task_nr_strange_meat') end function is_has_strange_meat() if db.actor:object("kolbasa_strange") then return true end return false end function is_has_strange_meat_unpacked() if db.actor:object("kolbasa_strange_unpacked") then return true end return false end function is_has_strange_meat_tried() if db.actor:object("kolbasa_strange_tried") then return true end return false end function is_has_strange_meat_tried_unpacked() if db.actor:object("kolbasa_strange_tried_unpacked") then return true end return false end function is_has_yak_bullet() if db.actor:object("bullet_yak") then return true elseif db.actor:object("bullet_yak_identify") then return true end return false end function is_has_yak_bullet_2() if db.actor:object("bullet_yak_identify") then return true end return false end function transfer_yak_bullet_1(first_speaker, second_speaker) dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "bullet_yak") end function transfer_yak_bullet_2(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "bullet_yak_identify") end function xr_effects.spawn_yak_dead() local pos = vector():set( -149.38208007813,-23.090442657471,-182.3323059082 ) local se_obj = alife_create( "nr_dead_convict_2", pos, 644285, 4444 ) if (se_obj) then se_obj:kill() end if ( not se_obj ) then printe("!ERROR: unable to spawn nr_dead_convict_2" ) end end function use_item_strange_meat_1(obj, _, cf) --- curtesy of NLTP Ashes if (obj:section() ~= "kolbasa_strange") then return end GI("nr_tasted_strange_meat") news_manager.send_tip(db.actor, game.translate_string("st_strange_meat_taste_1"), nil, "communication", 6000) alife_create_item("kolbasa_strange_tried", db.actor) end function use_item_strange_meat_1_2(obj, _, cf) if (obj:section() ~= "kolbasa_strange_tried") then return end news_manager.send_tip(db.actor, game.translate_string("st_strange_meat_taste_2"), nil, "communication", 6000) end function use_item_strange_meat_2(obj, _, cf) if (obj:section() ~= "kolbasa_strange_unpacked") then return end GI("nr_tasted_strange_meat") news_manager.send_tip(db.actor, game.translate_string("st_strange_meat_taste_1"), nil, "communication", 6000) alife_create_item("kolbasa_strange_tried_unpacked", db.actor) end function use_item_strange_meat_2_2(obj, _, cf) if (obj:section() ~= "kolbasa_strange_tried_unpacked") then return end news_manager.send_tip(db.actor, game.translate_string("st_strange_meat_taste_2"), nil, "communication", 6000) end function use_item_radio_micro_quest(obj, _, cf) if (obj:section() ~= "radio_micro_quest") then return end news_manager.send_tip(db.actor, game.translate_string("st_strange_meat_taste_2"), nil, "communication", 6000) end ---- Bezsonik ---- function give_task_bezsonik_1() dialogs_brotherhood.give_task('give_task_bezsonik_1') end function nr_bezsonik_0(speaker, listener) if HI("bezsonik_dogs_sleep") and NI("bezsonik_dogs_reward") then return string.format(game.translate_string("nr_bezsonik_0_1")) end if HI("bezsonik_dogs_sleep") and HI("bezsonik_dogs_reward") then return string.format(game.translate_string("nr_bezsonik_0_2")) end if HI("bezsonik_dogs_nosleep") then return string.format(game.translate_string("nr_bezsonik_0_3")) end end function give_reward_nr_bezsonik_1(first_speaker, second_speaker) if HI("bezsonik_dogs_sleep") and NI("bezsonik_dogs_reward") then dialogs.relocate_money_to_actor(first_speaker, second_speaker, 5000) end if HI("bezsonik_dogs_sleep") and HI("bezsonik_dogs_reward") then dialogs.relocate_money_to_actor(first_speaker, second_speaker, 5000) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "vodka2") dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "kolbasa") end if HI("bezsonik_dogs_nosleep") then dialogs.relocate_money_to_actor(first_speaker, second_speaker, 2000) end end ------Random events ----- --- Gutalin function relocation_bh_gutalin() local squad = get_story_se_object("bh_gutalin_squad") local pos = vector():set( -206.23277282715,-19.894157409668,-136.4208984375 ) if (pos and squad) then TeleportSquad(squad,pos,46472,453) GI("bh_gutalin_relocation_init") end end function give_task_bh_gutalin_1() dialogs_brotherhood.give_task('give_task_bh_gutalin_1') end --- Primakov function nr_primakov_turn() local npc = get_story_se_object("controller_victim_1") local convert = level.object_by_id(npc.id) convert:set_character_community("zombied", 0, 0 ) end function nr_dead_convict_1_turn() local npc = get_story_se_object("nr_dead_convict_1") local convert = level.object_by_id(npc.id) convert:set_character_community("bandit", 0, 0 ) end function nr_dead_convict_2_turn() local npc = get_story_se_object("nr_dead_convict_2") local convert = level.object_by_id(npc.id) convert:set_character_community("bandit", 0, 0 ) end function transfer_sasha_baltun_vodka(first_speaker, second_speaker) dialogs.relocate_item_section_to_actor(first_speaker, second_speaker, "vodka2") end function relocation_nr_sasha_baltun_murder() local squad = get_story_se_object("nr_sasha_baltunov_squad") local pos = vector():set( 115.9564666748,-0.0015365779399872,49.205066680908 ) if (pos and squad) then TeleportSquad(squad,pos,33791,1759) GI("nr_baltunov_init_murder") end end function nr_sasha_baltun_murder() local squad = get_story_squad("nr_sasha_baltunov_squad") if squad and squad.commander_id then for m in squad:squad_members() do local se_npc = alife_object(m.id) if se_npc and se_npc:alive() then se_npc:kill() GI("nr_baltunov_init_murder_done") end end end end --- Like Rats in a trap function give_like_rats_trap_1() dialogs_brotherhood.give_task('give_like_rats_trap_1') end function bh_intimidate_check_1() local rank = db.actor:character_rank() local intimidate_value = ((rank/100) + math.random(1, 50)) if intimidate_value >= 121 then else end end function bh_persuade_check_1() local reputation = db.actor:character_reputation() local reputation_value = ((reputation/10) +math.random(1, 50)) if reputation_value >= 131 then else end end