function spawn_monstr_pripyat()
	amk.spawn_item("snork_strong",vector():set(-35.774,-0.605,477.899), 63545, 2272, 5)
	amk.spawn_item("pseudodog_weak",vector():set(95.284,-0.684,461.591), 206694, 2265, 7)
end

function spawn_monstr_pripyat_2()
	amk.spawn_item("snork_strong",vector():set(19.801,4.905,375.511), 223615, 3760, 5)
	amk.spawn_item("pseudodog_weak",vector():set(20.781,-0.192,376.113), 225562, 3760, 8)
	amk.spawn_item("tushkano_normal",vector():set(43.842,1.219,361.964), 257920, 3760, 13)
end

function spawn_monstr_pripyat_3()
	amk.spawn_item("pseudodog_strong",vector():set(-187.555,-0.424,-165.923), 30188, 3752, 7)
end

function spawn_monstr_pripyat_4()
	amk.spawn_item("burer_arena",vector():set(-53.163,4.226,-105.068), 136047, 3759)
	amk.spawn_item("burer_arena",vector():set(-80.391,4.211,-103.566), 109342, 3759)
	amk.spawn_item("burer_arena",vector():set(-106.630,4.211,-101.629), 86396, 3759)
	amk.spawn_item("burer_arena",vector():set(-88.093,0.844,-94.291), 102223, 3759)
	amk.spawn_item("burer_arena",vector():set(-48.340,0.842,-94.664), 140613, 3759)
end

function start_film()
	if has_alife_info("bileter_dialog_end") then
	dialogs_pripyat.film_on()
	dialogs_pripyat.film_off()
	end
end	

function film_on()
	local htime = level.get_time_hours()
	if htime>=22 and htime<23 then
	db.actor:give_info_portion("start_film")
	end
end

function film_off()
	local rtime = level.get_time_hours()
	if rtime >=23 then
	db.actor:disable_info_portion("start_film")	
	end
end

function start_kino(actor, npc)
   level.add_pp_effector ("radar_psi.ppe", 2006, false)
end

function start_kino_1(actor, npc)
   game.start_tutorial("kino_1")
end

function start_kino_2(actor, npc)
   game.start_tutorial("kino_2")
end

 function spawn_shuhov()
	local obj = alife():create("shuhov",vector():set(35.408,1.207,363.146),245842,3760)
	local params = amk.read_stalker_params(obj)
	params.custom="[logic]\ncfg = scripts\\pripyat_v\\shuhov.ltx"
	params.sid = 15047
	amk.write_stalker_params(params,obj)
end

function varjag_anna_complete()
    if has_alife_info("monolith_4") and has_alife_info("monolith_1") and has_alife_info("monolith_3") then
		return true and
	db.actor:give_info_portion("varanna_complete")	
	end
	return false
end

function relokate_podsumok(gg, npc)
	dialogs.relocate_item_section(npc,"podsumok","out")
	dialogs.relocate_item_section(npc, "jeton_arm", "out")
end

function telepotrt_kanjon()
    amk.g_start_timer("teleport_kanjon",0,0,1)
end

function delete_shuhov()
	db.actor:disable_info_portion("spawn_shuhov")
end

function start_kino_timer()
  level.add_pp_effector ("radar_psi.ppe", 2006, false)
  amk.g_start_timer("start_kino",0,0,1)
end

function quest_martyshka(first_speaker,second_speaker) 
	news_manager.send_tip(db.actor, "%c[255,255,128,128]Мартышка:\n%c[default]  Папа, ты куда пропал, мне холодно и страшно. А ещё я в садике куклу забыла и мне без неё скучно. Принеси её к нам домой в Копачи...", nil, nil, 20000)
	amk.g_start_timer("start_quest_kukla",0,0,2)
end

function spawn_kukla()
	db.actor:give_info_portion("kukla")
	alife():create("kukla",vector():set(-111.905,5.000,-95.439),82850,3759)
