function swm_mar_boar_old_hunt_quest_start()
task_manager.get_task_manager():give_task("mar_boar_old_hunt_quest_give")
end
function is_has_mar_boar_old_dead(first_speaker, second_speaker)
if has_alife_info("mar_boar_old_dead")
and not has_alife_info("mar_boar_old_hunt_quest_done") then
return false
end
return true
end

function kill_bib_quest_start()
task_manager.get_task_manager():give_task("kill_bib_quest_give")
end

function esc_patron_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "medkit", "in",4) 
end
function esc_patron_2(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "bandage", "in",2) 
end
function esc_patron_3(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "antirad", "in",1) 
end

function quest_esc_texnik_give() 
task_manager.get_task_manager():give_task("quest_esc_texnik_give") 
end 
function is_has_esc_texnik() 
if db.actor:object("toolkit_1") then 
return true 
end 
return false 
end 
function transfer_esc_texnik(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "toolkit_1") 
end 
function esc_texnik_30(first_speaker, second_speaker) 
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 30) 
end
function esc_texnik_300(first_speaker, second_speaker) 
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 30000) 
end
function esc_texnik_3001(first_speaker, second_speaker) 
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 10000) 
end
function quest_esc_povor_give() 
task_manager.get_task_manager():give_task("quest_esc_povor_give") 
end 

function is_has_esc_povor(first_speaker, second_speaker) 
local item_sections = {"bread_1"} 
local needed = 1
local count = 0 
local item_section 
local function calc(temp, item) 
if item:section() == item_section then 
count = count + 1 
end 
end 
for k,v in pairs(item_sections) do 
item_section = v 
get_story_object("actor"):iterate_inventory(calc, actor) 
end 
return count >= needed 
end

function transfer_esc_povor(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "bread_1") 
end 
function esc_povor_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "wpn_knife", "in") 
end
function esc_povor_2(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "conserva", "in",10) 
end
function quest_esc_plenn_give() 
task_manager.get_task_manager():give_task("quest_esc_plenn_give") 
end 
function is_has_esc_plenn() 
if db.actor:object("wpn_gp100") then 
return true 
end 
return false 
end 
function transfer_esc_plenn(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_gp100") 
end 
function esc_plenn_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "af_baloon", "in") 
end
function esc_plenn_2(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "af_gold_fish", "in") 
end
function quest_esc_torg_give() 
task_manager.get_task_manager():give_task("quest_esc_torg_give") 
end 
function is_has_esc_torg() 
if db.actor:object("pda_1") then 
return true 
end 
return false 
end 
function transfer_esc_torg(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_1") 
end 
function spawn_esc_doc_1()
alife():create("esc_torg_11",vector():set(-11.430244445801,1.7665830850601,292.22283935547),287037,1053)
end
function spawn_instr_1()
alife():create("toolkit_1",vector():set(-140.64262390137,-25.432380752563,-354.04559326172),114052,990)
end
function spawn_esc_pda_1()
alife():create("pda_1",vector():set(-140.74710083008,-28.669309616089,-352.76620483398),114868,990)
end
function spawn_esc_burer_1()
alife():create("burer_normal",vector():set(-141.15826416016,-29.692588806152,-362.24981689453),112425,990)
end
function transfer_esc_torg_1(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "esc_torg_11") 
end 
function transfer_esc_torg_11(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "esc_torg_22") 
end 
function transfer_esc_torg_22(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "esc_torg_33") 
end 

function esc_kontroller_start()
task_manager.get_task_manager():give_task("esc_kontroller_give")
end
function esc_kontroller_dead(first_speaker, second_speaker)
if has_alife_info("esc_kontroller_dead")
and not has_alife_info("esc_kontroller_done") then
return false
end
return true
end
function spawn_esc_doc_2()
alife():create("esc_torg_22",vector():set(-11.430244445801,1.7665830850601,292.22283935547),287037,1053)
end
function spawn_esc_doc_3()
alife():create("esc_torg_33",vector():set(-11.430244445801,1.7665830850601,292.22283935547),287037,1053)
end


function spawn_esc_naem_1() 
local x= 325.93200683594
local y= 18.072984695435
local z= 271.58459472656
local level_vertex= 606950
local game_vertex_id= 1197
alife():create("esc_naem_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_naem_2() 
local x= 325.93200683594
local y= 18.072984695435
local z= 271.58459472656
local level_vertex= 606950
local game_vertex_id= 1197
alife():create("esc_naem_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_naem_3() 
local x= 325.93200683594
local y= 18.072984695435
local z= 271.58459472656
local level_vertex= 606950
local game_vertex_id= 1197
alife():create("esc_naem_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_naem_4() 
local x= 325.93200683594
local y= 18.072984695435
local z= 271.58459472656
local level_vertex= 606950
local game_vertex_id= 1197
alife():create("esc_naem_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_naem_5() 
local x= 325.93200683594
local y= 18.072984695435
local z= 271.58459472656
local level_vertex= 606950
local game_vertex_id= 1197
alife():create("esc_naem_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end
function esc_naemnik_start()
task_manager.get_task_manager():give_task("esc_naemnik_give")
end
function esc_naemnik_dead(first_speaker, second_speaker)
if has_alife_info("esc_naemnik_dead")
and not has_alife_info("esc_naemnik_done") then
return false
end
return true
end
 function quest_esc_medic_give() 
task_manager.get_task_manager():give_task("quest_esc_medic_give") 
end 
function is_has_esc_medic() 
if db.actor:object("apt_1") then 
return true 
end 
return false 
end 
function transfer_esc_medic(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "apt_1") 
end 

 function quest_esc_glava_pda_give() 
task_manager.get_task_manager():give_task("quest_esc_glava_pda_give") 
end 
function is_has_esc_glava_pda() 
if db.actor:object("pda_2") then 
return true 
end 
return false 
end 
function transfer_esc_glava_pda(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "pda_2") 
end 
 function quest_esc_glava_vss_give() 
task_manager.get_task_manager():give_task("quest_esc_glava_vss_give") 
end 
function is_has_esc_glava_vss() 
if db.actor:object("wpn_vintorez_nimble") then 
return true 
end 
return false 
end 
function transfer_esc_glava_vss(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_vintorez_nimble") 
end 
function esc_giga_start()
task_manager.get_task_manager():give_task("esc_giga_give")
end
function esc_giga_dead(first_speaker, second_speaker)
if has_alife_info("esc_giga_dead")
and not has_alife_info("esc_giga_done") then
return false
end
return true
end
function spawn_esc_giga()
alife():create("esc_giga",vector():set(135.5623626709,0.18303462862968,339.67684936523),468748,1165)
end
function esc_giga_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "wpn_rpg7", "in") 
end
function transfer_esc_glava_giga(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_rpg7") 
end 
 function quest_esc_glava_af_give() 
task_manager.get_task_manager():give_task("quest_esc_glava_af_give") 
end 
function is_has_esc_glava_af() 
if db.actor:object("af_medusa") then 
return true 
end 
return false 
end 
function transfer_esc_glava_af(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "af_medusa") 
end 
function spawn_esc_af()
alife():create("af_medusa",vector():set(-260.59439086914,-12.692893981934,-29.340002059937),8411,953)
end
function esc_det_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "detector_simple", "in") 
end
function transfer_esc_glava_af_1(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "detector_simple") 
end 
function is_has_esc_glava_af_1() 
if db.actor:object("detector_simple") then 
return true 
end 
return false 
end 

local ObjId=0
function esc_yan_1()
    local obj= alife():create("pda_yan_33",vector():set(324.11236572266,17.135133743286,349.58361816406),602942,1196)
    local text = "Jantarba"
    level.map_add_object_spot_ser(obj.id, "level_changer_up", text)
    ObjId=obj.id 
end

function esc_kpp_12(actor, npc) 
local actor = db.actor 
all_money_actor = actor:money() 
if actor and npc then 
dialogs.relocate_money(npc, 1000, "out") 
end 
end 
function quest_esc_alkah_give() 
task_manager.get_task_manager():give_task("quest_esc_alkah_give") 
end 
function is_has_esc_alkah() 
if db.actor:object("vodka") then 
return true 
end 
return false 
end 
function transfer_esc_alkah(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "vodka") 
end 
function esc_alkah_22(first_speaker, second_speaker) 
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 1000) 
end
function esc_alkah_33(first_speaker, second_speaker) 
dialogs.relocate_money_to_actor(first_speaker, second_speaker, 1000) 
end

function quest_esc_start_give() 
task_manager.get_task_manager():give_task("quest_esc_start_give") 
end 
function is_has_esc_start() 
if db.actor:object("mil_serega_4") then 
return true 
end 
return false 
end 
function transfer_esc_start(first_speaker, second_speaker) 
dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "mil_serega_4") 
end 
function spawn_esc_start()
alife():create("mil_serega_4",vector():set(136.5694732666,29.333822250366,239.77165222168),365077,707)
end

function spawn_esc_snork_1()
alife():create("snork_indoor_normal",vector():set(-78.379409790039,-1.3286527395248,147.84111022949),195660,1020)
end

function spawn_esc_boec_1() 
local x= -223.45654296875
local y= -32.349319458008
local z= -238.30917358398
local level_vertex= 32301
local game_vertex_id= 952
alife():create("esc_boec_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_boec_2() 
local x= -217.24728393555
local y= -32.978202819824
local z= -240.99870300293
local level_vertex= 36806
local game_vertex_id= 952
alife():create("esc_boec_2",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_boec_3() 
local x= -220.73767089844
local y= -34.130706787109
local z= -255.33279418945
local level_vertex= 36790
local game_vertex_id= 952
alife():create("esc_boec_1",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_boec_4() 
local x= -229.18225097656
local y= -28.029821395874
local z= -219.55651855469
local level_vertex= 27789
local game_vertex_id= 952
alife():create("esc_boec_2",vector():set(x,y,z),level_vertex,game_vertex_id) 
end 
 
function save_variable(variable_name, value) 
xr_logic.pstor_store(db.actor, variable_name, value) 
end 
function load_variable(variable_name, value_if_not_found) 
return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) 
end

function spawn_esc_boar_1()
alife():create("boar_strong",vector():set(194.40100097656,2.5215125083923,330.28787231445),519694,1181)
end
function spawn_esc_pda_2()
alife():create("pda_2",vector():set(141.11882019043,3.2700204849243,338.46084594727),474814,1171)
end
function spawn_esc_flesh_1()
alife():create("flesh_strong",vector():set(133.6589050293,-0.007051020860672,341.14437866211),466723,1165)
end
function spawn_esc_dog_1()
alife():create("dog_strong",vector():set(-213.33973693848,-9.3292989730835,-40.493034362793),40452,953)
end
function spawn_esc_kros_1()
alife():create("bloodsucker_normal",vector():set(78.321212768555,1.6859823465347,555.20343017578),403160,1135)
end

local ObjId=0
function esc_yan_2()
    local obj= alife():create("pda_yan_22",vector():set(173.37060546875,-1.9845713376999,88.336334228516),141038,1723)
    local text = "A Kordonra"
    level.map_add_object_spot_ser(obj.id, "level_changer_up", text)
    ObjId=obj.id 
end

function spawn_xleb()
alife():create("bread_1",vector():set(86.538833618164,1.0459922552109,-11.904407501221),101991,1697)
end
function spawn_xleb_1()
alife():create("bloodsucker_normal",vector():set(86.538833618164,1.0459922552109,-11.904407501221),101991,1697)
end
function spawn_apt()
alife():create("apt_1",vector():set(-1.5376950502396,9.3525800704956,0.54806500673294),61930,1682)
end
function spawn_apt_2()
alife():create("apt_1",vector():set(-1.5376950502396,9.3525800704956,0.54806500673294),61930,1682)
end
function spawn_apt_3()
alife():create("apt_1",vector():set(-1.5376950502396,9.3525800704956,0.54806500673294),61930,1682)
end
function spawn_apt_4()
alife():create("bloodsucker_normal",vector():set(-1.5376950502396,9.3525800704956,0.54806500673294),61930,1682)
end
function spawn_apt_5()
alife():create("bloodsucker_normal",vector():set(-1.5376950502396,9.3525800704956,0.54806500673294),61930,1682)
end
function spawn_wpn_5()
alife():create("wpn_vintorez_nimble",vector():set(132.99745178223,28.903234481812,239.21705627441),342241,816)
end
function escape_quest() 
task_manager.get_task_manager():give_task("escape_give") 
end 
function pripyat_quest() 
task_manager.get_task_manager():give_task("pripyat_give") 
end 
function yantar_quest() 
task_manager.get_task_manager():give_task("yantar_give") 
end 
function military_quest() 
task_manager.get_task_manager():give_task("military_give") 
end 
function pod_quest() 
task_manager.get_task_manager():give_task("pod_give") 
end 

function esc_nac_1(first_speaker, second_speaker) 
dialogs.relocate_item_section(second_speaker, "mil_serega_3", "in") 
end

function spawn_zombi_1()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_2()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_3()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_4()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_5()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_6()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_7()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_8()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_9()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_10()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_11()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_12()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_13()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_14()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_15()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_16()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_17()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_18()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_19()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_20()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_21()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_22()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_23()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_24()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_25()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_26()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_zombi_27()
alife():create("zombie_strong",vector():set(121.59185791016,-19.499485015869,-114.19039916992),4478,1216)
end
function spawn_bil_1()
alife():create("bibliotekar_normal",vector():set(72.01203918457,-16.126434326172,90.422149658203),1278,1213)
end
function spawn_bil_2()
alife():create("bibliotekar_normal",vector():set(114.47355651855,-16.131286621094,58.838455200195),3848,1213)
end
------------------------------------------------Copyright, razoromon------------------------------------------------------------------------