end

function kukla_have()
	if db.actor:object("kukla") then
		return true and 
		amk.g_start_timer("start_quest_martyshka",0,0,1)	
	end
	return false
end



function gauss_quest_have()
	if db.actor:object("wpn_gauss_prip") then
	dialogs_pripyat.start_timer_cmc()
	end
	if db.actor:object("wpn_gauss_prip") then
		return true
	end
	return false
end

function garik_karta_have()
	if db.actor:object("karta_garik") then
		return true
	end
	return false
end

function garik_karta_reward(gg,npc)
	dialogs.relocate_item_section(npc,"karta_garik","out")
end

function ataka_start()
    amk.g_start_timer("ataka_start",0,0,3)
end

function start_timer_cmc()
    amk.g_start_timer("brodyaga",0,0,5)
end

function cmc(first_speaker,second_speaker) 
	news_manager.send_tip(db.actor, "%c[255,255,128,128]Бродяга:\n%c[default] Братцы, выручайте! Меня держат в книжном магазине.", nil, nil, 30000) 
end


function start_help_brodyaga()
    amk.g_start_timer("brodyaga_2",0,0,1)
end


function relocate_wpn_brodyaga(gg,npc)
    local oItem = db.actor:object("wpn_ak74")
    if oItem then
    dialogs.relocate_item_section(npc,"wpn_ak74","out")
    end
	local oItem = db.actor:object("wpn_ak74u")
    if oItem then
    dialogs.relocate_item_section(npc,"wpn_ak74u","out")
    end
	local oItem = db.actor:object("wpn_oc33")
    if oItem then
    dialogs.relocate_item_section(npc,"wpn_oc33","out")
	dialogs.relocate_item_section(npc, "ammo_9x18_fmj", "out")
    end
end

function bilet_relocate(gg, npc)
	dialogs.relocate_money(gg, 7000, "out")
	dialogs.relocate_item_section(npc, "bilet", "in")
end


function degtyarev_relocate(npc,gg)
	dialogs.relocate_item_section(gg,"ammo_7.62x39_ap","in",5)
end

function degtyarev_offline()
	local npc = alife():story_object(1612)
		if npc then
			alife():set_switch_offline (npc.id, true)
			alife():set_switch_online (npc.id, false)
			alife():set_interactive (npc.id, false)
		end
	end
	
function vano_offline()
	local npc = alife():story_object(1613)
		if npc then
			alife():set_switch_offline (npc.id, true)
			alife():set_switch_online (npc.id, false)
			alife():set_interactive (npc.id, false)
		end
	end

function start_sms_varjag_2()
    amk.g_start_timer("sms_varjag_2",0,0,10)
end

function sms_varjag_2(first_speaker,second_speaker) 
	news_manager.send_tip(db.actor, "%c[255,255,128,128]Варяг:\n%c[default] Кайдан, мне только что удалось связаться с Шефом! Шептилов Александр дома не появлялся. Зайди, я на вышке.", nil, nil, 30000) 
end

function start_sms_varjag_3()
    amk.g_start_timer("sms_varjag_3",0,0,10)
end

function sms_varjag_3(first_speaker,second_speaker) 
	news_manager.send_tip(db.actor, "%c[255,255,128,128]Варяг:\n%c[default] Кайдан, мне удалось связаться с Шефом! Шептилов Александр дома не появлялся. Зайди, у меня есть новости! Я на хуторе возле свободовской базы.", nil, nil, 30000) 
end

function start_sms_varjag_4()
    amk.g_start_timer("sms_varjag_4",0,0,10)
end

function sms_varjag_4(first_speaker,second_speaker) 
	news_manager.send_tip(db.actor, "%c[255,255,128,128]Варяг:\n%c[default] Кайдан, я на хуторе возле свободовской базы. Зайди, у меня есть новости!", nil, nil, 30000) 
end
	