--' спавним рацию Волка на свалке (функция Сяка перестала работать)
function spawn_add_resiver()
	local obj = create("sak_resiver",xyz(-186.264,-3.492,94.656),38921,338)
	map_spot(obj.id, "treasure", "Walkie Talkie Wolf")
end

--' проверим наличие пушки для Лиса
function fox_kriss_have()
	return has_good("wpn_spas12",1) ~= false
end

--' отдадим ствол Лису
function fox_kriss_done(first_speaker, second_speaker)
	lost_good("wpn_spas12",1)
	got_money(1000)
	got("grenade_fb",1)
	got("grenade_he",1)
	got("af_vyvert",1)
	got("af_blood",1)
	got("ammo_12x70_kart",2)
 end

--' эта функция проверяет наличие минигана
function atp_propusk_have() 
	return has("wpn_m_134_baty",1)
end

--' отдадим миниган Адреналину, получим награду и Адреналин - друг
function atp_propusk_done(first_speaker, second_speaker)
	lost("wpn_m_134_baty",1)
	got("wpn_svd_m1")
	got("af_spirit_2")
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' отдадим экзу Воронину и получим награду
function arhara_ekza_done(first_speaker, second_speaker)
	meceniy_work.give_meceniy_outfit()
	got("af_kol_4")
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' спавним нашу маскировочную экзу на Заводе
function ekza()
	local obj = create("meceniy_outfit_new",xyz(-168.07086181641,9.0200386047363,-107.24085998535),17057,8355)
	map_spot(obj.id, "treasure", "Camouflage Exo Voronin")
	create("naemnik_regular",xyz(-139.47856140137,0.55643236637115,-44.460918426514),29942,8297)
	create("naemnik_veteran",xyz(-151.01426696777,1.4930837154388,-66.08162689209),24117,8343)
	create("pri_arhara_naemnik1",xyz(-104.32121276855,0.55386924743652,-81.414657592773),43023,8173)
	create("pri_arhara_naemnik2",xyz(-105.796875,9.1608352661133,-63.381870269775),42127,8330)
	create_car("vehicle_apc",xyz(-144.78512573242,0.55667388439178,-40.691776275635),27277,8297, "scripts\\technics\\btr.ltx")
	create_car("auto_turret_2",xyz(-139.39715576172,4.4666318893433,-30.899389266968),29954,8297, "scripts\\technics\\turret.ltx")
end

--' проверим наличие тисков для Шурупа
function atp_propusk_shurup_have()
	return has("tisku_arhara",1)
end
function shurup_darkscape_pda_have()
	return has("darkscape_pda")
end

--' заселяем Завод
function metall_zavod_killers()
	create("naemnik_sniper",xyz(-107.25987243652,8.7417669296265,-1.7005845308304),41345,8340)
	create("naemnik_regular",xyz(-35.628589630127,0.53892755508423,29.428562164307),84825,8215)
	create("naemnik_veteran",xyz(-105.26042175293,7.76984167099,-46.882972717285),42639,8331)
	create("pri_arhara_naemnik1",xyz(-126.88694763184,7.6811861991882,-28.924060821533),34823,8336)
	create("pri_arhara_naemnik2",xyz(-109.63082885742,7.6800618171692,-33.108402252197),40147,8336)
	create("pri_arhara_naemnik3",xyz(-125.94951629639,7.1236543655396,-13.104021072388),35073,8337)
	create("naemnik_veteran",xyz(-81.087066650391,11.477473258972,-66.263854980469),56473,8330)
	create("naemnik_regular",xyz(3.578070640564,0.70320808887482,18.615375518799),112613,8213)
	create("naemnik_sniper",xyz(15.070766448975,25.734827041626,-69.92000579834),119126,8180)
	create("naemnik_sniper",xyz(-20.430759429932,33.924266815186,-64.042579650879),96985,8306)
	create("naemnik_veteran",xyz(-19.653409957886,15.744996070862,-45.34924697876),97717,8309)
	create("naemnik_regular",xyz(-53.705711364746,8.9054956436157,-37.746128082275),71199,8312)
	create("naemnik_regular",xyz(78.631034851074,-1.4170861244202,10.747898101807),148231,8273)
	create("pri_arhara_naemnik1",xyz(68.015960693359,-1.6384216547012,12.858417510986),143872,8272)
	create("naemnik_veteran",xyz(-13.917332649231,5.3149981498718,-91.909477233887),100615,8316)
	create("pri_arhara_naemnik2",xyz(-0.72791802883148,5.3835263252258,-93.671913146973),109396,8318)
	create("naemnik_sniper",xyz(-104.34585571289,20.093370437622,-106.32872009277),42988,8327)
	create("naemnik_regular",xyz(-144.6279296875,11.664554595947,-106.65358734131),27191,8350)
	create("naemnik_veteran",xyz(-73.937164306641,6.7423949241638,-90.62678527832),60266,8314)
	create("naemnik_regular",xyz(6.5646209716797,10.079402923584,-118.48254394531),113698,8322)
	create("pri_arhara_naemnik1",xyz(-24.685432434082,10.093288421631,-118.50860595703),93559,8323)
end

--' отдача тисков, Шуруп друг
function atp_propusk_shurup_done(first_speaker, second_speaker)
	lost("tisku_arhara",1)
	lost("darkscape_pda",1)
	lost("darkscape_code_pda",1)
	got_money(25000)
	got("wpn_rem700")
	hamster_kuznec5.hamster_kuznec5_check()
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' проверим наличие антизомбина
function chaes_perexod_have()
	return has("antizombie",1)
end

--' отдадим антизомбин
function chaes_perexod_done(first_speaker, second_speaker)
	lost("antizombie",1)
	got("wpn_glock23")
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' проверим наличие диска у ГГ
function arh_disk_have()
	return has("disk_adren",1)
end

--' отдадим диск Адреналину и получим награду
function arh_disk_done()
	lost("disk_adren",1)
	got("caps_mincer")
	got("caps_electra")
	got("wpn_walther_921")
	got("ammo_9x21_11",1)
	got("ammo_9x21_10",1)
	release("atp_trupak_disk")
end

--' проверим наличие финансов за ФН
function akim_have_money_120000(actor,npc)
	return actor:money() > 250000
end

--' получим ФН Палач
function give_akim_pudd()
	got("wpn_fn2000_sniper")
end

--' отдадим деньги Акиму за снайперку
function akim_give_money_120000()
	lost_money(250000)
end

--' обмен патронов для пулемётов у Акима
function akim_obmen6_have(actor,npc)
	return actor:money() > 10000
end
function akim_obmen6(actor,npc)
	lost_money(10000)
	got("ammo_minigun")
end

function akim_obmen7_have(actor,npc)
	return actor:money() > 8000 and has("af_gravi",1)
end
function akim_obmen7(actor,npc)
	lost_money(8000)
	lost("af_gravi",1)
	got("ammo_7.62x51_box")
end

function akim_obmen8_have(actor,npc)
   return actor:money() > 5000 and has("af_medusa",1)
end
function akim_obmen8(actor,npc)
	lost_money(5000)
	lost("af_medusa",1)
	got("ammo_7.62x54r")
end

--' Сахар дал арт на дорожку 
function sahar_dal_art(first_speaker, second_speaker)
	got("af_pudd_3")
end

--' спавним сумку Сахара на чаэс-1
function sahar_sumka_start()
	local obj = create("sumka_arhara",xyz(274.54000854492,0.91153953075409,-216.47441101074),114326,2350)
	map_spot(obj.id, "treasure", "Sakharov's bag")
end

--' проверим наличие сумки для Сахара
function sahar_sumka_have()
	return has("sumka_arhara",1)
end

--' отдадим сумку Сахару
function sahar_sumka_done()
	lost("sumka_arhara",1)
	got("doc_10")
end

--' рюкзачок для минигана и медальона дока
function med_dok_start()
	local obj = create("m_inventory_box15",xyz(19.916,1.249,213.797),199989,359)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
	obj:set_direction(0,-0.54,0)
	got("doc_8")
end

--' проверим наличие медальона у ГГ
function med_dok_have()
	return has("doc_medal",1)
end

--' отдадим медальон Шахтеру
function med_dok_done()
	lost("doc_medal",1)
end

--' проверим наличие финансов на рецепт гусеницы
function sahar_have_money_50000(actor,npc)
    return actor:money() > 50000
end

--' отдадим деньги Сахару
function sahar_give_money_50000(t1,t2)    
	lost_money(50000)
end    

--' проверим наличие выверта за замок для акима
function akim_vyvert_have()
	return has("af_vyvert",1)
end

--' проверим наличие финансов
function akim_have_money_vyvert_20000(actor,npc)
    return actor:money() > 10000
end

--' отдадим выверт Акиму и получим  замок
function give_akim_vyvert()
	lost("af_vyvert",1)
	got("zamok")
end

--' отдадим деньги Акиму за замок
function akim_give_money_vyvert_20000(t1,t2)
	lost_money(10000)
end

--' проверим наличие вороньих яиц у ГГ
function arhara_omlet_have()
	return has("vorona_egg",10)
end

--' отдадим яйца повару и получим пушку
function arhara_omlet_done()
	lost("vorona_egg",10)
	got("wpn_rg6_m1")
end

--' спавним вороньи яйца
function vorona_egg_spawn()
	create("vorona_egg",xyz(-34.258,1.229,61.552),159972,2881)
	create("vorona_egg",xyz(-34.258,1.229,61.552),159972,2881)
	create("vorona_egg",xyz(-34.258,1.229,61.552),159972,2881)
	create("vorona_egg",xyz(-34.258,1.229,61.552),159972,2881)
	create("vorona_egg",xyz(4.979,1.458,117.221),192133,2881)
	create("vorona_egg",xyz(4.979,1.458,117.221),192133,2881)
	create("vorona_egg",xyz(4.979,1.458,117.221),192133,2881)
	create("vorona_egg",xyz(110.141,2.509,131.046),278456,2885)
	create("vorona_egg",xyz(110.141,2.509,131.046),278456,2885)
	create("vorona_egg",xyz(110.141,2.509,131.046),278456,2885)
	create("vorona_egg",xyz(-136.771,-0.184,-148.663),79878,2882)
	create("vorona_egg",xyz(-136.771,-0.184,-148.663),79878,2882)
	create("vorona_egg",xyz(-136.771,-0.184,-148.663),79878,2882)
	create("vorona_egg",xyz(-163.050,2.087,-161.024),58073,2882)
	create("vorona_egg",xyz(-163.050,2.087,-161.024),58073,2882)
end

--' а это рюкзачок для минигана в пещере
function new_inventory16()
	local obj = create("m_inventory_box16", xyz(-0.047491822391748,-2.4808914661407,-9.304651260376),32285,2880)
	    map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' спавним сердце полтергейста в пещере и рестриктор в кондейке в ТД
function af_part_monolit_spawn()
	local obj = create("af_part_monolit",xyz(0.101,-2.429,-8.607),32286,2880)
		map_spot(obj.id, "treasure", "Poltergeist Heart")
		sms("Received a tip on the cache", nil, nil, 10000)
	spawn_restrictor.bandit_krisyk_done_sr()
	spawn_restrictor.bandit_krisyk_done_sr1()
	spawn_restrictor.bandit_krisyk_done_sr2()
end

-- проверим наличие вещей для диалога с Шахтёром при первой встрече
function peshera_veshabar_have()
return has("af_dik_1",5) and
has("af_part_monolit",1) and
has("af_power_3",1) and
has("wpn_usas20",1) and
has("exo_military_outfit",1) and
has("wpn_eagle_mark",1) and
has("af_vyvert_green",1) and
has("karta_peschera",1)
end

-- Чистка инвентаря в диалоге с Шахтёром
function shaxter_izaytie_habara()
	local qkeep_items={ --итемы, которые не забираем
		["device_torch"]=true,
                ["device_pda"]=true,
                ["bolt"]=true,
                ["snp_pda1"]=true,
                ["hand_radio"]= true
	}
	give_info("biznes_remove_special_item")
	local ids={}
	db.actor:iterate_inventory_simple(
		function(item)
			if not qkeep_items[item:section()] then --запоминаем id итемов, которые удалить надо у игрока
				table.insert(ids,item:id()) 
			end
		end
	,db.actor)
	for index,id in pairs(ids) do
		release(id) --чистим инвентарь
	end
--	db.actor:give_money(-db.actor:money()) --заберем все деньги безвозвратно
	disable_info("biznes_remove_special_item")
end

--' получим лекарство Шахтера
function arhara_shaxter_done(first_speaker, second_speaker)
	got("shaxter_tele")
end

--' спавним фонарики
function fonarik_les()
	local obj = story_object(5243)
	create("fonarik",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("fonarik",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("ammo_12x70_kart",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("grenade_rgd5",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("medkit",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("repair_item_weapon",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
end

--' эта функция проверяет наличие 2 фонариков
function shaxter_fonar_dost_have() 
	return has("fonarik",2)
end

--' отдадим фонарики Шахтёру и получим Сердце полтергейста
function shaxter_fonar_dost_done()
	lost("fonarik",2)
	got("af_part_monolit")
end

--' проверим наличие клада для Лысого
function lysyi_klad_nayti_have() 
	return has("money4",3) and
		has("money1",3) and
		has("money2",3) and
		has("money3",3)
end

--' заспавним монстриков в пещере и несколько артов
function monstr_spawn_peshera()
	create("pseudodog_strong",xyz(-112.136,2.497,5.440),12551,2870)
	create("pseudodog_big",xyz(-112.136,2.497,5.440),12551,2870)
	create("pseudodog_strong",xyz(-112.136,2.497,5.440),12551,2870)
	create("pseudodog_big",xyz(-112.136,2.497,5.440),12551,2870)
	create("zombie_hell1",xyz(-112.1359,2.497,5.440),12551,2870)
	create("zombie_hell2",xyz(-112.1359,2.497,5.440),12551,2870)
	create("zombie_babka_strong",xyz(-32.242,-2.364,17.576),30991,2878)
	create("zombie_babka_normal",xyz(-32.242,-2.364,17.576),30991,2878)
	create("zombie_hell3",xyz(-32.2419,-2.364,17.576),30991,2878)
	create("zombie_hell15",xyz(-32.2419,-2.364,17.576),30991,2878)
	create("zombie_trup",xyz(-32.2419,-2.364,17.576),30991,2878)
	create("zombie_babka_weak",xyz(-32.578,-2.469,19.725),30910,2878)
	create("zombie_hell8",xyz(-32.578,-2.469,19.725),30910,2878)
	create("zombie_hell11",xyz(-61.608,2.488,19.820),26067,2870)
	create("zombie_hell15",xyz(-61.608,2.488,19.820),26067,2870)
	create("zombie_strong",xyz(-61.608,2.488,19.820),26067,2870)
	create("zombie_normal",xyz(-61.6079,2.488,19.820),26067,2870)
	create("zombie_hell10",xyz(-61.6079,2.488,19.820),26067,2870)
	create("zombie_hell4",xyz(-61.6079,2.488,19.820),26067,2870)
	create("af_medusa",xyz(-94.865,8.402,-111.352),17544,2880)
	create("af_gravi",xyz(-80.858,-2.481,-18.319),21213,2875)
	create("af_fireball",xyz(-109.260,2.498,6.314),13261,2870)
	create("af_buliz",xyz(-136.571,1.497,-6.945),6973,2866)
end

--' отдадим клад Лысому
function lysyi_klad_nayti_done(first_speaker, second_speaker)
	lost("money4",3)
	lost("money1",3)
	lost("money2",3)
	lost("money3",3)
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' получим бабки и MP-5 PDW от Лысого
function lysyi_babki_vzyt_45000(t1,t2)
	got_money(45000)
	got("wpn_mp5k_pdw")
end

--' повторно заспавним монстриков в пещере и несколько артов
function monstr1_spawn1_peshera1()
	create("m_poltergeist_strong_flame",xyz(-67.926,-12.681,76.354),24792,2873)
	create("bloodsucker_strong",xyz(-136.398,2.679,26.343),7031,2866)
	create("bloodsucker_strong",xyz(-136.398,2.679,26.343),7031,2866)
	create("gigant_strong",xyz(-84.236,-2.719,57.208),20589,2871)
	create("gigant_strong",xyz(-84.236,-2.719,57.208),20589,2871)
	create("af_rusty_thorn",xyz(-93.115,-12.629,18.815),18189,2872)
	create("af_rusty_sea-urchin",xyz(-99.898,-12.647,48.704),16000,2869)
end

--' заспавним изум. выверт в Забытом лесу
function spawn_vyvert_green()
	local obj = create("af_vyvert_green",xyz(5.379,-0.00,222.374),192846,2883)
	map_spot(obj.id, "treasure", "Emerald Coil")
	sms("Received a tip on the cache", nil, nil, 10000)	
end

--' спавним ПДА Стрелка
function str_pda_spawn()
	local obj = create("strelok_pda",xyz(-98.916,9.947,-122.306),16319,2880)
	map_spot(obj.id, "treasure", "Strelok's PDA")
	sms("Received a tip on the cache", nil, nil, 10000)	
	create("ammo_9x39_izomorf",xyz(-98.915,9.947,-122.306),16319,2880)
	create("ammo_9x39_izomorf",xyz(-98.915,9.947,-122.306),16319,2880)
	create("af_babka_1",xyz(-98.320,9.614,-121.451),16574,2880)
end

--' проверим наличие арта
function pda_shaxt_strelok_naity_have() 
	return has("af_armor_4",1)
end

--' отдадим арт шахтёру и он друг
function pda_shaxt_strelok_naity_done(first_speaker, second_speaker)
	lost("af_armor_4",1)
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' заспавним микросхемы
function microshema()
	create("microshema",xyz(-111.194,-29.847,-394.991),145881,22)
	create("microshema",xyz(-111.194,-29.847,-394.991),145881,22)
	create("microshema",xyz(-111.151,-29.880,-395.110),145881,22)
	create("microshema",xyz(-111.053,-29.826,-395.174),145881,22)
	create("microshema",xyz(-111.105,-29.848,-395.166),145881,22)
	create("microshema",xyz(-111.158,-29.863,-394.991),145881,22)
	create("microshema",xyz(-111.158,-29.863,-394.991),145881,22)
	create("microshema",xyz(-111.133,-29.803,-394.744),145881,22)
	create("microshema",xyz(-111.176,-29.858,-394.993),145881,22)
	create("microshema",xyz(-111.176,-29.858,-394.993),145881,22)
	create("microshema",xyz(-111.176,-29.858,-394.993),145881,22)
	create("microshema",xyz(-111.516,-29.804,-394.496),144941,22)
	create("microshema",xyz(-110.728,-29.803,-394.339),145881,22)
end

--' проверим наличие вывертов и микросхем для Доцента
function dolgovyzui_lentyi_have()
	return has("af_vyvert",5) and has("microshema",10)
end

--' отдадим выверты
function dolgovyzui_lentyi_done()
	lost("af_vyvert",5)
	lost("microshema",10)
	got("wpn_sv98",1)
	got("ammo_7.62x54_7h14",1)
	local obj = create("flyga",xyz(-64.238,-13.02,-21.694),134357,322)
	map_spot(obj.id, "treasure", "Petrenko's Flask")
	sms("Received a tip on the cache", nil, nil, 10000)	
end

--' проверим наличие фляжки для Петренко
function flyga_naity_have()
	return has("flyga",1)
end

--' отдадим фляжку
function flyga_naity_done()
	lost("flyga")
	got_money(30000)
end

--' проверим наличие сигарет
function garik_vopros_have() 
	return has("sigaret",10)
end

--' отдадим сигареты Гарику и спавним маленькие термосы
function garik_vopros_done()
	lost("sigaret",10)
	lost_money(20000)
	local obj = create("termos_small",xyz(299.50552368164,2.0341849803925,-158.66949462891),330061,3531) -- болота
	map_spot(obj.id, "crlc_small", "Small Thermos")
	obj = create("termos_small",xyz(623.25767822266,3.6071291446686,437.70494995117),525316,3578) -- болота
	map_spot(obj.id, "crlc_small", "Small Thermos")
	obj = create("termos_small",xyz(108.15433502197,-5.9027981185913,-24.712044525146),533866,2823) -- атп
	map_spot(obj.id, "crlc_small", "Small Thermos")
	obj = create("termos_small",xyz(613.80084228516,-50.572933654785,-311.26504516602),220555,1881) -- радар
	map_spot(obj.id, "crlc_small", "Small Thermos")
	obj = create("termos_small",xyz(391.43371582031,-33.302521209717,152.76473083496),119302,1865) -- радар
	map_spot(obj.id, "crlc_small", "Small Thermos")
	obj = create("termos_small",xyz(-222.5792175293,-7.8082342147827,-128.80459106445),17621,281) -- свалка
	map_spot(obj.id, "crlc_small", "Small Thermos")
	sms("Received a tip on the cache", nil, nil, 10000)	
end

--' спавним большие термосы
function termos_big_spawn()
	local obj = create("termos_big",xyz(-93.859214782715,-20.037916564941,222.6757232666),220725,1734) -- ас
	map_spot(obj.id, "crlc_small", "Big Thermos")
	obj = create("termos_big",xyz(101.65575408936,0.15658415555954,302.86987304688),396080,1775) -- ас
	map_spot(obj.id, "crlc_small", "Big Thermos")
	obj = create("termos_big",xyz(-69.140277709961,-1.8591649150848,20.138668060303),134381,330) -- свалка
	map_spot(obj.id, "crlc_small", "Big Thermos")
	obj = create("termos_big",xyz(-133.96228027344,2.6039491271973,-274.9045715332),78415,3377) -- болота
	map_spot(obj.id, "crlc_small", "Big Thermos")
	obj = create("termos_big",xyz(503.15352783203,4.2132781028748,-153.01805114746),481333,3563) -- болота
	map_spot(obj.id, "crlc_small", "Big Thermos")
	obj = create("termos_big",xyz(-263.44686889648,0.70789569139481,18.802749633789),5804,1395) -- дт
	map_spot(obj.id, "crlc_small", "Big Thermos")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' эта функция проверяет наличие термосов
function voronin_termos_naity_have() 
	return has("termos_big",5) and has("termos_small",5)
end

--' отдадим термосы Воронину
function voronin_termos_naity_done()
	lost("termos_big",5)
	lost("termos_small",5)
	got("doc_1")
	create("iskander_pda",xyz(-217.34631347656,8.317892074585,-336.97265625),161143,4523)
end

--' спавним ремкомплекты
function remkomplekt_spawn()
	local obj = create("kuvalda",xyz(138.305,-6.021,13.806),576283,2832)
	map_spot(obj.id, "treasure", "Sledgehammer for repair")
	local obj = create("kuvalda",xyz(160.75564575195,-5.8302555084229,-54.942893981934),607741,2833)
	map_spot(obj.id, "treasure", "Sledgehammer for repair")
	local obj = create("kluch",xyz(-55.443,-6.437,-21.472),255385,1605)
	local obj = create("kluch",xyz(-55.471,-6.436,-21.143),255386,1605)
	map_spot(obj.id, "treasure", "Repair Keys")
	local obj = create("otvertka",xyz(113.399,-1.398,3.550),540952,2826)
	local obj = create("otvertka",xyz(113.173,-1.398,3.539),540952,2826)
	map_spot(obj.id, "treasure", "Screwdriver")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("af_ameba_slime",xyz(-143.967,-2.800,-11.277),168374,2798)
	create("zombie_babka_weak",xyz(-78.585,-5.721,-96.389),264461,2808)
	create("zombie_babka_normal",xyz(-80.783,-6.114,-68.725),261420,2808)
	create("zombie_babka_strong",xyz(-100.377,-6.11,-43.543),233002,2798)
	create("zombie_immortal",xyz(-93.483,-6.470,6.115),242276,2809)
	create("zombie_strong",xyz(-149.506,-3.846,6.074),160198,2796)
end

--' проверим наличие ремкомплектов
function petr_sidor_vzyt_have() 
	return has("kuvalda",2) and has("kluch",2) and has("otvertka",2)
end

--' отдадим ремкомплекты Сидору
function petr_sidor_vzyt_done(first_speaker, second_speaker)
	lost("kuvalda",2)
	lost("kluch",2)
	lost("otvertka",2)
end

--' спавним подарок Петренко а заодно и сюрприз
function nu_nakonez_to()
	local obj = create("wpn_pkm_m1",xyz(214.222,1.027,223.993),359851,2885)
	map_spot(obj.id, "treasure", "Petrenko's gift for repair kits")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("ammo_7.62x54r",xyz(214.252,1.000,223.430),359850,2885)
	create("ammo_7.62x54r",xyz(214.252,1.000,223.430),359850,2885)
	create("af_armor_3",xyz(214.715,0.333,221.231),359849,2885)
	create("polter_xray",xyz(219.972,3.946,195.279),363663,2885)
	create("m_controller_act",xyz(219.972,3.946,195.279),363663,2885)
	create("m_poltergeist_dd",xyz(219.972,3.946,195.279),363663,2885)
end

--' раз у Сяка функция не пашет - спавн док дезертира + веселуха
function spawn_rad_document7()
	local obj = story_object(9115)
	create("rad_document7",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("zasada_tonnel_agro_2",xyz(-175.85920715332,7.3848404884338,-155.32315063477),61033,560)
	create("agro_elite_rpg",xyz(-183.70137023926,5.317928314209,-170.63172912598),53257,667)
	create("soldier_mines_regular",xyz(-169.85111999512,5.3175392150879,-170.36421203613),66853,667)
	create("soldier_mines_regular",xyz(-195.93034362793,7.3854722976685,-223.88467407227),40564,555)
	create("soldier_mines_veteran",xyz(-132.79737854004,-0.20200881361961,-144.02784729004),106301,697)
	create("soldier_mines_regular",xyz(-156.57958984375,14.998466491699,-191.31016540527),80447,644)
	local sobj = create("soldier_mines_veteran",xyz(-131.26614379883,14.998692512512,-191.58946228027),107755,642)
	create("kuznec_koloda",sobj.position, sobj.m_level_vertex_id, sobj.m_game_vertex_id, sobj.id)
	create("zasada_tonnel_agro_2",xyz(-153.41352844238,9.9984302520752,-201.50427246094),84277,646)
	create("agro_elite_soldier",xyz(-131.84466552734,4.9986295700073,-200.23066711426),107710,621)
	create("zasada_tonnel_agro_3",xyz(-145.77922058105,4.9975275993347,-203.05874633789),92503,621)
end

--' проверим наличие компа и 3д-рации
function voronin_pribor_dostat_have() 
	return has("pribor",1)
end
function voronin_stol_dostat_have() 
	return has("3d_raziy",1)
end
function voronin_stol_zasada()
	sms("%c[sender]"..translate("name_lokalnaya_set")..":\\n%c[sms_red]"..translate("voronin_stol_zasada_0_0"), 3, "net", 11000, nil, [[sms\net\voronin_stol_zasada]])
	create("bloodsucker_strong",xyz(-296.89874267578,-22.190504074097,286.92123413086),45801,1833)
	create("mil_killer_respawn_1",xyz(-279.85797119141,-22.178747177124,295.20132446289),60066,1832)
	create("mil_killer_respawn_2",xyz(-279.85797119141,-22.178747177124,295.20132446289),60066,1832)
	create("mil_killer_respawn_3",xyz(-279.85797119141,-22.178747177124,295.20132446289),60066,1832)
	create("mil_killer_respawn_4",xyz(-278.49209594727,-22.509449005127,271.50329589844),61170,1832)
end
function voronin_pribor_zasada()
	sms("%c[sender]"..translate("name_borov")..":\\n%c[sms_red]"..translate("sms_borov_spawn_ept_gg_0"), nil, "borov", 15000, nil, [[sms\borov\spawn_ept_gg]])
	create("volkodav",xyz(26.224334716797,0.12501075863838,-44.189655303955),206039,1045)
	create("volkodav",xyz(21.418594360352,0.089109361171722,-55.710716247559),200730,1044)
	create("volkodav",xyz(4.0548872947693,0.079111576080322,-58.98025894165),179031,1037)
	create("volkodav",xyz(1.9367613792419,0.080904215574265,-87.617774963379),176461,1035)
	create("volkodav",xyz(29.398971557617,0.062291234731674,-95.921005249023),210251,1039)
end

--' отдадим комп и 3д-рацию Воронину
function voronin_stol_dostat_done(first_speaker, second_speaker)
	lost("3d_raziy",1)
	lost("pribor",1)
	got("af_dik_3")
	got("af_vyvert_green")
	got("wpn_svu_m1")
	got("wpn_addon_scope_m1")
end

--' заспавним рацию, записку и комп
function spawn_stol()
	local obj = create("pribor",xyz(34.830,8.061,-38.123),217765,1054)
	map_spot(obj.id, "treasure", "Computer")
	local obj = create("3d_raziy",xyz(-297.263,-18.034,292.275),45228,1833)
	map_spot(obj.id, "treasure", "3D Radio")
	create("malyva",xyz(32.784,8.062,-36.736),214836,1054)
	sms("Received a tip on the cache", nil, nil, 10000)	
end

--' проверим наличие рации
function sahar_info_have() 
	return has("telefon",1)
end

--' отдадим телефон Сахару и Сахар друг
function sahar_info_done(first_speaker, second_speaker)
	lost("telefon",1)
	release("arhara_ecolog_guard1")
	release("arhara_ecolog_guard2")
	second_speaker:set_relation(game_object.friend, first_speaker)
end

--' удаляем труп Корчагина
function delete_korchagin()
	release("dead_korchagin_military")
end

--' удаляем пленного из Лабиринта
function delete_labirint_shahter()
	release("labirint_monolit_shahter")
end

--' удаляем Звездочёта с Кордона
function delete_zvezd()
	release("esc_zvezdochet")
end

--' удаляем первого Доктора
function delete_doktor1()
	release("doktor1")
end

--' проверим наличие артов для Креста
function have_art1()
	return has("af_medusa",5) and has("af_cristall_flower",5) and has("af_fireball",5)
end

--' отдадим арты Кресту и получим награду
function remove_art()
	lost("af_medusa",5)
	lost("af_cristall_flower",5)
	lost("af_fireball",5)
	got("af_simbion")
	got("af_armor_3")
	got("wpn_ak107")
	got("ammo_5.45x39_izomorf",2)
end

--' 20 и 40 ПДА у информатора
function inform_20_pda_have()
	return has("device_pda_npc",20) 
end

function inform_40_pda_have()
	return has("device_pda_npc",40) 
end

function inform_20_pda(first_speaker, second_speaker)
	local item = table.random(nagrad.level_7)
    local count = math.random(2,3)
	lost("device_pda_npc", 20)
	got(item, count)
end

function inform_40_pda(first_speaker, second_speaker)
	lost("device_pda_npc", 40)
end

--' проверим наличие 40 рук зомби для Акима
function have_a_hand() 
	return has("part_zombie_hand",40)
end

--' отдадим 40 рук зомби Акиму получим  награду и поднимем репу
function out_hand(first_speaker, second_speaker)
	lost("part_zombie_hand",40)
	got_money(10000)
	got("wpn_ak74u_svd")
	got("ammo_7.62x54_7h14",2)
	second_speaker:set_relation(game_object.friend, first_speaker)
	db.actor:change_character_reputation(30)
end

--' спавним 1 документ для Акима
function spawn_dok()
	local obj = create("old_doc",xyz(-102.94096221924,2.7767494487762,-31.770599365234),111867,321)
	map_spot(obj.id, "treasure", "Document #1 for Akim")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' отдадим документ и получим награду
function out_doc(first_speaker, second_speaker)
	lost("old_doc",1)
	got_money(3000)
	got("suvorotka",1)
	second_speaker:set_relation(game_object.friend, first_speaker)
	db.actor:change_character_reputation(10)
end

--' проверим наличие 1 документа
function have_a_doc() 
	return has("old_doc",1)
end

--' спавним 2 документ для Акима
function spawn()
	local obj = create("a_inventory_box15",xyz(-40.162155151367,-4.5870892047882,-20.518196105957),4666,732)
	map_spot(obj.id, "treasure", "Document 2 for Akim")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' отдадим документ
function doc_otdan_p(first_speaker, second_speaker)
	lost("old_doc_2",1)
	got_money(4000)
	got("antizombie")
	got("treasure_item")
	second_speaker:set_relation(game_object.friend, first_speaker)
	db.actor:change_character_reputation(10)
end

--' проверим наличие 2 документа
function have_doc2() 
	return has("old_doc_2",1)
end

--' спавним 3 документ для Акима в х18 в рюкзаках, 4 - у Корчагина
function spawn_old()
	local obj = create("m_inventory_box24", xyz(-8.440,1.893,11.780),1907,1125)
	map_spot(obj.id, "treasure", "Cache")
	local obj = create("m_inventory_box25", xyz(-41.247,-10.908,13.351),328,1148)
	map_spot(obj.id, "treasure", "Cache")
	local obj = create("m_inventory_box26", xyz(-37.379,-13.006,-14.669),315,1153)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' отдадим 3 часть доков и получим  награду АК-104 и патроны
function out_old(first_speaker, second_speaker)
	lost("old_doc_3_1", 1)
	lost("old_doc_3_2", 1)
	lost("old_doc_3_3", 1)
	lost("old_doc_3_4", 1)
	got_money(6000)
	got("antizombie")
	got("af_electra_moonlight")
	got("wpn_ak104")
	got("ammo_7.62x39_k")
	got("ammo_7.62x39_ap")
	second_speaker:set_relation(game_object.friend, first_speaker)
	db.actor:change_character_reputation(10)
end

--' проверим наличие 3 документов для Акима
function have_a_doc_s()
	return has("old_doc_3_4",1) and has("old_doc_3_3",1) and has("old_doc_3_2",1) and has("old_doc_3_1",1)
end

--' проверим наличие 4 документа для Акима и пда
function have_a_doc_q()
	return has("old_doc_4",1) and has("pda_info",1)
end

--' отдадим всё Акиму и получим  награду
function out_outfit(first_speaker, second_speaker)
	lost("old_doc_4",1)
	lost("pda_info",1)
	got_money(8000)
	got("arhara_instruk")
	give_info("2")
	db.actor:change_character_reputation(10)
	create_car("auto_turret_2",xyz(5.893,20.732,-13.582),42099,1525, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-3.583,4.879,-40.363),37588,1444, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(21.19,11.89,4.12),49019,1502, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(86.24,6.73,-25.89),84418,1515, "scripts\\technics\\turret.ltx")
	create("m_inventory_box_skat",xyz(-12.084,4.879,-43.365),34459,1444)
	create("kuznec_mina",xyz(-10.02,0.73,-40.17),35264,1444)
	create("kuznec_mina",xyz(-11.88,0.73,-40.66),34466,1444)
	create("kuznec_mina",xyz(-10.22,0.73,-41.43),35005,1444)
	create("kuznec_mina",xyz(-9.52,0.74,-40.94),35264,1444)
end

--' спавним 4 документ для Акима
function spawn_new_dok()
	local obj = create("old_doc_4",xyz(109.10995483398,11.377179145813,-12.646112442017),6999,1544)
	map_spot(obj.id, "treasure", "Documents of Akim №4")
	local obj = create("pda_info",xyz(494.25650024414,20.673231124878,-413.81558227539),1038958,4690)
	map_spot(obj.id, "treasure", "PDA to documents of Akim No. 4")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("naemnik_sniper",xyz(477.05981445313,20.56205368042,-406.50799560547),1021851,4689)
	create("naemnik_sniper",xyz(482.7331237793,20.562211990356,-444.36483764648),1028095,4691)
	create("naemnik_veteran",xyz(459.83245849609,-1.6777466535568,-433.29669189453),1000384,4612)
	create("naemnik_regular",xyz(477.44268798828,-1.1448094844818,-414.53372192383),1021842,4689)
	create("naemnik_veteran",xyz(467.7529296875,-0.80575406551361,-408.03125),1010178,4613)
	create("naemnik_regular",xyz(439.65200805664,-1.3681466579437,-438.77249145508),971378,4612)
	create("pri_arhara_naemnik1",xyz(424.28338623047,-2.4839813709259,-488.21310424805),946812,4609)
	create("pri_arhara_naemnik2",xyz(430.95446777344,-2.3167781829834,-497.15515136719),958195,4609)
	create("pri_arhara_naemnik3",xyz(438.20065307617,-2.0210149288177,-497.41189575195),969192,4609)
	create_car("vehicle_apc",xyz(391.69268798828,-1.8258062601089,-438.49194335938),886886,4600, "scripts\\technics\\btr.ltx")
	create_car("auto_turret_2",xyz(481.42501831055,20.562421798706,-430.48645019531),1026574,4691, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(432.85174560547,20.562240600586,-504.85229492188),960497,4609, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(458.99472045898,20.562103271484,-490.29583740234),991161,4609, "scripts\\technics\\turret.ltx")
	yantar_tasks.x16_mutant_spawn()
end

--' проверим наличие слом. телепортатора для Креста
function have_true()
	return has("hand_teleporter_arhara",1) 
end 

--' отдадим телепортатор Кресту и получим награду
function done(first_speaker, second_speaker)
	lost("hand_teleporter_arhara",1) 
	got("wpn_glock40")
	second_speaker:set_relation(game_object.friend, first_speaker)
	db.actor:change_character_reputation(10)
	timer("run", 1.0, "arhara_dialog.rf_ecolog_spawn()")
end

-- Заспавним к Загорскому в тоннель 5 экологов
function rf_ecolog_spawn()
	create("rf_ecolog_respawn",xyz(239.429,0.469,180.559),237309,8294)
	create("rf_ecolog_respawn",xyz(239.429,0.469,180.559),237309,8294)
	create("rf_ecolog_respawn",xyz(239.429,0.469,180.559),237309,8294)
	create("rf_ecolog_respawn",xyz(239.429,0.469,180.559),237309,8294)
	create("rf_ecolog_respawn",xyz(239.429,0.469,180.559),237309,8294)
end

--' проверим наличие пулемёта для Воронина
function voronin_infa_gg_have()
	return ((has_good("wpn_pkm",1) or has_good("wpn_pkm_m1",1) or has_good("wpn_peceneg",1)) and has("ammo_7.62x54r",1)) or
		(has_good("wpn_m60",1) and has("ammo_7.62x51_box",1))
end

--' получим  аптечки
function voronin_infa_gg_done() 
	got("medkit",2)
end

--' получим  сыворотку от Калинина
function kalinin_zadan_done() 
	got("suvorotka",2)
end

--' проверим наличие флэхи для Калинина
function gonets_spasti_have()
	return has("gonets_flash",1)
end

--' отдадим флэху и получим награду от Калинина и Калинин друг
function gonets_spasti_done(first_speaker, second_speaker)
	lost("gonets_flash",1) 
	got("ammo_12x70_kart",4)
	second_speaker:set_relation(game_object.friend, first_speaker) 
end

--' получим флешку от гонца
function gonets_fleha(first_speaker, second_speaker) 
	got("gonets_flash") 
end

--' получим арт от гонца
function gonets_art(first_speaker, second_speaker) 
	got("af_dik_3") 
end

--' спавним монстров на пути Гонца
function zombari_spawn()
	create("kikimora",xyz(-28.716983795166,-1.5798703432083,221.76837158203),337312,2812)
	create("kikimora",xyz(-19.771463394165,-1.7654148340225,230.52334594727),350581,2812)
	create("kikimora",xyz(7.889937877655,-2.5583503246307,209.32551574707),390329,2812)
	create("stinger",xyz(379.72775268555,-0.22740709781647,132.1515045166),920509,2858)
	create("stinger",xyz(379.72775268555,-0.22740709781647,132.1515045166),920509,2858)
	create("stinger",xyz(379.72775268555,-0.22740709781647,132.1515045166),920509,2858)
	create("stinger",xyz(325.45590209961,-1.8443648815155,199.15240478516),842979,2850)
	create("stinger",xyz(325.45590209961,-1.8443648815155,199.15240478516),842979,2850)
	create("stinger",xyz(325.45590209961,-1.8443648815155,199.15240478516),842979,2850)
	create("stinger",xyz(325.45590209961,-1.8443648815155,199.15240478516),842979,2850)
	create("molerat",xyz(211.37327575684,-1.4890750646591,184.02146911621),679344,2839)
	create("molerat",xyz(211.37327575684,-1.4890750646591,184.02146911621),679344,2839)
	create("stinger",xyz(64.848823547363,-5.1277589797974,214.52407836914),473077,2829)
	create("stinger",xyz(64.848823547363,-5.1277589797974,214.52407836914),473077,2829)
	create("stinger",xyz(64.848823547363,-5.1277589797974,214.52407836914),473077,2829)
	create("stinger",xyz(64.848823547363,-5.1277589797974,214.52407836914),473077,2829)
	create("stinger",xyz(64.848823547363,-5.1277589797974,214.52407836914),473077,2829)
end

--' проверим наличия артов для Калинина
function vuxod_atp_have()
	return has("af_electra_moonlight",1) and
		has("af_dummy_glassbeads",1) and
		has("af_electra_flash",1) and
                has_money(50000) 
end

--' отдадим арты Калинину
function vuxod_atp_done()
	lost("af_electra_moonlight",1)
	lost("af_dummy_glassbeads",1)
	lost("af_electra_flash",1)
        lost_money(50000)
end

--' получим аптечку и пм от Звездочёта
function noz_dat()
	got("wpn_pm")
	got("medkit")
end

--' получим арт от Звездочёта
function podarok(first_speaker, second_speaker) 
	got("af_cry_1")
end

--' проверим наличие РПГ-7 для Калинина
function kalinin_btr_vzyt_have()
	return has("wpn_rpg7",1) and has("ammo_og-7b",6)
end

--' доп спавн вояк
function btr_ataka_start()
	create("atp_voyka_attack_1",xyz(-57.625408172607,-2.3043558597565,210.91767883301),295420,2806)
	create("atp_voyka_attack_2",xyz(-240.84,6.69,274.26),27178,2799)
	create("soldier_mines_veteran",xyz(-109.78259277344,0.80875337123871,185.19479370117),218923,2806)
	create("soldier_mines_regular",xyz(-131.74896240234,0.95404648780823,183.92889404297),187068,2806)
	create("soldier_mines_veteran",xyz(-155.69924926758,0.90023481845856,181.759765625),152239,2799)
	create("soldier_mines_regular",xyz(-186.40155029297,-1.7786251306534,134.44165039063),107291,2794)
	local obj = create("soldier_mines_veteran",xyz(-120.36361694336,-3.1845064163208,153.7420501709),203517,2806)
	create("kuznec_koloda",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("soldier_mines_regular",xyz(-55.219573974609,-3.4230177402496,180.25556945801),298395,2806)
	timer("run", 1.0, "arhara_dialog.atp_btr_ataka_restrictor_spawn()")
	timer("run", 45.0, "arhara_dialog.btr_ataka_start1()")
end

-- Спавним рестриктор по квесту Калинина на бтр-ы
function atp_btr_ataka_restrictor_spawn()
	local obj = story_object(97118)
	if not obj then
		obj=create(ai:spawn_id(97118))
	end
end

function btr_ataka_start1()
	create("atp_voyka_attack_1",xyz(-198.44,0.95,339.79),90142,2799)
	create("atp_voyka_attack_2",xyz(-240.84,6.69,274.26),27178,2799)
	create("atp_voyka_attack_3",xyz(-56.81,5.45,330.60),296595,2816)
	create("atp_voyka_attack_4",xyz(-17.39,-2.12,223.60),353591,2812)
	create("atp_voyka_attack_5",xyz(-52.45,-3.45,181.43),302459,2806)
	create("atp_voyka_attack_1",xyz(-76.78,-3.50,162.19),266860,2806)
	create("atp_voyka_attack_2",xyz(-103.59,-4.43,110.17),228082,2802)
	timer("run", 45.0, "arhara_dialog.btr_ataka_start2()")
end

function btr_ataka_start2()
	create("atp_voyka_attack_2",xyz(-240.84,6.69,274.26),27178,2799)
	create("atp_voyka_attack_3",xyz(-56.81,5.45,330.60),296595,2816)
	create("atp_voyka_attack_5",xyz(-52.45,-3.45,181.43),302459,2806)
	create("atp_voyka_attack_1",xyz(-76.78,-3.50,162.19),266860,2806)
	create("atp_voyka_attack_2",xyz(-103.59,-4.43,110.17),228082,2802)
	timer("run", 120.0, "arhara_dialog.btr_ataka_start3()")
end

function btr_ataka_start3()
	create("atp_voyka_attack_1",xyz(-198.44,0.95,339.79),90142,2799)
	create("atp_voyka_attack_3",xyz(-56.81,5.45,330.60),296595,2816)
	create("atp_voyka_attack_4",xyz(-17.39,-2.12,223.60),353591,2812)
	create("atp_voyka_attack_5",xyz(-52.45,-3.45,181.43),302459,2806)
	create("atp_voyka_attack_2",xyz(-103.59,-4.43,110.17),228082,2802)
	timer("run", 120.0, "arhara_dialog.btr_ataka_start4()")
end

function btr_ataka_start4()
	create("atp_voyka_attack_1",xyz(-198.44,0.95,339.79),90142,2799)
	create("atp_voyka_attack_2",xyz(-240.84,6.69,274.26),27178,2799)
	create("atp_voyka_attack_4",xyz(-17.39,-2.12,223.60),353591,2812)
	create("atp_voyka_attack_5",xyz(-52.45,-3.45,181.43),302459,2806)
	create("atp_voyka_attack_1",xyz(-76.78,-3.50,162.19),266860,2806)
	timer("run", 120.0, "arhara_dialog.btr_ataka_start5()")
end

function btr_ataka_start5()
	create("atp_voyka_attack_2",xyz(-240.84,6.69,274.26),27178,2799)
	create("atp_voyka_attack_3",xyz(-56.81,5.45,330.60),296595,2816)
	create("atp_voyka_attack_4",xyz(-17.39,-2.12,223.60),353591,2812)
	create_car("vehicle_btr",xyz(-57.029960632324,-0.37507271766663,238.01370239258),296463,2812, "scripts\\atp\\atp_kalinin_btr1.ltx")
	create_car("vehicle_btr",xyz(-98.666488647461,-3.6858041286469,138.81680297852),235319,2806, "scripts\\atp\\atp_kalinin_btr2.ltx")
	create_car("vehicle_btr",xyz(-163.16427612305,-1.9265176057816,100.49438476563),140846,2802, "scripts\\atp\\atp_kalinin_btr3.ltx")
        give_info("arhara_atp_voyka_spawn")
	release(story_object(97118))
	timer("run", 1.0, "arhara_dialog.btr_ataka_start6()")
end

function btr_ataka_start6()
local b = {
	{position={x=-189.54,y=2.09,z=290.58},gv=2799,lv=102408},
	{position={x=-118.99,y=-0.19,z=288.29},gv=2799,lv=206795},
	{position={x=-82.59,y=-0.06,z=273.69},gv=2806,lv=258820}, 
	{position={x=-62.13,y=-2.59,z=212.22},gv=2806,lv=288334},
	{position={x=-91.86,y=0.45,z=189.69},gv=2806,lv=245564},
	{position={x=-120.88,y=-3.16,z=154.28},gv=2806,lv=202490},
	{position={x=-222.16,y=5.31,z=117.29},gv=2794,lv=54756}
}
	local a = table.random(b)
	create("upi_sdelka_sniper2", xyz(a.position.x,a.position.y,a.position.z), a.lv, a.gv)
end

--' получим М249
function btr_ataka_done() 
	got("wpn_m249")
	got("af_simbion")
	got("grenade_fb",5)
end

--' заспавним в лабиринте арты во 2 пещере
function spawn_monolit_to_labirint()
	create("af_medusa",xyz(-311.981,16.300,219.735),39736,2920)
	create("af_cristall_flower",xyz(-318.176,16.612,167.987),35394,2922)
	create("af_gold_fish",xyz(-218.433,20.138,54.736),105379,2958)
	create("af_fireball",xyz(-128.102,15.460,351.711),147973,2974)
	create("af_cristall",xyz(-200.291,20.082,366.559),117285,2961)
	create("af_mincer_meat",xyz(-245.448,7.128,444.855),86899,2947)
	create("af_electra_sparkler",xyz(-134.238,18.732,459.057),146621,2973)
	create("af_medusa",xyz(-135.452,17.093,421.498),146315,2973)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_armor_1",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_electra_flash",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_dik_1",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_spirit_1",xyz(-196.013,19.972,316.334),120678,2963)
	create("art_acumm",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_ameba_slug",xyz(-177.985,21.049,389.713),133385,2968)
	create("af_dummy_pellicle",xyz(-78.366,42.766,469.674),153706,2987)
end

--' заспавним арты в 3 пещере Лабиринта
function spawn_art_v_3peshere()
	spawn_restrictor.spawn_grot_controller_sr()
	create("af_dik_1",xyz(-220.315,56.106,137.398),104193,2987)
	create("af_spirit_1",xyz(-154.161,56.511,190.503),142841,2987)
	create("af_dummy_battery",xyz(-188.342,52.618,271.344),127542,2987)
	create("af_dummy_pellicle",xyz(-220.079,56.156,220.856),104806,2987)
	create("af_eye_voron",xyz(-356.979,96.881,190.423),14908,2918)
	create("monolith_x8_regular",xyz(-295.94793701172,94.499092102051,203.97506713867),51676,2918)
	create("monolith_x8_veteran",xyz(-197.07321166992,96.005920410156,201.36112976074),119270,2957)
	create("monolith_x8_master",xyz(-229.93682861328,95.209197998047,205.41639709473),98095,2957)
	create("tank_spawn_zasada1",xyz(-305.04629516602,85.321830749512,287.00778198242),44738,2933)
	create("monolith_x8_regular",xyz(-215.50730895996,94.169532775879,306.26693725586),107558,2946)
	create("monolith_x8_veteran",xyz(-191.53134155273,74.176414489746,229.15910339355),124218,2964)
	create("monolith_x8_master",xyz(-212.88229370117,73.448081970215,144.64891052246),109261,2959)
	create("tank_spawn_zasada2",xyz(-197.20126342773,75.24991607666,84.920333862305),119090,2965)
	create("tank_spawn_zasada4",xyz(-329.95016479492,63.016952514648,95.051849365234),28565,2923)
	create("monolith_x8_veteran",xyz(-358.89923095703,50.695785522461,194.9585723877),13697,2914)
	create("monolith_x8_master",xyz(-279.56887817383,42.474052429199,201.97537231445),64608,2940)
	create("tank_spawn_zasada7",xyz(-310.10095214844,42.472610473633,187.03118896484),41066,2934)
	create("monolith_x8_regular",xyz(-244.25588989258,41.518142700195,204.23260498047),87592,2944)
	create_car("auto_turret_2",xyz(-314.57806396484,94.463806152344,194.64991760254),38198,2918, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-202.19982910156,97.14818572998,194.55479431152),115308,2957, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-284.2942199707,85.468955993652,271.30822753906),61894,2933, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-213.33656311035,74.106307983398,221.27432250977),109012,2964, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-233.52354431152,61.754249572754,111.11217498779),94832,2949, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-290.51278686523,60.409965515137,200.51188659668),56995,2939, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-322.38467407227,46.704727172852,177.36660766602),32788,2909, "scripts\\technics\\turret.ltx")
end

--' проверим наличие блокнота часового
function shax_plennik_nayti_have() 
	return has("kod_kamera",1)
end

--' отдадим блокнот Шахтёру
function shax_plennik_nayti_done(first_speaker, second_speaker)
	lost("kod_kamera",1) 
end

--' спавним мыло на стройплощадке
function spawn_soap()
	got("grenade_impulse",10)
	local obj = create("fima_soap",xyz(-51.733514404297,18.001913986206,-174.52686157227),198715,9088)
	local obj = create("fima_soap",xyz(-51.733514404297,18.001913986206,-174.62686157227),198715,9088)
	local obj = create("fima_soap",xyz(-51.733514404297,18.001913986206,-174.72686157227),198715,9088)
	local obj = create("fima_soap",xyz(-51.833514404297,18.001913986206,-174.52686157227),198715,9088)
	local obj = create("fima_soap",xyz(-51.833514404297,18.001913986206,-174.62686157227),198715,9088)
	local obj = create("fima_soap",xyz(-51.833514404297,18.001913986206,-174.72686157227),198715,9088)
	map_spot(obj.id, "treasure", "Мыло для Фимы")
	sms("Получена наводка на тайник", nil, nil, 10000)
end

--' проверим наличие мыла для Фимки
function fima_mulo_nayti_have()
	return has("fima_soap_quest",5)
end

--' отдадим мыло Фиме
function fima_mulo_nayti_done()
	lost("fima_soap_quest",5)
	got("wpn_akms_otdaca_ves")
	akill.give_sniper_ammo(2)
end

--' спавним шкатулку в Лабиринте и монстриков
function spawn_shkatul()
	local obj = create("shkatulka",xyz(-189.002,52.791,269.950),126910,2987)
	map_spot(obj.id, "treasure", "casket")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("bloodsucker_effector",xyz(-190.695,56.187,190.873),125416,2987)
	create("bloodsucker_effector",xyz(-190.695,56.187,190.873),125416,2987)
	create("zombie_weak",xyz(-190.595,56.187,190.873),125416,2987)
	create("zombie_strong",xyz(-190.495,56.187,190.873),125416,2987)
	create("zombie_hell3",xyz(-190.395,56.187,190.873),125416,2987)
	create("zombie_hell15",xyz(-190.395,56.187,190.873),125416,2987)
	create("zombie_hell15",xyz(-190.395,56.187,190.873),125416,2987)
	create("chimera_strong",xyz(-179.217,52.310,272.398),132753,2987)
	create("zombie_hell4",xyz(-179.227,52.310,272.398),132753,2987)
	create("zombie_hell5",xyz(-179.237,52.310,272.398),132753,2987)
	create("zombie_hell6",xyz(-179.247,52.310,272.398),132753,2987)
	create("zombie_hell2",xyz(-179.257,52.310,272.398),132753,2987)
	create("pseudodog_normal",xyz(-185.462,56.305,212.259),129613,2987)
	create("pseudodog_big",xyz(-185.462,56.305,212.259),129613,2987)
	create("pseudodog_normal",xyz(-185.462,56.305,212.259),129613,2987)
	create("pseudodog_big",xyz(-185.462,56.305,212.259),129613,2987)
end

--' проверим шкатулку
function adr_shkatulka_dost_have() 
	return has("shkatulka",1)
end

--' отдадим шкатулку Адреналину
function adr_shkatulka_dost_done(first_speaker, second_speaker)
	lost("shkatulka",1) 
end

--' заспавним арты во 2 пещере
function spawn_art_2peshera()
	create("af_medusa",xyz(-311.981,16.300,219.735),39736,2920)
	create("af_cristall_flower",xyz(-318.176,16.612,167.987),35394,2922)
	create("af_fireball",xyz(-128.102,15.460,351.711),147973,2974)
	create("af_cristall",xyz(-200.291,20.082,366.559),117285,2961)
	create("af_mincer_meat",xyz(-245.448,7.128,444.855),86899,2947)
	create("af_electra_sparkler",xyz(-134.238,18.732,459.057),146621,2973)
	create("af_medusa",xyz(-135.452,17.093,421.498),146315,2973)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_armor_1",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_electra_flash",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_dik_1",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_ameba_slug",xyz(-177.985,21.049,389.713),133385,2968)
end

--' проверим наличие сейфа
function tretiy_kod_dost_have() 
	return has("arhara_seif",1)
end

--' отдадим сейф Шахтёру
function tretiy_kod_dost_done(first_speaker, second_speaker)
	lost("arhara_seif",1) 
end

--' Сидор дал амулет
function amulet_gg() 
	got("amulet")
end

--' проверим ремящики и амулет для Сидора
function sidor_amulet_vzyt_have()
	return has("amulet",1) and has("remontnyi_box",2)
end

--' отдадим всё Сидору
function sidor_amulet_vzyt_done()
	lost("amulet",1)
	lost("remontnyi_box",2)
	kostya_dialog.stealth_fail_task()
end

--' сделаем ГГ нейтралом
function join_stalker(actor, npc)
	db.actor:set_character_community("actor", 0, 0)
end

--' проверим арты для Тени Монолита
function ten_monolita_talk_have()
	return has("af_arhara_globus",1) and has("af_caterpillar",1)
end

--' отдадим арты Тени Монолита
function ten_monolita_talk_done()
	lost("af_arhara_globus",1)
	lost("af_caterpillar",1)
end

--' заспавним сейф и рем.ящики
function spawn_seif_and_art()
	local obj = create("arhara_seif",xyz(-312.919,57.637,201.125),39214,2987)
	map_spot(obj.id, "treasure", "Safe")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("m_inventory_box_remontnyi_boxsidora",xyz(-316.68029785156,43.061214447021,191.11317443848),36742,2934)
--	create("remontnyi_box",xyz(-316.68029785156,43.061214447021,191.11317443848),36742,2934)
--	create("remontnyi_box",xyz(-312.71801757813,44.584491729736,184.41859436035),39171,2934)
	spawn_restrictor.spawn_mono_bunker_lestn_sr()
	spawn_restrictor.spawn_mono_bunker_verh_sr()
	spawn_restrictor.spawn_mono_bunker_verh_posled_sr()
	spawn_restrictor.spawn_mono7_bunker_presklad1_sr()
	spawn_restrictor.spawn_mono8_bunker_presklad2_sr()
	spawn_restrictor.spawn_mono_bunker_sklad_sr()
end

--' спавним ключ для удал телепорта на входе базы
function spawn_kluch_dell_tele()
	create("kluch_dell_teleport",xyz(326.871,-6.876,-18.849),1450179,2902)
end

--' спавним телепорт на входе в базу
function spawn_teleport_aver_baza_vxod()
	local se_obj = create("m_teleport_aver_baza_vxod",xyz(49.718948364258,-12.917119979858,-192.61256408691),954225,2908)
	ai:assign_story_id(se_obj.id,17000)
end

--' спавним телепорт на выходе с базы
function spawn_teleport_land_baza_vuxod()
	local se_obj = create("m_teleport_land_baza_vuxod",xyz(-29.902000427246,-26.615087509155,-159.37490844727),816025,2897)
	ai:assign_story_id(se_obj.id,17001)
end

--' спавним телепорт на входе в 3 пещеру НЗ
function spawn_teleport_aver_taynik()
	local se_obj = create("m_teleport_aver_taynik",xyz(-371.09735107422,43.853530883789,386.16714477539),231029,2887)
	ai:assign_story_id(se_obj.id,17002)
end

--' спавним телепорт в Старой деревне
function spawn_teleport_village_plen()
	local se_obj = create("m_teleport_village_plen",xyz(50.373229980469,4.1041889190674,76.716133117676),28807,3331)
	ai:assign_story_id(se_obj.id,17004)	
end

--' спавним 1телепорт на ЧАЭС2
function spawn_teleport_1_chaes2()
	local se_obj = create("m_teleport_1_chaes2",xyz(257.06002807617,11.381983757019,193.40171813965),91155,2577)
	ai:assign_story_id(se_obj.id,17008)
end

--' спавним 2телепорт на ЧАЭС2
function spawn_teleport_2_chaes2()
	local se_obj = create("m_teleport_2_chaes2",xyz(550.289672851563,80.1041946411133,204.157897949219),171515,2628)
	ai:assign_story_id(se_obj.id,17012)
end

--' спавним 3телепорт на ЧАЭС2
function spawn_teleport_3_chaes2()
	local se_obj = create("m_teleport_3_chaes2",xyz(555.68634033203,112.81456756592,197.65130615234),171515,2628)
	ai:assign_story_id(se_obj.id,17009)	
end

--' спавним 1телепорт на генераторах
function spawn_teleport_1_generators()
	local se_obj = create("m_teleport_1_generators",xyz(208.74868774414,28.487440109253,-568.76654052734),576778,3143)
	ai:assign_story_id(se_obj.id,17010)
end

--' спавним 2телепорт на генераторах
function spawn_teleport_2_generators()
	local se_obj = create("m_teleport_2_generators",xyz(198.31147766113,35.846240997314,-561.59136962891),564783,3152)
	ai:assign_story_id(se_obj.id,17011)
end

--' спавним телепорт в госпитале наверх слева
function spawn_tele_1_hosp_verh1()
	local se_obj = create("m_teleport_1_hosp_verh1",xyz(-78.431533813477,25.064765930176,608.98791503906),6000,3049)
	ai:assign_story_id(se_obj.id,17013)
end

--' спавним телепорт вход в 3 отсек 
function spawn_teleport_vhod_otsek()
	local se_obj = create("m_teleport_vhod_otsek",xyz(-94.129028320313,25.804735183716,609.15380859375),1168,3039)
	ai:assign_story_id(se_obj.id,17014)
end

--' спавним телепорт блока выхода из 3 отсека у входа 
function spawn_tele_blok_vhod_otsek()
	local se_obj = create("m_teleport_blok_vhod_otsek",xyz(-102.48352813721,25.163656234741,616.11047363281),232,3029)
	ai:assign_story_id(se_obj.id,17015)	
end

--' спавним телепорт входа дока на Припяти 
function spawn_tele_dok_prip_vxod()
	local se_obj = create("m_teleport_prip_dok_vxod",xyz(-45.148349761963,1.8893185853958,262.46716308594),54164,2164)
	ai:assign_story_id(se_obj.id,17016)	
end

--' спавним телепорт на крыше в Лиманске
function spawn_teleport_limansk_krusha()
	local se_obj = create("m_teleport_limansk_krusha",xyz(64.565872192383,21.843370437622,253.25939941406),58482,3021)
	ai:assign_story_id(se_obj.id,17020)
end

--' спавним телепорт-фото в Саркофаге
function spawn_teleport_sarcof_foto()
	local se_obj = create("m_teleport_sarcofag_foto",xyz(23.805717468262,-3.8649611473083,2.8239929676056),4684,2424)
	ai:assign_story_id(se_obj.id,17021)
end

--' спавним телепорт над мозгом
function spawn_teleport_nad_mozgom()
	local se_obj = create("m_teleport_nad_mozgom",xyz(-32.13062286377,22.806690216064,-12.40500831604),3079,1530)
	ai:assign_story_id(se_obj.id,17022)
end

--' телепорт блокир. рычаг в лиме
function spawn_teleport_blok_ruchag()
	local se_obj = create("m_teleport_blok_ruchag",xyz(-48.450138092041,-10.869502067566,-176.26718139648),2894,2993)
	ai:assign_story_id(se_obj.id,17023)
end

--' телепорт входа в секретку подвала в лиме
function spawn_teleport_podval_ok()
	local se_obj = create("m_teleport_podval_ok",xyz(-48.472511291504,-11.196914672852,-177.02395629883),2894,2993)
	ai:assign_story_id(se_obj.id,17024)
end

--' телепорт выхода из секретки подвала в лиме
function spawn_teleport_podv_vuxod()
	local se_obj = create("m_teleport_podv_vuxod",xyz(-49.113014221191,-10.754431724548,-178.7958984375),3051,2993)
	ai:assign_story_id(se_obj.id,17025)
end

--' удаляем телепорты
function delete_teleport_baza_vxod(story_id)
	release(story_object(17000))
	sms("delete_teleport_baza_vxod_0", nil, nil, 30000)
end

function delete_teleport_baza_vuxod(object)
	local telep=story_object(17001)
	if telep then
		release(telep)
		sms("delete_teleport_baza_vuxod_0", nil, nil, 30000)
	end
end

function delete_teleport_taynik(story_id)
	release(story_object(17002))
	sms("delete_teleport_taynik_0", nil, nil, 20000)
end

function sms_otkl_teleport()
	sms("%c[sender]"..translate("name_lokalnaya_set")..":\\n%c[sms_red]"..translate("sms_net_sms_otkl_teleport_0"), nil, "net", 10000, nil, [[sms\net\sms_otkl_teleport]])
end

function delete_teleport_plen(story_id)
	release(story_object(17004))
	sms("delete_teleport_plen_0", nil, nil, 30000)
end

function delete_teleport_vhod_otsek(story_id)
	release(story_object(17014))
	sms("delete_teleport_vhod_otsek_0", nil, nil, 30000)
end

function delete_tele_blok_vhod_otsek(story_id)
	release(story_object(17015))
	sms("delete_tele_blok_vhod_otsek_0", nil, nil, 30000)
end

--' получим сейф обратно от Шахтёра
function snova_seif()
	got("arhara_seif")
	spawn_restrictor.land_arhara_sr1()
	spawn_restrictor.land_arhara_sr2()
	spawn_restrictor.land_arhara_sr3()
	spawn_restrictor.land_arhara_sr4()
	spawn_restrictor.land_arhara_sr5()
	spawn_restrictor.land_arhara_sr6()
	spawn_restrictor.aver_spawn_piligrim_sr()
	spawn_restrictor.aver_spawn_piligrim_sr2()
end

--' заспавним немного артов на НЗ
function spawn_aver_art1()
	create("af_spirit_1",xyz(-311.500,0.390,-338.304),335058,2890)
	create("af_fireball",xyz(52.464,-13.941,-186.119),959429,2908)
	create("af_cristall",xyz(-338.465,-26.910,176.832),287481,2891)
	create("af_armor_2",xyz(125.058,38.844,397.450),1088689,2899)
	create("af_fireball",xyz(-126.538,-53.295,-185.044),652148,2897)
	create("art_acumm",xyz(-276.414,-23.379,250.316),396447,2891)
end

--' заспавним ящик с оружием
function box_with_weapon_spawn()
	local obj = create("box_with_weapon",xyz(74.500,-43.783,241.980),998932,2899)
	map_spot(obj.id, "green_location", "Helicopter Crate")
	sms("Received a tip on a weapon crate", nil, nil, 10000)
end

--' получим сумку для Гинеколога
function take_parcel(first_speaker, second_speaker) 
	got("parcel") 
end

--' проверим наличие ящика с оружием для Отшельника
function otshelnik_yzik_nayti_have() 
	return has("box_with_weapon",1)
end

--' отдадим ящик Отшельнику и получим УЗИ с патронами и глушаком
function otshelnik_yzik_nayti_done(first_speaker, second_speaker)
	lost("box_with_weapon",1)
	got("wpn_uzi")
	got("ammo_9x19_pbp")
	got("wpn_9mm_nato_silencer") 
end

--' удаляем Звездочёта с НЗ
function delete_land_zvezdochet()
	release("land_arhara_zvezdochet")
end

--' заспавним ещё немного артов на НЗ
function spawn_aver_art2()
	create("af_vyvert",xyz(-252.372,-1.190,-325.960),436604,2892)
	create("af_gravi",xyz(-163.165,51.365,-415.454),588454,2890)
	create("af_drops",xyz(-119.568,22.321,64.620),664582,2894)
	create("af_vyvert",xyz(-391.785,58.160,361.651),194833,2887)
	create("af_blood",xyz(345.540,4.877,-87.297),1485407,2902)
	create("af_mincer_meat",xyz(306.971,-38.273,386.180),1415062,2904)
	create("af_electra_sparkler",xyz(134.876,14.633,66.266),1105003,2902)
end

--' отдадим сумку и сейф медику
function aut_parcel(first_speaker, second_speaker)
	lost("parcel",1)
	lost("arhara_seif",1) 
end

--' заспавним лекарства на Кордоне для Гинеколога
function spawn_medik_lekarstvo()
	local box = story_object(5014)
	create_parent("tabletki_1",3,box)
	create_parent("tabletki_2",3,box)
	create_parent("tabletki_3",3,box)
	create_parent("shpriz",5,box)
	create_parent("medkit",2,box)
	create_parent("antirad",2,box)
end

--' проверим наличие медикаментов
function ginekolog_lekarstvo_nayti_have()
	return has("shpriz",5) and
		has("tabletki_1",3) and
		has("tabletki_2",3) and
		has("tabletki_3",3)
end

--' отдадим медхлам Гинекологу
function ginekolog_lekarstvo_nayti_done()
	lost("shpriz",5)
	lost("tabletki_1",3)
	lost("tabletki_2",3)
	lost("tabletki_3",3)
end

--' проверим наличие 2 аккумул для Жоры
function jora_accumul_have() 
	return has_info("otshel_uznat_start") and has("acumm",2)
end

--' отдадим аккум Жорке
function jora_accumul_done()
	lost("acumm",2)
end

--' а это рюкзачок тайника Пилигрима
function new_inventory17()
	local obj = create("m_inventory_box17",xyz(144.712,-3.956,-313.140),1121536,2900)
	map_spot(obj.id, "treasure", "Pilgrim's Secret")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' проверим наличие вещей для Пилигрима
function piligrim_britva_nayti_have()
	return has("acumm",1) and
		has("af_dik_1",1) and
		has("af_vyvert_green",1) and
		has("britva",1)
end

--' отдадим причитающиеся Пилигриму и получим часы для Старика и новый ствол с патронами
function piligrim_britva_nayti_done(first_speaker, second_speaker)
	lost("britva",1)
	lost("af_vyvert_green",1)
	lost("af_dik_1",1)
	lost("acumm",1)
	got("starik_chasy")
	got("wpn_akm203_pso")
	got("wpn_scope_lepoid")
	got("ammo_7.62x39_ap")
end

--' проверим наличие вещей для Пилигрима при неудаче стелса
function piligrim_proval_stels()
	return has("acumm",1) and
		has("af_dik_1",1) and
		has("af_vyvert_green",1) and
		has("britva",1)
end

--' проверим наличие финансов при неудаче стелса
function piligrim_have_money_70000(actor,npc)
    return actor:money() > 70000
end

--' отдадим деньги Пилигриму
function piligrim_give_money_70000(t1,t2)
	lost_money(70000)
end

--' проверим наличие часов для Старика
function starik_zadanie_vzyt_have() 
	return has("starik_chasy",1)
end

--' отдадим часы
function starik_zadanie_vzyt_done()
	lost("starik_chasy",1)
end

--' удаляем бородатого Пилигрима
function delete_land_piligrim()
	release("piligrim")
end

--' получим аккумул от Пилигрима
function take_pil_akkum(first_speaker, second_speaker) 
	got("acumm",3)
end

--' заспавним ещё немного артов на НЗ
function spawn_aver_art3()
	create("af_rusty_thorn",xyz(420.649,43.074,321.392),1631337,2906)
	create("af_rusty_kristall",xyz(18.712,48.116,-415.46),898878,2898)
	create("af_drops",xyz(-50.587,-39.939,-99.154),782762,2897)
	create("art_acumm",xyz(-129.216,38.372,403.420),648050,2896)
	create("art_acumm",xyz(93.864,-4.432,-105.082),1033389,2902)
	create("af_mincer_meat",xyz(-276.414,-23.379,250.316),396447,2891)
	create("af_mincer_meat",xyz(76.217,-8.158,-208.145),1002137,2897)
end

--' проверим ультрадетектор для Адреналина
function otsh_pda_nayti_have()
	return has("detector_elite_john",1)
end

--' отдадим детектор Адреналину
function otsh_pda_nayti_done(first_speaker, second_speaker)
	lost("detector_elite_john",1)
	got("wpn_ak47_md")
end

--' проверим 2 эл детектора и арт для Голограмы
function golo_detektor_nayti_have()
	return has("detector_elite",2) and has("af_caterpillar",1)
end

--' отдадим причитающиеся Голограме
function golo_detektor_nayti_done()
	lost("detector_elite",2)
	lost("af_caterpillar",1)
end

--' рюкзачок тайника вора
function new_inventory18()
	local obj = create("m_inventory_box18",xyz(195.210,-1.436,53.253),339324,384)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

function otshelnik_sms1()
	sms("%c[sender]"..translate("name_otshelnik")..":\\n%c[sms_red]"..translate("sms_otshelnik_otshelnik_sms1_0"), nil, "otshelnik", 40000, nil, [[sms\otshelnik\otshelnik_sms1]])
end

function adrenalin_sms1()
	sms("%c[sender]"..translate("name_adrenalin")..":\\n%c[sms_red]"..translate("sms_adrenalin_adrenalin_sms1_0"), nil, "adrenalin", 40000, nil, [[sms\adrenalin\adrenalin_sms1]])
end

function medik_sms1()
	sms("%c[sender]"..translate("name_shura_ginekolog")..":\\n%c[sms_red]"..translate("sms_ginekolog_medik_sms1_0"), nil, "ginekolog", 40000, nil, [[sms\ginekolog\medik_sms1]])
end

--' проверим наличие дискетки
function medik_pribor_1_nayti_have()
	return has("land_disketka",1)
end

--' отдадим дискету Гинекологу
function medik_pribor_1_nayti_done()
	lost("land_disketka",1)
end

--' спавним карту Клыка
function spawn_karta()
	local obj = create("kluk_karta",xyz(-407.265,0.946,58.977),167526,2889)
	map_spot(obj.id, "treasure", "Fang Map")
end

--' дискету и арты в Лабиринте
function spawn_trup()
	local obj = create("land_disketka",xyz(-77.331,42.754,469.492),153869,2987)
	map_spot(obj.id, "treasure", "Diskette")
	create("af_medusa",xyz(-311.981,16.300,219.735),39736,2920)
	create("af_gold_fish",xyz(-218.433,20.138,54.736),105379,2958)
	create("af_fireball",xyz(-128.102,15.460,351.711),147973,2974)
	create("af_mincer_meat",xyz(-245.448,7.128,444.855),86899,2947)
	create("af_electra_sparkler",xyz(-134.238,18.732,459.057),146621,2973)
	create("af_medusa",xyz(-135.452,17.093,421.498),146315,2973)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("art_acumm",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_armor_1",xyz(-229.414,14.210,424.312),98933,2954)
	create("af_electra_flash",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_spirit_1",xyz(-196.013,19.972,316.334),120678,2963)
	create("art_acumm",xyz(-196.013,19.972,316.334),120678,2963)
	create("af_ameba_slug",xyz(-177.985,21.049,389.713),133385,2968)
	create("af_dummy_pellicle",xyz(-78.366,42.766,469.674),153706,2987)
end

function medik_sms2()
	sms("%c[sender]"..translate("name_shura_ginekolog")..":\\n%c[sms_red]"..translate("sms_ginekolog_medik_sms2_0"), nil, "ginekolog", 10000, nil, [[sms\ginekolog\medik_sms2]])
end

function nekto_sms()
	sms("%c[sender]"..translate("name_neizvestnii_stalker")..":\\n%c[sms_red]"..translate("nekto_sms_0_0"), nil, "unknown", 10000, nil, [[sms\net\nekto_sms]])
end

--' удаляем раненого монолитовца
function delete_dead_mono()
	release("dead_mono_labirint")
end

--' спавн пустых колб на Стройке
function spawn_kolba_pust()
	local obj = create("kolba_pustay",xyz(68.489,15.409,-148.36),291652,9098)
	local obj = create("kolba_pustay",xyz(68.259,15.409,-148.36),291652,9098)
	local obj = create("kolba_pustay",xyz(68.009,15.409,-148.36),291652,9098)
	map_spot(obj.id, "treasure", "empty flasks")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' удаляем бритого Пилигрима
function delete_piligrim_1()
	release("piligrim_1")
end

--' проверим наличие пустых колб
function kolba_pust_est()
	return has("kolba_pustay",3)
end

--' отдадим карту Клыка и пустые колбы Гинекологу
function karta_otdat()
	lost("kluk_karta",1)
	lost("kolba_pustay",3)
end

--' Проверим наличие блоков питания и микросхем для перфузора
function akkum_and_mikposx_nayti_have()
	return has("elek_plata",2) and has("ekza_akkumul",2)
end

--' получим карту и её копию и отдадим блоки
function akkum_and_mikposx_nayti_done(first_speaker, second_speaker)
	lost("elek_plata",2)
	lost("ekza_akkumul",2)
	got("kluk_karta")
	got("kluk_karta_kopiy")
end

--' спавним аккум для экзы, платы и ключ на выход 
function spawn_plata_and_akkum()
	local obj = create("ekza_akkumul", xyz(28.803,-22.934,-178.421),917014,2897)
	local obj = create("ekza_akkumul", xyz(28.845,-22.935,-178.511),917014,2897)
	map_spot(obj.id, "treasure", "Exo Batteries")
	local obj = create("elek_plata", xyz(47.349,-20.324,-157.622),950498,2897)
	local obj = create("elek_plata", xyz(47.852,-20.341,-157.487),950498,2897)
	map_spot(obj.id, "treasure", "Salary")
	local obj = create("kluch_dell_teleport1",xyz(29.081,-22.875,-178.589),918277,2897)
	map_spot(obj.id, "treasure", "Teleport Delete Key")
	sms("Received a tip on the cache", nil, nil, 10000)	
-- Заспавним 5 добрых мстителей у Химеры на замену враждебному гулагу
create("land_sniper_zamena",xyz(140.893,-4.243,-301.720),1114383,2900)
create("land_sniper_zamena1",xyz(140.893,-4.243,-301.720),1114383,2900)
create("land_sniper_zamena2",xyz(145.974,-3.832,-307.559),1123973,2900)
create("land_sniper_zamena3",xyz(129.292,-4.530,-294.973),1093757,2900)
create("land_sniper_zamena4",xyz(153.136,-3.127,-293.512),1136047,2900)
	map_spot(server_object("land_sniper_chimaera").id,"crlc_big","chimaera_name")
end

-- Удаляем 5 добрых мстителей у Химеры и возвращаем враждебный гулаг в он-лайн
function delete_sniper_zamena_team()
for a=1,65534,1 do
local obj=server_object(a)
if obj and string.find(obj:name(),"land_sniper_zamena") then
release(obj,true)
end
give_info("piligrim_britva_nayti_start")
	del_map_spot(server_object("land_sniper_chimaera").id,"crlc_big")
end
end

function piligrim_2_sms()
	sms("%c[sender]"..translate("name_blatnoi")..":\\n%c[sms_red]"..translate("sms_blatnoy_piligrim_2_sms_0"), nil, nil, 40000, nil, [[sms\blatnoy\piligrim_2_sms]])
end

--' ГГ друг снайперов/сейчас это уже не нужно, мирим Химеру с ГГ через логику 
function friend_community(actor, npc)
	db.actor:set_character_community("stranger", 0, 0)
end

--' заберём ключи от телепортов
function kluch_tele_otdat()
	lost("kluch_dell_teleport",1)
	lost("kluch_dell_teleport1",1)
end

--' проверим голову
function chimaera_zadan_nayti_have()
	return has("sidor_head",1)
end

--' отдадим голову и получим арт
function chimaera_zadan_nayti_done(first_speaker, second_speaker)
	lost("sidor_head",1)
	got("af_gold_mincer_meat")
end

--' Гинеколог дал денег и спавн перфузора
function shura_otdal(first_speaker, second_speaker)
	got_money(30000)
	local obj = create("perfuzor_pust",xyz(-411.602,0.698,62.837),160046,2889)
	map_spot(obj.id, "treasure", "Perfusor")
	sms("Received a tip on the cache", nil, nil, 10000)	
end

function medik_sms3()
	sms("%c[sender]"..translate("name_shura_ginekolog")..":\\n%c[sms_red]"..translate("sms_ginekolog_medik_sms3_0"), nil, "ginekolog", 40000, nil, [[sms\ginekolog\medik_sms3]])
end

--' проверим наличие полных колб для Гинеколога
function ginek_vlip_have()
	return has("kolba_orand_poln",1) and has("kolba_siniy_poln",1)
end

--' отдадим колбы Гинекологу и получим нож хирурга и Сайгу "Снайперскую"
function ginek_vlip_done(first_speaker, second_speaker)
	lost("kolba_orand_poln",1)
	lost("kolba_siniy_poln",1)
	got("wpn_knife_n")
	got("wpn_sayga12_sk1")
	got("ammo_12x70_kart")
	second_speaker:set_relation(game_object.friend, first_speaker)
end

function ziklop_sms1()
	sms("%c[sender]"..translate("name_tsiklop")..":\\n%c[sms_red]"..translate("sms_ziklop_ziklop_sms1_0"), nil, "ziklop", 40000, nil, [[sms\ziklop\ziklop_sms1]])
end

--' спавним особого контролёра и свиту
function spawn_trupak()
	create("controller_filin",xyz(71.566024780273,0.9872225522995,338.92221069336),183216,2157)
	create("girl_zombied1",xyz(77.326461791992,0.80606210231781,328.80935668945),188759,2157)
	create("voen_zombied2",xyz(50.622013092041,0.19790950417519,349.37219238281),162789,2260)
	create("zombie_blow",xyz(24.627826690674,0.53881990909576,337.68389892578),132632,2260)
	create("zombie_beee",xyz(6.4521131515503,0.97632801532745,339.99188232422),109936,2260)
	create("zombie_hell",xyz(12.806783676147,0.14677858352661,376.99716186523),117411,2260)
	create("voen_zombied1",xyz(47.212017059326,1.162348151207,374.2412109375),158950,2260)
	create("zombie_plague_komar",xyz(100.13232421875,0.86667048931122,357.22863769531),211251,2157)
	create("girl_zombied2",xyz(113.23184967041,0.82060730457306,320.94140625),224103,2264)
	create("esc_arhara_stalker_zombied",xyz(-32.653274536133,1.0320378541946,308.14407348633),66570,2262)
	create("esc_arhara_stalker_zombied1",xyz(-31.808841705322,1.1013149023056,339.19082641602),68171,2156)
	create("zombie_plague",xyz(55.633369445801,1.032900929451,392.32992553711),167717,2270)
end

--' спавним труп контролёра
function controller_filin_dead()
	iterate_level_objects("controller_filin", function(obj)
		local pos = obj:position()
		local lv = obj:level_vertex_id()
		local gv = obj:game_vertex_id()
		release(obj)
		create("trupak",pos,lv,gv)
		return false
	end)
end

--' проверим наличие трупа для Филина
function land_oxot_nayti_have()
	return has("trupak",1)
end

--' проверим наличие финансов за чучело и 10ти когтей химеры
function filin_have_money_100000(actor,npc)
    return actor:money() > 100000 and has("part_chimera_kogot",10)
end

function start_filin()
	lost("trupak",1)
	got("wpn_glock35",1)
	local delta= math.random(23, 24) * 60
	local ftime=game.minutes()+delta
        Timer:start_game("filin_timer",0,0,delta,"arhara_dialog.filin_head_sms()")
	set_value("filin_head", ftime)
end
function is_filin_ready()
	local gtime = game.minutes()
	local ftime = get_value("filin_head", 0)
	if gtime >= ftime then
		return true
	else
		return false
	end
end

function filin_head_sms()
	sms("%c[sender]"..translate("name_filin")..":\\n%c[sms_red]"..translate("sms_filin_head_0"), nil, "filin", 15000, nil, [[sms\filin\sms_filin_head]])
end

--' отдадим когти Филину и заспавним голову Сидора
function filin_kogot(first_speaker, second_speaker)
	lost_money(100000)
	lost("part_chimera_kogot",10)
	create("sidor_head", xyz(-106.790,20.220,-49.719),685943,2894)
	del_value("filin_head")
end

--' рюкзачок Химеры на Радаре рандомно в 8ми местах
function new_inventory19()
local b = {
		{position={x=-16.721,y=0.29,z=-55.305},gv=1960,lv=5214},
	        {position={x=-18.20,y=0.75,z=-62.0085},gv=1960,lv=5012},
	        {position={x=-7.86,y=0.75,z=-70.225},gv=1960,lv=7748},
	        {position={x=-12.45,y=0.3025,z=-66.00},gv=1960,lv=6651},
	        {position={x=-7.94,y=0.90,z=-57.50},gv=1960,lv=7080},
	        {position={x=-12.61,y=0.2175,z=-60.81},gv=1960,lv=6441},
		{position={x=-6.58,y=4.24,z=-48.77},gv=1960,lv=7757},
		{position={x=-18.88,y=4.948,z=-45.109},gv=1960,lv=5031}
	}
	local a = table.random(b)
	local obj = create("m_inventory_box19", xyz(a.position.x,a.position.y,a.position.z), a.lv, a.gv)
	map_spot(obj.id, "treasure", "Cache of the Chimera")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' последний тайник Циклопа и спавн полного перфузора в виде рюкзака
function new_inventory20()
	iterate_level_objects("perfuzor_pust", function(obj)
		release(obj)
		return false
	end)
	local obj = create("m_inventory_box20", xyz(-261.508,-22.589,211.521),74263,1789)
	map_spot(obj.id, "treasure", "Cache")
	local obj = create("m_inventory_box38", xyz(-411.602,0.698,62.837),160046,2889)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

function kluk_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_sms1_0"), nil, "klyk", 60000, nil, [[sms\kluk\kluk_sms1]])
end

--' отдадим карту Клыку
function karta_otdat1(first_speaker, second_speaker)
	lost("kluk_karta",1)
end

--' проверим наличие блокнота наёмника
function kluk_vstrecha_have()
	return has("naem_bloknot",1)
end

--' отдадим блокнот наёмника Клыку
function kluk_vstrecha_done(first_speaker, second_speaker)
	lost("naem_bloknot",1)
	got("wpn_colt_coonan",1)
	got("ammo_357_hp_mag",1)
end

--' убираем ненужные труп Костолома с Военной Лаборатории
function delete_warlab_trups()
	release("warlab_kostolom_dead")
end

--' Вступаем в Монолит
function join_monolith(actor, npc)
	if has_info("sidor_amulet_proval") then
		return
	end
	if sidor_amulet_exo_wearing() then
		db.actor:set_character_community("monolith", 0, 0)
	else
		give_info("sidor_amulet_proval")
	end
end

--' Вступаем в Наёмники
function join_killer(actor, npc)
	if has_info("shalyi_ssorimsya") and not has("amul_naemn") then
		create("amul_naemn", db.actor:position(), db.actor:level_vertex_id(), db.actor:game_vertex_id(), db.actor:id())
		return
	end
	db.actor:set_character_community("killer", 0, 0)
	local chkgoodwill = relation_registry.community_goodwill("killer", db.actor:id())
	if chkgoodwill < 0 then 
		chkgoodwill = chkgoodwill+300
		relation_registry.set_community_goodwill("killer", db.actor:id(), chkgoodwill)
	else
		relation_registry.set_community_goodwill("killer", db.actor:id(), 300)
	end
end

--' заспавним фанатиков и наёмников в Военной Лаборатории
function spawn_nepis_to_warlab()
	create("pri_monolith_respawn_1",xyz(5.648,0.741,2.091),5363,3210)
	create("pri_monolith_respawn_2",xyz(6.743,1.004,-1.577),5654,3210)
	create("rad_monolith_respawn_1",xyz(2.688,1.059,-5.867),4873,3187)
	create("pri_monolith_respawn_2",xyz(-2.972,0.379,-3.270),3960,3168)
	create("tank_spawn_zasada3",xyz(-13.204,-3.150,1.400),1830,3168)
	create("rad_monolith_respawn_1",xyz(-5.634,1.073,9.869),3224,3171)
	create("rad_monolith_respawn_3",xyz(-16.708,-3.083,-16.421),1196,3158)
	create("pri_monolith_respawn_1",xyz(14.347,-11.473,-8.145),6669,3212)
	create("tank_spawn_zasada",xyz(-3.450,-11.413,-6.176),3782,3181)
	create("pri_monolith_respawn_2",xyz(2.568,-11.470,2.541),4895,3188)
	create("tank_spawn_zasada1",xyz(15.654,-11.415,-0.020),6905,3209)
	create("rad_monolith_respawn_1",xyz(0.708,-7.310,-6.948),4524,3182)
	create("rad_monolith_respawn_2",xyz(-0.106,-3.150,4.517),4452,3196)
	create("mil_killer_respawn_2",xyz(16.459,1.199,-2.748),7009,3216)
	create("mil_killer_respawn_2",xyz(-1.101,1.010,0.302),4184,3187)
	create("mil_killer_respawn_3",xyz(-12.934,1.001,3.860),1956,3162)
	create("ros_killer_respawn_1",xyz(-10.352,-7.043,-32.332),2224,3170)
	create("ros_killer_respawn_1",xyz(-37.230,-11.944,-36.897),143,3155)
	create("mil_killer_respawn_1",xyz(-15.675,-1.421,-33.730),1393,3164)
	create("mil_killer_respawn_2",xyz(-13.429,-15.390,6.870),1852,3160)
	create("ros_killer_respawn_2",xyz(9.509,-19.704,10.085),6118,3204)
	create("ros_killer_respawn_2",xyz(-3.896,-7.313,0.398),3598,3172)
	create("ros_killer_respawn_3",xyz(2.706,-3.150,6.640),4903,3178)
end

--' спавним телепорт на входе в секретку Военной Лаборатории
function spawn_teleport_warlab_taynik()
	local se_obj = create("m_teleport_warlab_sekret",xyz(18.836868286133,-3.1513543128967,0.90203523635864),7161,3217)
	ai:assign_story_id(se_obj.id,17003)
end

--' удаляем телепорт на входе в секретку Военной Лаборатории
function delete_teleport_warlab(story_id)
	release(story_object(17003))
	sms("delete_teleport_warlab_0", nil, nil, 40000)
end

--' проверим наличие псевдопечатки
function proverim_pseudo()
	return has("pseudopechatka",1)
end

--' проверим наличие печатки наёмника
function lukash_pechatka_nayti_have()
	return has("amul_naemn",1)
end

local killers_outfits = {
		["merc_scientific_outfit"]=true,
		["killer_blue_exoskeleton"]=true,
		["killer_green_exoskeleton"]=true,
		["outfit_killer_m1"]=true,
		["killer_outfit"]=true
}

function is_killer_outfit(section)
	return killers_outfits[section]
end

function is_killer_outfit_dressed()
	local outfit= db.actor:item_in_slot(inventory_slots.OUTFIT)
	return outfit and is_killer_outfit(outfit:section()) or false
end

function killer_line_start()
	join_killer()
	Timer:start_game("killer_line_check", 0, 24, 0, "arhara_dialog.killer_line_timeout()")
end

function killer_line_timeout()
	give_info("lukash_pechatka_proval")
	arhara_dialog.join_stalker()
	sms("%c[sender]"..translate("name_lokalnaya_set")..":\\n%c[sms_red]"..translate("lukash_pechatka_proval"), nil, "net", 15000, nil) --, [[sms\net\sms_otkl_teleport]])
end

--' отдадим псевдопечатку Лукашу
function lukash_pechatka_nayti_done(first_speaker, second_speaker)
	lost("pseudopechatka",1)
	got("wpn_glock_18col")
end

--' заспавним собачек в Военной Лаборатории
function spawn_dog_to_warlab()
	create("dog_habaruch",xyz(3.371,1.008,-3.150),4988,3187)
	create("dog_weak",xyz(3.371,1.008,-3.150),4988,3187)
	create("dog_weak",xyz(-12.583,-2.960,0.312),1942,3168)
	create("dog_normal",xyz(-12.583,-2.960,0.312),1942,3168)
	create("pseudodog_normal",xyz(-4.049,0.998,3.772),3607,3174)
	create("dog_strong",xyz(-4.049,0.998,3.772),3607,3174)
	create("dog_strong",xyz(-4.049,0.998,3.772),3607,3174)
	create("dog_weak",xyz(-6.291,-7.085,2.363),3064,3172)
	create("dog_weak",xyz(-6.291,-7.085,2.363),3064,3172)
	create("pseudodog_weak",xyz(-6.291,-7.085,2.363),3064,3172)
	create("pseudodog_big",xyz(-6.291,-7.085,2.363),3064,3172)
	create("dog_weak",xyz(-1.689,-3.150,7.975),4209,3178)
	create("pseudodog_normal",xyz(-1.689,-3.150,7.975),4209,3178)
	create("dog_normal",xyz(-1.689,-3.150,7.975),4209,3178)
	create("dog_habaruch",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_habaruch",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_weak",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_weak",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_weak",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_weak",xyz(3.961,-11.417,-1.361),5107,3191)
	create("dog_weak",xyz(3.961,-11.417,-1.361),5107,3191)
	create("pseudodog_weak",xyz(-23.483,-15.388,-0.544),581,3157)
	create("dog_normal",xyz(-23.483,-15.388,-0.544),581,3157)
	create("dog_normal",xyz(-23.483,-15.388,-0.544),581,3157)
	create("dog_weak",xyz(-23.483,-15.388,-0.544),581,3157)
end

--' заспавним болотных тварей рестриктором
function spawn_bolot_tv()
	create("bloodsucker_effector",xyz(4.587,-19.703,6.885),5252,3195)
	create("bloodsucker_effector",xyz(-0.755,-19.646,16.467),4380,3180)
	sms("%c[sender]"..translate("name_istochnik_neizvesten")..":\\n%c[sms_red]"..translate("sms_net_spawn_bolot_tv_0"), nil, "nodata", 6000, nil, [[sms\net\spawn_bolot_tv]])
end

--' Удаляем Клыка и Пилигрима с АС
function delete_stalky_as()
	release("kluk_sklad")
	release("piligrim_sklad")
end

--' проверим наличие рации
function pantera_fone_nayti_have()
	return has("telefon",1)
end

--' отдадим рацию Пантере и получим бабки
function pantera_fone_nayti_done(first_speaker, second_speaker)
	lost("telefon",1)
	got_money(5000)
end

--' отдадим рацию Пантере при провале квеста
function pantera_fone_nenashel(first_speaker, second_speaker)
	lost("telefon",1)
end

--' проверим наличие диска для Пантеры
function pantera_zadanie2_have()
	return has("disk_pantera",1)
end

--' отдадим диск Пантере и получим бабки
function pantera_zadanie2_done(first_speaker, second_speaker)
	lost("disk_pantera",1)
	got_money(60000)
	timer("run", 2.0, "arhara_dialog.disk_pantera_delete()")
end

-- Удаляем диск, если вдруг Костыльнога у нас не удалился (подстраховка)
function disk_pantera_delete()
find_and_release("disk_pantera")
end

--' проверим наличие финансов для Пантеры при провале квеста
function pantera_have_money_50000(actor,npc)
    return actor:money() > 250000
end

--' отдадим диск Пантере 
function pantera_disk_proval(first_speaker, second_speaker)
	lost("disk_pantera",1)
end

--' отдадим деньги Пантере при провале квеста
function pantera_give_money_50000(t1,t2)
	lost_money(250000)
	timer("run", 1.0, "arhara_dialog.delete_shalyi_naim()")
end

--' проверим наличие чучела
function body_pantera_talk_have()
	return has("chuchelo_body",1)
end

--' отдадим чучело
function body_pantera_talk_done(first_speaker, second_speaker)
	lost("chuchelo_body",1)
end

--' спавним рюкзачок для задания Пантеры на Стройплощадке и чучело там же
function new_inventory21()
	local obj = create("m_inventory_box21",xyz(-177.39,3.80,72.39),59855,9264)
	map_spot(obj.id, "treasure", "Panther's Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
        create("forgotten_naim_ohrannik",xyz(-167.42,3.02,74.39),68887,9264)
        create("forgotten_naim_ohrannik_2",xyz(-167.41,3.02,79.17),68894,9264)
        create("forgotten_naim_ohrannik_3",xyz(-167.43,3.02,76.74),68891,9264)
	create("chuchelo_body",xyz(-192.47,5.14,74.50),48914,9264)
end

-- Спавним Шалого и его свиту
function shalyi_killer_spawn()
	create("shalyi_killer",xyz(-168.77,3.02,73.47),67647,9264)
	create("shalyi_naim_ohrannik",xyz(-160.14,3.12,98.32),75120,9206)
	create("shalyi_naim_ohrannik1",xyz(-149.54,2.87,102.93),84215,9204)
	create("shalyi_naim_ohrannik2",xyz(-142.27,2.97,71.24),90720,9264)
	create("shalyi_naim_ohrannik3",xyz(-164.33,3.02,58.71),71331,9264)
	create("shalyi_naim_ohrannik4",xyz(-189.80,7.79,95.79),50107,9265)
	create("shalyi_naim_ohrannik5",xyz(-166.78,9.92,95.31),69539,9345)
	create("shalyi_naim_ohrannik6",xyz(-158.51,10.29,118.21),76946,9202)
	create("shalyi_naim_ohrannik7",xyz(-138.78,6.62,141.36),93804,9202)
	create("shalyi_naim_ohrannik8",xyz(-216.13,7.11,83.31),28572,9266)
	create("shalyi_naim_ohrannik9",xyz(-165.05,3.00,71.72),70766,9264)
	create("shalyi_naim_ohrannik10",xyz(-164.86,3.00,82.56),70782,9265)
	create("shalyi_naim_ohrannik11",xyz(-162.72,2.97,83.56),73205,9204)
        give_info("no_teleport_near_heli_btr")
	sms("%c[sender]"..translate("name_shalii")..":\\n%c[sms_red]"..translate("characters_voice_scenario_buusty_doprygalsya_0"), 2, nil, 5000, nil, [[characters_voice\scenario\buusty\doprygalsya]])
end

-- Делаем зарубу на Стройплощадке, если поссорились с Шалым
function forgotten_killer_zaruba()
	lost_item("amul_naemn")
	create("shalyi_naim_ohrannik13",xyz(-251.50,6.96,246.33),4088,9196)
	create("shalyi_naim_ohrannik14",xyz(-246.13,6.96,230.07),6205,9196)
	create("shalyi_naim_ohrannik15",xyz(-194.17,4.32,254.21),46811,9191)
	create("shalyi_naim_ohrannik16",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik12",xyz(-200.13,5.65,69.19),41353,9270)
	create("shalyi_naim_ohrannik1",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik2",xyz(-227.72,7.92,130.18),19921,9268)
	create("shalyi_naim_ohrannik3",xyz(-239.46,6.95,210.78),10583,9193)
	create("shalyi_naim_ohrannik4",xyz(-212.45,5.05,207.84),32055,9197)
	create("shalyi_naim_ohrannik5",xyz(-176.67,2.69,190.57),60629,9185)
	create("shalyi_naim_ohrannik6",xyz(-99.74,2.50,147.67),130489,9183)
	create("shalyi_naim_ohrannik7",xyz(-118.20,2.94,73.02),112099,9346)
	create("shalyi_naim_ohrannik8",xyz(-113.00,3.05,21.68),117451,9164)
	create("shalyi_naim_ohrannik9",xyz(-173.33,4.05,-16.41),63307,9254)
	create("shalyi_naim_ohrannik10",xyz(-238.80,6.91,210.69),11112,9193)
	create("shalyi_naim_ohrannik11",xyz(-194.17,4.32,254.21),46811,9191)
	timer("run", 120.0, "arhara_dialog.forgotten_killer_zaruba1()")
end

function forgotten_killer_zaruba1()
	if level.get_game_difficulty() > 0 then
	create("shalyi_naim_ohrannik10",xyz(-251.50,6.96,246.33),4088,9196)
	create("shalyi_naim_ohrannik11",xyz(-246.13,6.96,230.07),6205,9196)
	create("shalyi_naim_ohrannik3",xyz(-194.17,4.32,254.21),46811,9191)
	create("shalyi_naim_ohrannik8",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik1",xyz(-200.13,5.65,69.19),41353,9270)
	create("shalyi_naim_ohrannik12",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik9",xyz(-227.72,7.92,130.18),19921,9268)
	create("shalyi_naim_ohrannik7",xyz(-239.46,6.95,210.78),10583,9193)
	create("shalyi_naim_ohrannik5",xyz(-212.45,5.05,207.84),32055,9197)
	create("shalyi_naim_ohrannik4",xyz(-176.67,2.69,190.57),60629,9185)
	create("shalyi_naim_ohrannik",xyz(-99.74,2.50,147.67),130489,9183)
	create("shalyi_naim_ohrannik2",xyz(-118.20,2.94,73.02),112099,9346)
	create("shalyi_naim_ohrannik6",xyz(-113.00,3.05,21.68),117451,9164)
	timer("run", 120.0, "arhara_dialog.forgotten_killer_zaruba2()")
	end
end

function forgotten_killer_zaruba2()
	if level.get_game_difficulty() > 1 then
	create("shalyi_naim_ohrannik12",xyz(-251.50,6.96,246.33),4088,9196)
	create("shalyi_naim_ohrannik4",xyz(-194.17,4.32,254.21),46811,9191)
	create("shalyi_naim_ohrannik",xyz(-200.13,5.65,69.19),41353,9270)
	create("shalyi_naim_ohrannik1",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik3",xyz(-227.72,7.92,130.18),19921,9268)
	create("shalyi_naim_ohrannik5",xyz(-239.46,6.95,210.78),10583,9193)
	create("shalyi_naim_ohrannik10",xyz(-176.67,2.69,190.57),60629,9185)
	create("shalyi_naim_ohrannik9",xyz(-118.20,2.94,73.02),112099,9346)
	create("shalyi_naim_ohrannik8",xyz(-173.33,4.05,-16.41),63307,9254)
	create("shalyi_naim_ohrannik11",xyz(-238.80,6.91,210.69),11112,9193)
	create("shalyi_naim_ohrannik6",xyz(-194.17,4.32,254.21),46811,9191)
	timer("run", 180.0, "arhara_dialog.forgotten_killer_zaruba3()")
	end
end

function forgotten_killer_zaruba3()
	if level.get_game_difficulty() > 2 then
	create("shalyi_naim_ohrannik12",xyz(-251.50,6.96,246.33),4088,9196)
	create("shalyi_naim_ohrannik",xyz(-246.13,6.96,230.07),6205,9196)
	create("shalyi_naim_ohrannik9",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik12",xyz(-238.76,10.75,99.67),10955,9271)
	create("shalyi_naim_ohrannik4",xyz(-239.46,6.95,210.78),10583,9193)
	create("shalyi_naim_ohrannik10",xyz(-212.45,5.05,207.84),32055,9197)
	create("shalyi_naim_ohrannik7",xyz(-176.67,2.69,190.57),60629,9185)
	create("shalyi_naim_ohrannik8",xyz(-99.74,2.50,147.67),130489,9183)
	create("shalyi_naim_ohrannik13",xyz(-118.20,2.94,73.02),112099,9346)
	create("shalyi_naim_ohrannik5",xyz(-113.00,3.05,21.68),117451,9164)
	create("shalyi_naim_ohrannik2",xyz(-173.33,4.05,-16.41),63307,9254)
	create("shalyi_naim_ohrannik11",xyz(-194.17,4.32,254.21),46811,9191)
	end
end

--' проверим наличие финансов за проход в ангар
function naim_ohrannik3_money_30000(actor,npc)
    return actor:money() > 30000
end

--' отдадим деньги охраннику за проход в ангар без проблем
function naim_ohrannik3_give_money(t1,t2)
	lost_money(30000)
end

--' проверим наличие суперската
function pantera_zadanie3_have()
	return has("exo_mil_exoskeleton_p",1)
end

--' отдадим броник Шалому
function shalyi_done(first_speaker, second_speaker)
	lost("exo_mil_exoskeleton_p",1)
end

-- Запустим таймер на 25 секунд и дадим время подумать
function vremya_podumat()
	timer("run", 4.0, "arhara_dialog.ostanovka_timera()")
end

function ostanovka_timera()
        give_info("vremya_podumat1")
	timer("run", 20.0, "arhara_dialog.ostanovka_timera1()")
end

-- остановим выдачу поршня ссоры, если меченый передумал
function ostanovka_timera1()
	if has_info("ostanovka_timera") then return end
	give_info("shalyi_ssorimsya")
end

-- заспавним на Юпитере рюкзачок со Скатом, о котором говорил Шалый
function inventory21_spawn()
	local obj = create("m_inventory_box_shalyi",xyz(323.64,31.38,-297.80),1234553,3745)
	map_spot(obj.id, "treasure", "Cache of Shaly")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' отдадим броник Пантере и получим бабки
function pantera_zadanie3_done()
	lost("exo_mil_exoskeleton_p",1)
	got_money(100000)
	timer("run", 1.0, "arhara_dialog.delete_shalyi_naim()")
end

-- Удаляем Шалого и его охранников, если разошлись миром 
function delete_shalyi_naim()
if has_info("shalyi_razoslis_mirom") then
find_and_release("shalyi_killer")
find_and_release("shalyi_naim_ohrannik")
 end
end

--' Удаляем Пантеру и телохранителей
function delete_pant_warl()
	release("pantera")
	release("bodi_pantera1")
	release("bodi_pantera2")
end

--' босс забрал печатку и спавн новой и спавн наёмников босса
function zabral_gad_pechatku(first_speaker, second_speaker)
	lost("amul_naemn",1)
	got("pseudopechatka")
end

--' телохран Пантеры дал арт на прощание и свой ствол
function body_dal_art(first_speaker, second_speaker)
	got("af_kol_3")
	got("wpn_sg550_sr")
end

--' получим Булыжники от Голограмы
function gologr_tehnik_done(first_speaker, second_speaker)
	got("af_buliz",2) 
end

--' тайник Циклопа после Военной Лаборатории
function new_inventory22()
	local obj = create("m_inventory_box22",xyz(-39.015,10.378,31.830),148276,295)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

function kanal_sms()
	sms("%c[sender]"..translate("name_arhara")..":\\n%c[sms_red]"..translate("sms_arhara_kanal_sms_0"), 5, "arhara", 30000, nil, [[sms\arhara\kanal_sms]])
	sms("%c[sender]"..translate("name_sherstyuk")..":\\n%c[255,255,255,255]"..translate("sms_sherstuk_conserva"), 28, "sherstuk", 10000)
end

function kanal_sms1()
	sms("%c[sender]"..translate("name_petya_glyuk")..":\\n%c[sms_red]"..translate("sms_gluk_kanal_sms1_0"), nil, nil, 30000, nil, [[sms\gluk\kanal_sms1]])
end

--' Удаляем Пантеру-нейтралку телохранителей Голограму и босса
function del_pant_neytral_warl()
	release("pantera_new")
	release("body1_pantera_new")
	release("body2_pantera_new")
	release("warlab_boss")
end

--' Удаляем старого Голограму с НЗ
function del_gol_old()
	release("land_lazaret_stalker2")
end

--' Удаляем нового Голограму с НЗ
function del_tehnik_gol()
	release("tehnik_golograma")
end

--' проверим наличие булыжников и Сердца полтерг
function klenov_vse_ok_have()
	return has("af_buliz",10) and has("af_part_monolit",1)
end

--' отдадим их Клёнову
function klenov_vse_ok_done(first_speaker, second_speaker)
	lost("af_part_monolit",1)
	lost("af_buliz",10)
end

function pant_zveri_sms()
    sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pant_zveri_sms_0"), nil, "pantera", 13000, nil, [[sms\pantera\pant_zveri_sms]])
end

--' убираем Витамина со складов
function delete_vitaminsklad()
    release("military_vitamin")
end

--' Удаляем Клыка и Пилигрима с НЗ рестриктором
function delete_stalky_nz()
    release("stalk_kluk")
    release("piligrim_2")
end

--' получим золото и ключ от телепорта у Витамина
function vitamin_reyd_zadan_done(first_speaker, second_speaker)
	got("bullion_gild")
	got("kluch_dell_teleport_warlab")
	got("wpn_svdk")
	got("ammo_93x64_sp")
	second_speaker:set_relation(game_object.friend, first_speaker)
	sms("%c[sender]"..translate("name_tsiklop")..":\\n%c[sms_red]"..translate("sms_ziklop_vitamin_reyd_zadan_done_0"), nil, "ziklop", 40000, nil, [[sms\ziklop\vitamin_reyd_zadan_done]])
	timer("run", 20, "arhara_dialog.vitamin_reyd_zadan_done2()")
end
function vitamin_reyd_zadan_done2()
	sms("%c[sender]"..translate("name_informatsiya").."\\n%c[sms_red]"..translate("sms_net_vitamin_reyd_zadan_done2_0"), nil, nil, 6000, nil, [[sms\net\vitamin_reyd_zadan_done2]]) 
end

--' убираем свободовцев с Радара
function delete_svoboda_radars()
	release("radar_vitamin")
	release("radar_svoboda_reyd1")
	release("radar_svoboda_reyd2")
	release("radar_svoboda_reyd3")
	release("radar_svoboda_reyd4")
	release("radar_svoboda_reyd5")
	release("radar_svoboda_reyd6")
	release("radar_svoboda_reyd7")
	release("radar_svoboda_reyd8")
	release("radar_svoboda_reyd9")
	release("radar_svoboda_reyd10")
end

--' проверим наличие фальшивой карты Клыка
function zv_kopiy()
	return has("kluk_karta_kopiy",1)
end

--' отдадим фальшифку Звездочёту
function falshivka_otdat(first_speaker, second_speaker)
	lost("kluk_karta_kopiy",1)
end

--' тайник с телефоном для Пантеры рандомно в 10ти местах
function new_inventory23()
local b = {
	{position={x=7.256,y=-6.525,z=-12.801},gv=3202,lv=5624},
	{position={x=4.37,y=2.17,z=-6.43},gv=3210,lv=5209},
        {position={x=16.50,y=3.180,z=-7.71},gv=3216,lv=7049}, 
	{position={x=2.64,y=-3.125,z=-11.46},gv=3187,lv=4857},
	{position={x=-19.145,y=-7.655,z=-16.37},gv=3167,lv=957},
	{position={x=-23.40,y=-12.12,z=-50.775},gv=3161,lv=562},
	{position={x=1.15,y=-11.30,z=13.682},gv=3189,lv=5419},
	{position={x=1.38,y=2.834,z=4.64},gv=3187,lv=4548},
	{position={x=-8.85,y=5.44,z=20.49},gv=3173,lv=2579},
	{position={x=-14.82,y=-1.42,z=-34.38},gv=3164,lv=1512}
}
	local a = table.random(b)
	local se_obj = create("m_inventory_box23", xyz(a.position.x,a.position.y,a.position.z), a.lv, a.gv)
	map_spot(se_obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' получим танто и именной АК-74 от Клыка
function tanto_dal(first_speaker, second_speaker)
	got("wpn_knif2")
	got("wpn_ak74_m3")
	got("ammo_5.45x39_izomorf")
end

--' проверим наличие финансов для кидалы
function bablo_razvod(actor,npc)
    return actor:money() > 70000
end

--' отдадим деньги кидале
function kidalovo(t1,t2)
lost_money(70000)
end

--' Сидор дал преобразователь артов и дробовик
function apteka_otdal(first_speaker, second_speaker)
	got("det_artefact_indy")
	got("wpn_usas12")
	got("ammo_12x70_kart")
	got("medkit",2)
end

--' убираем кидалу
function delete_kidalo()
	release("esc_kidalo")
end

--' Рестрикторные СМС
function muha_isterika1()
	say([[sms\muha\muha_isterika1]])
--	timer("run", 7.0, "arhara_dialog.muha_isterika2()")
end
function muha_isterika2()
	say([[sms\muha\muha_isterika2]])
	timer("run", 7.0, "arhara_dialog.muha_isterika7()")
--	timer("run", 8.0, "arhara_dialog.muha_isterika3()")
end
function muha_isterika3()
	say([[sms\muha\muha_isterika3]])
--	timer("run", 4.0, "arhara_dialog.muha_isterika4()")
end
function muha_isterika4()
	say([[sms\muha\muha_isterika4]])
--	timer("run", 4.0, "arhara_dialog.muha_isterika5()")
end
function muha_isterika5()
	say([[sms\muha\muha_isterika5]])
--	timer("run", 5.0, "arhara_dialog.muha_isterika6()")
end
function muha_isterika6()
	say([[sms\muha\muha_isterika6]])
--	timer("run", 6.0, "arhara_dialog.muha_isterika7()")
end
function muha_isterika7()
give_info("muha_isterika_finish")
end

function band_yantar_sms()
    sms("%c[sender]"..translate("name_likvidator")..":\\n%c[sms_red]"..translate("sms_likvidator_band_yantar_sms_0"), nil, nil, 25000, nil, [[sms\likvidator\band_yantar_sms]])
end
function razvod_sms()
-- не озвучивать
    sms("%c[sender]"..translate("name_sidorovich")..":\\n%c[sms_red]"..translate("razvod_sms_0_0"), nil, "sidor", 15000)
	timer("run", 15.0, "arhara_dialog.razvod_sms_strelok()")
end
function razvod_sms_strelok()
    sms("%c[sender]"..translate("name_mechenii")..":\\n%c[sms_red]"..translate("razvod_sms_1_0"), nil, "meceniy", 20000, nil, [[sms\strelok\razvod_sms_strelok]])
end
function gar_naemn_grup1_sms()
	sms("%c[sender]"..translate("name_miha")..":\\n%c[sms_red]"..translate("sms_random_gar_naemn_grup1_sms_0"), nil, nil, 8000, nil, [[sms\mixa\gar_naemn_grup1_sms]])
end
function dark_btr1_sms()
    sms("%c[sender]"..translate("name_vitalii_zver")..":\\n%c[sms_red]"..translate("sms_zver_dark_btr1_sms_0"), nil, nil, 20000, nil, [[sms\zver\dark_btr1_sms]])
	braad_test.darkvalley_darkscape()
end
function dark_sidor_sms()
    sms("%c[sender]"..translate("name_mechenii")..":\\n%c[sms_red]"..translate("sms_strelok_dark_sidor_sms_0"), nil, "meceniy", 20000, nil, [[sms\strelok\dark_sidor_sms]])
end
function garbage_adren_sms()
    sms("%c[sender]"..translate("name_adrenalin")..":\\n%c[sms_red]"..translate("sms_adrenalin_garbage_adren_sms_0"), nil, "adrenalin", 25000, nil, [[sms\adrenalin\garbage_adren_sms]])
end
function lysyi_sms()
    sms("%c[sender]"..translate("name_lisii")..":\\n%c[sms_red]"..translate("sms_lisiy_lysyi_sms_0"), nil, "lisiy", 25000, nil, [[sms\lisiy\lysyi_sms]])
end
function art_negoden_sms()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_art_negoden_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\art_negoden_sms]])
end
function art_negoden_sms1()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_art_negoden_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\art_negoden_sms1]])
end
function pant_kord_sms1()
    sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pant_kord_sms1_0"), nil, "pantera", 20000, nil, [[sms\pantera\pant_kord_sms1]])
end
function dolbannn_sms()
    sms("%c[sender]"..translate("name_serzhant_kostilnoga")..":\\n%c[sms_red]"..translate("sms_kostylnuga_dolbannn_sms_0"), nil, nil, 20000, nil, [[sms\kostylnuga\dolbannn_sms]])
end
function sidor_piyn_sms()
    sms("%c[sender]"..translate("name_sidorovich")..":\\n%c[sms_red]"..translate("sms_sidor_sidor_piyn_sms_0"), nil, "sidor", 20000, nil, [[sms\sidor\sidor_piyn_sms]])
	timer("run", 20.0, "arhara_dialog.otkryvaem_door_sidora()")
  end

function otkryvaem_door_sidora()
		if has_info("arhara_shaxter_start") then
	give_info("open_door_sidor")
  end
end

function sidor_piyn_sms1()
    sms("%c[sender]"..translate("name_sidorovich")..":\\n%c[sms_red]"..translate("sms_sidor_sidor_piyn_sms_1"), nil, "sidor", 16000, nil, [[sms\sidor\sidor_piyn_sms1]])
  end
function kluk_sms3()
    sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_sms3_0"), nil, "klyk", 60000, nil, [[sms\kluk\kluk_sms3]])
end
function gg_sms1()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_gg_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\gg_sms1]])
end
function kluk_sms2()
    sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_sms2_0"), nil, "klyk", 60000, nil, [[sms\kluk\kluk_sms2]])
end
function yan_sms_barmen()
	sms("%c[sender]"..translate("name_mechenii")..":\\n%c[sms_red]"..translate("sms_strelok_yan_sms_barmen_0"), nil, "meceniy", 20000, nil, [[sms\strelok\yan_sms_barmen]])
	release(story_object(503))
	give_info("bar_rescue_research_reward")
	give_info("bar_ecolog_crush_shut")
end
function yan_barmen_otvet()
    sms("%c[sender]"..translate("name_barmen")..":\\n%c[sms_red]"..translate("sms_barman_yan_barmen_otvet_0"), nil, "barman", 16000, nil, [[sms\barman\yan_barmen_otvet]])
end
function plen_sms()
    sms("%c[sender]"..translate("name_leitenant_vetroplyuev")..":\\n%c[sms_red]"..translate("sms_net_plen_sms_0"), nil, nil, 20000, nil, [[sms\net\plen_sms]])
end
function village_sms_kapitan()
    sms("%c[sender]"..translate("name_kolmogor")..":\\n%c[sms_red]"..translate("sms_kolmogor_village_sms_kapitan_0"), nil, "kolmogor", 30000, nil, [[sms\kolmogor\village_sms_kapitan]])
end
function village_sms_pantera()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_village_sms_pantera_0"), nil, "strelok", 30000, nil, [[sms\strelok\village_sms_pantera]])
end
function village_sms_obsledovanie()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_village_sms_obsledovanie_0"), nil, "strelok", 30000, nil, [[sms\strelok\village_sms_obsledovanie]])
end
function village_pantera_otvet()
    sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_village_pantera_otvet_0"), nil, "pantera", 30000, nil, [[sms\pantera\village_pantera_otvet]])
end
function kolm_stroy_sms()
    sms("%c[sender]"..translate("name_kolmogor")..":\\n%c[sms_red]"..translate("sms_kolmogor_kolm_stroy_sms_0"), nil, "kolmogor", 30000, nil, [[sms\kolmogor\kolm_stroy_sms]])
end
function sms_pobeda()
    sms("%c[sender]"..translate("name_kolmogor")..":\\n%c[sms_red]"..translate("sms_kolmogor_sms_pobeda_0"), nil, "kolmogor", 25000, nil, [[sms\kolmogor\sms_pobeda]])
end
function strelok_kluk_vopros1()
    sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_strelok_kluk_vopros1_0"), 5, "strelok", 30000, nil, [[sms\strelok\strelok_kluk_vopros1]])
    disable_info("no_teleport_near_heli_btr")
end
function kluk_perexod_derevny()
    sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_perexod_derevny_0"), nil, "klyk", 30000, nil, [[sms\kluk\kluk_perexod_derevny]])
end
function kluk_sms_pili_lovushka()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_sms_pili_lovushka_0"), nil, "klyk", 40000, nil, [[sms\kluk\kluk_sms_pili_lovushka]])
end
function vill_klenov_sms()
	sms("%c[sender]"..translate("name_klyonov")..":\\n%c[sms_red]"..translate("sms_klenov_vill_klenov_sms_0"), nil, "klenov", 30000, nil, [[sms\klenov\vill_klenov_sms]])
end
function warl_kolmogor_sms()
	sms("%c[sender]"..translate("name_kolmogor")..":\\n%c[sms_red]"..translate("sms_kolmogor_warl_kolmogor_sms_0"), nil, "kolmogor", 30000, nil, [[sms\kolmogor\warl_kolmogor_sms]])
timer("run", 15.5, "arhara_dialog.warl_gg_pili_sms()")
end
function warl_gg_pili_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_warl_gg_pili_sms_0"), nil, "strelok", 10000, nil, [[sms\strelok\warl_gg_pili_sms]])
timer("run", 7.5, "arhara_dialog.warl_pili_gg_otvet_sms()")
end
function warl_pili_gg_otvet_sms()
	sms("%c[sender]"..translate("name_piligrim")..":\\n%c[sms_red]"..translate("sms_piligrim_warl_pili_gg_otvet_sms_0"), nil, "piligrim", 30000, nil, [[sms\piligrim\warl_pili_gg_otvet_sms]])
end
function agro_torgash_sms()
	sms("%c[sender]"..translate("name_sedoi")..":\\n%c[sms_red]"..translate("sms_sedoy_agro_torgash_sms_0"), nil, "sedoy", 25000, nil, [[sms\sedoy\agro_torgash_sms]])
end
function gg_black_doc_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_gg_black_doc_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\gg_black_doc_sms1]])
end
function otsroch_sms()
	sms("%c[sender]"..translate("name_otsrochennoe_sms")..":\\n%c[sms_red]"..translate("sms_pantera_otsroch_sms_0"), nil, "pantera", 30000, nil, [[sms\pantera\otsroch_sms]])
end
function gg_black_doc_sms2()
	sms("%c[sender]"..translate("name_telohranitel_chyornogo_doktora")..":\\n%c[sms_red]"..translate("sms_chel_black_doktora_gg_black_doc_sms2_0"), nil, "sapsan", 20000, nil, [[sms\chel_black_doktora\gg_black_doc_sms2]])
end
function gg_black_doc_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_gg_black_doc_sms3_0"), nil, "strelok", 20000, nil, [[sms\strelok\gg_black_doc_sms3]])
end
function gg_black_doc_sms4()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_gg_black_doc_sms4_0"), nil, "klyk", 20000, nil, [[sms\kluk\gg_black_doc_sms4]])
end
function gg_black_doc_sms5()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_gg_black_doc_sms5_0"), nil, "prizrak", 25000, nil, [[sms\prizrak\gg_black_doc_sms5]])
end
function gg_black_doc_sms6()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_gg_black_doc_sms6_0"), nil, "strelok", 25000, nil, [[sms\strelok\gg_black_doc_sms6]])
end
function sms_ubit_glavar()
	sms("%c[sender]"..translate("name_kolmogor")..":\\n%c[sms_red]"..translate("sms_kolmogor_sms_ubit_glavar_0"), nil, "kolmogor", 35000, nil, [[sms\kolmogor\sms_ubit_glavar]])
end
function pili_zayti_after_antenna_sms()
	sms("%c[sender]"..translate("name_piligrim")..":\\n%c[sms_red]"..translate("sms_piligrim_pili_zayti_after_antenna_sms_0"), 3, "piligrim", 35000, nil, [[sms\piligrim\pili_zayti_after_antenna_sms]])
end
function actor_trup_sms()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_actor_trup_sms_0"), nil, "prizrak", 5000, nil, [[sms\prizrak\actor_trup_sms]])
end
function sms_uchenuy_pobeg()
	sms("%c[sender]"..translate("name_zemlyak")..":\\n%c[sms_red]"..translate("sms_zemlyak_sms_uchenuy_pobeg_0"), nil, "zemlyak", 20000, nil, [[sms\zemlyak\sms_uchenuy_pobeg]])
end
function pipets_vert_zadanie_sms()
	sms("%c[sender]"..translate("name_zemlyak")..":\\n%c[sms_red]"..translate("sms_zemlyak_pipets_vert_zadanie_sms_0"), nil, "zemlyak", 15000, nil, [[sms\zemlyak\pipets_vert_zadanie_sms]])
end
function hit_heli_hit_sms1()
	sms("%c[sender]"..translate("name_obrivok_dialoga_pilotov")..":\\n%c[sms_red]"..translate("sms_pilot_verta_hit_heli_hit_sms1_0"), nil, nil, 25000, nil, [[sms\pilot_verta\hit_heli_hit_sms1]])
end
function hit_heli_hit_sms2()
	sms("%c[sender]"..translate("name_obrivok_dialoga_pilotov")..":\\n%c[sms_red]"..translate("sms_pilot_verta_hit_heli_hit_sms2_0"), nil, nil, 25000, nil, [[sms\pilot_verta\hit_heli_hit_sms2]])
end
function hit_heli_hit_sms3()
	sms("%c[sender]"..translate("name_obrivok_dialoga_pilotov")..":\\n%c[sms_red]"..translate("sms_pilot_verta_hit_heli_hit_sms3_0"), nil, nil, 30000, nil, [[sms\pilot_verta\hit_heli_hit_sms3]])
end
function hit_heli_hit_sms4()
	sms("%c[sender]"..translate("name_obrivok_dialoga_pilotov")..":\\n%c[sms_red]"..translate("sms_pilot_verta_hit_heli_hit_sms4_0"), nil, nil, 25000, nil, [[sms\pilot_verta\hit_heli_hit_sms4]])
end
function hit_heli_hit_sms5()
	sms("%c[sender]"..translate("name_obrivok_dialoga_pilotov")..":\\n%c[sms_red]"..translate("sms_pilot_verta_hit_heli_hit_sms5_0"), nil, nil, 25000, nil, [[sms\pilot_verta\hit_heli_hit_sms5]])
end
function sms_frits1()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_frits1_0"), nil, "fric", 25000, nil, [[sms\fric\sms_frits1]])
end
function sms_frits2()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_frits2_0"), nil, "fric", 25000, nil, [[sms\fric\sms_frits2]])
end
function sms_frits3()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_frits3_0"), nil, "fric", 25000, nil, [[sms\fric\sms_frits3]])
end
function sms_frits4()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_frits4_0"), nil, "fric", 25000, nil, [[sms\fric\sms_frits4]])
end
function sms_frits5()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_frits5_0"), nil, "fric", 25000, nil, [[sms\fric\sms_frits5]])
end
function sms_doc_letit()
	sms("%c[sender]"..translate("name_zemlyak")..":\\n%c[sms_red]"..translate("sms_zemlyak_sms_doc_letit_0"), nil, "zemlyak", 15000, nil, [[sms\zemlyak\sms_doc_letit]])
end
function dok_ot_andersena_letit()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_dok_ot_andersena_letit_0"), nil, "o_soznanie", 25000, nil, [[sms\doctor_black\dok_ot_andersena_letit]])
end
function sekretnuy_vuhod_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sekretnuy_vuhod_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\sekretnuy_vuhod_sms]])
end
function sekretnuy_vuhod_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sekretnuy_vuhod_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\sekretnuy_vuhod_sms1]])
end
function boloto_sms_k_doku()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_boloto_sms_k_doku_0"), nil, "strelok", 25000, nil, [[sms\strelok\boloto_sms_k_doku]])
end
function sms_ot_doka_o_verte()
	sms("%c[sender]"..translate("name_chelovek_chyornogo_doktora")..":\\n%c[sms_red]"..translate("sms_chel_black_doktora_sms_ot_doka_o_verte_0"), nil, "sapsan", 30000, nil, [[sms\chel_black_doktora\sms_ot_doka_o_verte]])
end
function sms_boloto_k_prizraku()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_boloto_k_prizraku_0"), nil, "strelok", 30000, nil, [[sms\strelok\sms_boloto_k_prizraku]])
end
function sms_boloto_ot_prizraka()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_sms_boloto_ot_prizraka_0"), nil, "prizrak", 30000, nil, [[sms\prizrak\sms_boloto_ot_prizraka]])
end
function sms_70m_vert()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_sms_70m_vert_0"), nil, nil, 30000, nil, [[sms\pilot_verta\sms_70m_vert]])
	timer("run", 1.0, "new_spawn.bocman_vodyaru_delete()")
end
function letchik_sms1()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_letchik_sms1_0"), nil, nil, 30000, nil, [[sms\pilot_verta\letchik_sms1]])
end
function rugan_gg_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_rugan_gg_sms_0"), nil, "strelok", 30000, nil, [[sms\strelok\rugan_gg_sms]])
end
function letchik_sms2()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_letchik_sms2_0"), nil, nil, 25000, nil, [[sms\pilot_verta\letchik_sms2]])
end
function udav_v_vert_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_udav_v_vert_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\udav_v_vert_sms]])
end
function sms_udav_sel()
	sms("%c[sender]"..translate("name_botsman")..":\\n%c[sms_red]"..translate("sms_bocman_sms_udav_sel_0"), nil, "bocman", 14000, nil, [[sms\bocman\sms_udav_sel]])
end
function marsh_udav_pogib()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_marsh_udav_pogib_0"), nil, "strelok", 25000, nil, [[sms\strelok\marsh_udav_pogib]])
end
function udav_antenna_sms1()
	sms("%c[sender]"..translate("name_botsman")..":\\n%c[sms_red]"..translate("sms_bocman_udav_antenna_sms1_0"), nil, "bocman", 8000, nil, [[sms\bocman\udav_antenna_sms1]])
end
function udav_antenna_sms2()
	sms("%c[sender]"..translate("name_botsman")..":\\n%c[sms_red]"..translate("sms_bocman_udav_antenna_sms2_0"), nil, "bocman", 19000, nil, [[sms\bocman\udav_antenna_sms2]])
end
function udav_antenna_sms3()
	sms("%c[sender]"..translate("name_botsman")..":\\n%c[sms_red]"..translate("sms_bocman_udav_antenna_sms3_0"), nil, "bocman", 16000, nil, [[sms\bocman\udav_antenna_sms3]])
end
function udav_antenna_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_udav_antenna_sms4_0"), nil, "strelok", 30000, nil, [[sms\strelok\udav_antenna_sms4]])
end
function priz_bomz_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_priz_bomz_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\priz_bomz_sms]])
end
function fritz_shturm_mat()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_fritz_shturm_mat_0"), nil, "fric", 30000, nil, [[sms\fric\fritz_shturm_mat]])
end
function fritz_shturm_mat1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_fritz_shturm_mat1_0"), nil, "strelok", 20000, nil, [[sms\strelok\fritz_shturm_mat1]])
end
function black_heli_sms()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_black_heli_sms_0"), nil, nil, 30000, nil, [[sms\pilot_verta\black_heli_sms]])
end
function solvador_sms1()
	sms("%c[sender]"..translate("name_solvador")..":\\n%c[sms_red]"..translate("sms_solvador_solvador_sms1_0"), nil, "solvador", 25000, nil, [[sms\solvador\solvador_sms1]])
end
function ne_strelyt()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_ne_strelyt_0"), nil, "strelok", 20000, nil, [[sms\strelok\ne_strelyt]])
end
function mu_opozdaly()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_mu_opozdaly_0"), nil, "sapsan", 25000, nil, [[sms\sapsan\mu_opozdaly]])
end
function mu_opozdaly1()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_mu_opozdaly1_0"), nil, "o_soznanie", 25000, nil, [[sms\doctor_black\mu_opozdaly1]])
end
function mu_opozdaly2()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_mu_opozdaly2_0"), nil, "o_soznanie", 25000, nil, [[sms\doctor_black\mu_opozdaly2]])
end
function boy_sms1()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_boy_sms1_0"), nil, "fric", 10000, nil, [[sms\fric\boy_sms1]])
end
function boy_sms2()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_boy_sms2_0"), nil, "prizrak", 12000, nil, [[sms\prizrak\boy_sms2]])
end
function boy_sms2_1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_boy_sms2_1_0"), nil, "strelok", 7000, nil, [[sms\strelok\boy_sms2_1]])
end
function boy_sms3()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_boy_sms3_0"), nil, "fric", 10000, nil, [[sms\fric\boy_sms3]])
end
function plan_zahvata_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_plan_zahvata_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\plan_zahvata_sms1]])
end
function plan_zahvata_sms2()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_plan_zahvata_sms2_0"), nil, "prizrak", 25000, nil, [[sms\prizrak\plan_zahvata_sms2]])
end
function podgotovka_zahvata_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_podgotovka_zahvata_sms1_0"), nil, "strelok", 16000, nil, [[sms\strelok\podgotovka_zahvata_sms1]])
end
function podgotovka_zahvata_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_podgotovka_zahvata_sms2_0"), nil, "strelok", 19000, nil, [[sms\strelok\podgotovka_zahvata_sms2]])
end
function podgotovka_zahvata_sms3()
	sms("%c[sender]"..translate("name_chelovek_chyornogo_doktora")..":\\n%c[sms_red]"..translate("sms_chel_black_doktora_podgotovka_zahvata_sms3_0"), nil, "sapsan", 10000, nil, [[sms\chel_black_doktora\podgotovka_zahvata_sms3]])
end
function podgotovka_zahvata_sms4()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_podgotovka_zahvata_sms4_0"), nil, "fric", 11000, nil, [[sms\fric\podgotovka_zahvata_sms4]])
end
function podgotovka_zahvata_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_podgotovka_zahvata_sms5_0"), nil, "strelok", 24000, nil, [[sms\strelok\podgotovka_zahvata_sms5]])
end
function podgotovka_zahvata_sms6()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_podgotovka_zahvata_sms6_0"), nil, "fric", 11000, nil, [[sms\fric\podgotovka_zahvata_sms6]])
end
function mat_sms1()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_mat_sms1_0"), nil, nil, 15000, nil, [[sms\pilot_verta\mat_sms1]])
end
function sms_ponyl()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_ponyl_0"), nil, "fric", 15000, nil, [[sms\fric\sms_ponyl]])
end
function sms_spasibo_frits1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_spasibo_frits1_0"), nil, "strelok", 20000, nil, [[sms\strelok\sms_spasibo_frits1]])
end
function sms_spasibo_frits2()
	sms("%c[sender]"..translate("name_frits")..":\\n%c[sms_red]"..translate("sms_fric_sms_spasibo_frits2_0"), nil, "fric", 20000, nil, [[sms\fric\sms_spasibo_frits2]])
end
function sapsan_ulet_sms()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_sapsan_ulet_sms_0"), nil, "sapsan", 20000, nil, [[sms\sapsan\sapsan_ulet_sms]])
end
function dok_podvox_sms1()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_dok_podvox_sms1_0"), nil, "o_soznanie", 30000, nil, [[sms\doctor_black\dok_podvox_sms1]])
end
function dok_podvox_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dok_podvox_sms2_0"), nil, "strelok", 25000, nil, [[sms\strelok\dok_podvox_sms2]])
end
function dok_podvox_sms3()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_dok_podvox_sms3_0"), nil, "o_soznanie", 25000, nil, [[sms\doctor_black\dok_podvox_sms3]])
end
function dok_podvox_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dok_podvox_sms4_0"), nil, "strelok", 25000, nil, [[sms\strelok\dok_podvox_sms4]])
end
function dok_podvox_sms5()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_dok_podvox_sms5_0"), nil, "o_soznanie", 30000, nil, [[sms\doctor_black\dok_podvox_sms5]])
end
function dok_podvox_sms6()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dok_podvox_sms6_0"), nil, "strelok", 30000, nil, [[sms\strelok\dok_podvox_sms6]])
end
function dok_trupak_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dok_trupak_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\dok_trupak_sms]])
end
function idu_na_nz_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_idu_na_nz_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\idu_na_nz_sms1]])
end
function idu_na_nz_sms2()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_idu_na_nz_sms2_0"), nil, "prizrak", 30000, nil, [[sms\prizrak\idu_na_nz_sms2]])
end
function idu_na_nz_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_idu_na_nz_sms3_0"), nil, "strelok", 25000, nil, [[sms\strelok\idu_na_nz_sms3]])
end
function idu_na_nz_sms4()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_idu_na_nz_sms4_0"), nil, "klyk", 25000, nil, [[sms\kluk\idu_na_nz_sms4]])
end
function peshera_naydena_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_peshera_naydena_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\peshera_naydena_sms1]])
end
function peshera_naydena_sms2()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_peshera_naydena_sms2_0"), nil, "klyk", 20000, nil, [[sms\kluk\peshera_naydena_sms2]])
end
function kluk_na_meste_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kluk_na_meste_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\kluk_na_meste_sms1]])
end
function kluk_shuher_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_shuher_sms1_0"), nil, "klyk", 13000, nil, [[sms\kluk\kluk_shuher_sms1]])
end
function kluk_shuher_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kluk_shuher_sms2_0"), nil, "strelok", 10000, nil, [[sms\strelok\kluk_shuher_sms2]])
end
function kluk_shuher_sms3()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_shuher_sms3_0"), nil, "klyk", 11000, nil, [[sms\kluk\kluk_shuher_sms3]])
end
function na_predesant_sms()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_na_predesant_sms_0"), nil, "klyk", 20000, nil, [[sms\kluk\na_predesant_sms]])
end
function posadka_pant_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_posadka_pant_sms1_0"), nil, "klyk", 20000, nil, [[sms\kluk\posadka_pant_sms1]])
end
function posadka_pant_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_posadka_pant_sms2_0"), nil, "strelok", 17000, nil, [[sms\strelok\posadka_pant_sms2]])
end
function posadka_pant_sms3()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_posadka_pant_sms3_0"), nil, "klyk", 17000, nil, [[sms\kluk\posadka_pant_sms3]])
end
function pant_proschay_sms1()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pant_proschay_sms1_0"), nil, "pantera", 30000, nil, [[sms\pantera\pant_proschay_sms1]])
end
function pant_proschay_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pant_proschay_sms2_0"), nil, "strelok", 25000, nil, [[sms\strelok\pant_proschay_sms2]])
end
function pant_proschay_sms3()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pant_proschay_sms3_0"), nil, "pantera", 30000, nil, [[sms\pantera\pant_proschay_sms3]])
end
function pant_proschay_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pant_proschay_sms4_0"), nil, "strelok", 25000, nil, [[sms\strelok\pant_proschay_sms4]])
end
function muha_bazar_sms()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_muha_bazar_sms_0"), nil, "klyk", 15000, nil, [[sms\kluk\muha_bazar_sms]])
end
function muha_bazar_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_muha_bazar_sms1_0"), nil, "strelok", 10000, nil, [[sms\strelok\muha_bazar_sms1]])
end
function voronin_voen_sms1()
	sms("%c[sender]"..translate("name_general_voronin")..":\\n%c[sms_red]"..translate("sms_voronin_voronin_voen_sms1_0"), nil, "general_voronin", 25000, nil, [[sms\voronin\voronin_voen_sms1]])
end
function voronin_voen_sms2()
	sms("%c[sender]"..translate("name_general_voronin")..":\\n%c[sms_red]"..translate("sms_voronin_voronin_voen_sms2_0"), nil, "general_voronin", 30000, nil, [[sms\voronin\voronin_voen_sms2]])
end
function voronin_voen_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_voronin_voen_sms3_0"), nil, "strelok", 20000, nil, [[sms\strelok\voronin_voen_sms3]])
end
function voronin_voen_sms4()
	sms("%c[sender]"..translate("name_general_voronin")..":\\n%c[sms_red]"..translate("sms_voronin_voronin_voen_sms4_0"), nil, "general_voronin", 25000, nil, [[sms\voronin\voronin_voen_sms4]])
end
function voronin_voen_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_voronin_voen_sms5_0"), nil, "strelok", 25000, nil, [[sms\strelok\voronin_voen_sms5]])
end
function voronin_voen_sms6()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_voronin_voen_sms6_0"), nil, "klyk", 25000, nil, [[sms\kluk\voronin_voen_sms6]])
end
function chaes2_kluk_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_chaes2_kluk_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\chaes2_kluk_sms1]])
end
function chaes2_kluk_sms2()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_chaes2_kluk_sms2_0"), nil, "klyk", 25000, nil, [[sms\kluk\chaes2_kluk_sms2]])
end
function chaes2_kluk_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_chaes2_kluk_sms3_0"), nil, "strelok", 20000, nil, [[sms\strelok\chaes2_kluk_sms3]])
end
function iz_moskvy_sms1()
	sms("%c[sender]"..translate("name_sms_iz_moskvi")..":\\n%c[sms_red]"..translate("iz_moskvy_sms1_0_0"), nil, nil, 8000, nil, [[sms\moskva\iz_moskvy_sms1]])
end
function iz_moskvy_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_iz_moskvy_sms2_0"), nil, "strelok", 7000, nil, [[sms\strelok\iz_moskvy_sms2]])
end
function iz_moskvy_sms3()
	sms("%c[sender]"..translate("name_sms_iz_moskvi")..":\\n%c[sms_red]"..translate("iz_moskvy_sms3_0_0"), nil, nil, 8000, nil, [[sms\moskva\iz_moskvy_sms3]])
end
function iz_moskvy_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_iz_moskvy_sms4_0"), nil, "strelok", 14000, nil, [[sms\strelok\iz_moskvy_sms4]])
end
function iz_moskvy_sms5()
	sms("%c[sender]"..translate("name_sms_iz_moskvi")..":\\n%c[sms_red]"..translate("iz_moskvy_sms5_0_0"), nil, nil, 7000, nil, [[sms\moskva\iz_moskvy_sms5]])
end
function dosvidanie_devchonka()
	sms("%c[sender]"..translate("name_muha")..":\\n%c[sms_red]"..translate("sms_muha_dosvidanie_devchonka_0"), nil, "muha", 20000, nil, [[sms\muha\dosvidanie_devchonka]])
end
function pilot_muhi_sms()
	sms("%c[sender]"..translate("name_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_pilot_muhi_sms_0"), nil, nil, 23000, nil, [[sms\pilot_verta\pilot_muhi_sms]])
end
function vzruv_aver_vert_sms1()
	sms("%c[sender]"..translate("name_pervii_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_vzruv_aver_vert_sms1_0"), nil, nil, 20000, nil, [[sms\pilot_verta\vzruv_aver_vert_sms1]])
end
function vzruv_aver_vert_sms2()
	sms("%c[sender]"..translate("name_vtoroi_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_vzruv_aver_vert_sms2_0"), nil, nil, 20000, nil, [[sms\pilot_verta\vzruv_aver_vert_sms2]])
end
function vzruv_aver_vert_sms3()
	sms("%c[sender]"..translate("name_pervii_pilot_vertolyota")..":\\n%c[sms_red]"..translate("sms_pilot_verta_vzruv_aver_vert_sms3_0"), nil, nil, 20000, nil, [[sms\pilot_verta\vzruv_aver_vert_sms3]])
end
function vzruv_aver_vert_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vzruv_aver_vert_sms4_0"), nil, "strelok", 20000, nil, [[sms\strelok\vzruv_aver_vert_sms4]])
end
function after_die_muha_sms1()
	sms("%c[sender]"..translate("name_sms_iz_moskvi")..":\\n%c[sms_red]"..translate("after_die_muha_sms1_0_0"), nil, nil, 4000, nil, [[sms\moskva\after_die_muha_sms1]])
end
function after_die_muha_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_die_muha_sms2_0"), nil, "strelok", 20000, nil, [[sms\strelok\after_die_muha_sms2]])
end
function after_die_muha_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_die_muha_sms3_0"), nil, "strelok", 25000, nil, [[sms\strelok\after_die_muha_sms3]])
end
function after_die_muha_sms4()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_after_die_muha_sms4_0"), nil, "o_soznanie", 25000, nil, [[sms\doctor_black\after_die_muha_sms4]])
end
function after_die_muha_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_die_muha_sms5_0"), nil, "strelok", 25000, nil, [[sms\strelok\after_die_muha_sms5]])
end
function after_die_muha_sms6()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("after_die_muha_sms6_0_0"), nil, "klyk", 25000, nil, [[sms\kluk\after_die_muha_sms6]])
end
function mono_netu_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mono_netu_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\mono_netu_sms1]])
end
function mono_netu_sms2()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_mono_netu_sms2_0"), nil, "klyk", 20000, nil, [[sms\kluk\mono_netu_sms2]])
end
function mono_netu_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mono_netu_sms3_0"), nil, "strelok", 10000, nil, [[sms\strelok\mono_netu_sms3]])
end
function mono_netu_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mono_netu_sms4_0"), nil, "strelok", 10000, nil, [[sms\strelok\mono_netu_sms4]])
end
function mono_netu_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mono_netu_sms5_0"), nil, "strelok", 10000, nil, [[sms\strelok\mono_netu_sms5]])
end
function mono_netu_sms6()
	sms("%c[sender]"..translate("name_operator_svyazi")..":\\n%c[sms_red]"..translate("mono_netu_sms6_0_0"), nil, "svyaz", 5000, nil, [[sms\net\mono_netu_sms6]])
end
function vitamin_posrednik_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vitamin_posrednik_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\vitamin_posrednik_sms1]])
end
function vitamin_posrednik_sms2()
	sms("%c[sender]"..translate("name_vitamin")..":\\n%c[sms_red]"..translate("sms_vitamin_vitamin_posrednik_sms2_0"), nil, "vitamin", 25000, nil, [[sms\vitamin\vitamin_posrednik_sms2]])
end
function vitamin_posrednik_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vitamin_posrednik_sms3_0"), nil, "strelok", 25000, nil, [[sms\strelok\vitamin_posrednik_sms3]])
end
function vitamin_posrednik_sms4()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_vitamin_posrednik_sms4_0"), nil, "sapsan", 25000, nil, [[sms\sapsan\vitamin_posrednik_sms4]])
end
function vitamin_posrednik_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vitamin_posrednik_sms5_0"), nil, "strelok", 10000, nil, [[sms\strelok\vitamin_posrednik_sms5]])
end
function sv_chern_peregovor_sms1()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_sv_chern_peregovor_sms1_0"), nil, "sapsan", 13000, nil, [[sms\sapsan\sv_chern_peregovor_sms1]])
end
function sv_chern_peregovor_sms2()
	sms("%c[sender]"..translate("name_svobodovets")..":\\n%c[sms_red]"..translate("sms_svoboda_sv_chern_peregovor_sms2_0"), nil, "freedom", 25000, nil, [[sms\svoboda\sv_chern_peregovor_sms2]])
end
function sv_chern_peregovor_sms3()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_sv_chern_peregovor_sms3_0"), nil, "sapsan", 25000, nil, [[sms\sapsan\sv_chern_peregovor_sms3]])
end
function sv_chern_peregovor_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sv_chern_peregovor_sms4_0"), nil, "strelok", 25000, nil, [[sms\strelok\sv_chern_peregovor_sms4]])
end
function sv_chern_peregovor_sms5()
	sms("%c[sender]"..translate("name_sapsan")..":\\n%c[sms_red]"..translate("sms_sapsan_sv_chern_peregovor_sms5_0"), nil, "sapsan", 25000, nil, [[sms\sapsan\sv_chern_peregovor_sms5]])
end
function sv_chern_peregovor_sms6()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sv_chern_peregovor_sms6_0"), nil, "strelok", 25000, nil, [[sms\strelok\sv_chern_peregovor_sms6]])
end
function u_shlagbauma_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_shlagbauma_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\u_shlagbauma_sms1]])
end
function u_shlagbauma_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_shlagbauma_sms2_0"), nil, "strelok", 20000, nil, [[sms\strelok\u_shlagbauma_sms2]])
end
function u_shlagbauma_sms3()
	sms("%c[sender]"..translate("name_solvador")..":\\n%c[sms_red]"..translate("solvador_u_shlagbauma_sms3_0"), nil, "solvador", 13000, nil, [[sms\solvador\u_shlagbauma_sms3]])
end
function u_tretego_generatora_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_tretego_generatora_sms1_0"), nil, "strelok", 15000, nil, [[sms\strelok\u_tretego_generatora_sms1]])
end
function u_tretego_generatora_sms2()
	sms("%c[sender]"..translate("name_solvador")..":\\n%c[sms_red]"..translate("sms_solvador_u_tretego_generatora_sms2_0"), nil, "solvador", 20000, nil, [[sms\solvador\u_tretego_generatora_sms2]])
end
function u_tretego_generatora_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_tretego_generatora_sms3_0"), nil, "strelok", 4000, nil, [[sms\strelok\u_tretego_generatora_sms3]])
end
function u_tretego_generatora_sms4()
	sms("%c[sender]"..translate("name_solvador")..":\\n%c[sms_red]"..translate("sms_solvador_u_tretego_generatora_sms4_0"), nil, "solvador", 8000, nil, [[sms\solvador\u_tretego_generatora_sms4]])
end
function u_tretego_generatora_sms41()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_tretego_generatora_sms41_0"), nil, "strelok", 8000, nil, [[sms\strelok\u_tretego_generatora_sms41]])
end
function u_tretego_generatora_sms5()
	sms("%c[sender]"..translate("name_solvador")..":\\n%c[sms_red]"..translate("sms_solvador_u_tretego_generatora_sms5_0"), nil, "solvador", 7000, nil, [[sms\solvador\u_tretego_generatora_sms5]])
end
function u_tretego_generatora_sms6()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_u_tretego_generatora_sms6_0"), nil, "strelok", 15000, nil, [[sms\strelok\u_tretego_generatora_sms6]])
end
function u_tretego_generatora_sms7()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_u_tretego_generatora_sms7_0"), nil, "klyk", 35000, nil, [[sms\kluk\u_tretego_generatora_sms7]])
end
function mesto_gg_na_chaes2_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mesto_gg_na_chaes2_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\mesto_gg_na_chaes2_sms]])
end
function kluk_pogib_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_pogib_sms1_0"), nil, "klyk", 35000, nil, [[sms\kluk\kluk_pogib_sms1]])
end
function kluk_pogib_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kluk_pogib_sms2_0"), nil, "strelok", 30000, nil, [[sms\strelok\kluk_pogib_sms2]])
end
function kluk_pogib_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kluk_pogib_sms3_0"), nil, "strelok", 30000, nil, [[sms\strelok\kluk_pogib_sms3]])
end
function kluk_pogib_sms4()
	sms("%c[sender]"..translate("name_zvezdochyot")..":\\n%c[sms_red]"..translate("sms_zvezdochet_kluk_pogib_sms4_0"), nil, "zvezdochet", 35000, nil, [[sms\zvezdochet\kluk_pogib_sms4]])
end
function kluk_pogib_sms5()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_kluk_pogib_sms5_0"), nil, "klyk", 35000, nil, [[sms\kluk\kluk_pogib_sms5]])
end
function after_kluk_pogib_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_kluk_pogib_sms1_0"), nil, "strelok", 12000, nil, [[sms\strelok\after_kluk_pogib_sms1]])
end
function after_kluk_pogib_sms2()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_after_kluk_pogib_sms2_0"), nil, "prizrak", 33000, nil, [[sms\prizrak\after_kluk_pogib_sms2]])
end
function after_kluk_pogib_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_kluk_pogib_sms3_0"), nil, "strelok", 15000, nil, [[sms\strelok\after_kluk_pogib_sms3]])
end
function after_kluk_pogib_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_kluk_pogib_sms4_0"), nil, "strelok", 20000, nil, [[sms\strelok\after_kluk_pogib_sms4]])
end
function after_kluk_pogib_sms5()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_after_kluk_pogib_sms5_0"), nil, "o_soznanie", 30000, nil, [[sms\doctor_black\after_kluk_pogib_sms5]])
	db.actor:add_article("saving_muha")
end
function nachalo_bazara_otsek_sms()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_nachalo_bazara_otsek_sms_0"), nil, "o_soznanie", 15000, nil, [[sms\doctor_black\nachalo_bazara_otsek_sms]])
end
function poshel_bazar_otsek_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_poshel_bazar_otsek_sms1_0"), nil, "strelok", 14000, nil, [[sms\strelok\poshel_bazar_otsek_sms1]])
end
function poshel_bazar_otsek_sms2()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_poshel_bazar_otsek_sms2_0"), nil, "pantera", 25000, nil, [[sms\pantera\poshel_bazar_otsek_sms2]])
end
function poshel_bazar_otsek_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_poshel_bazar_otsek_sms3_0"), nil, "strelok", 25000, nil, [[sms\strelok\poshel_bazar_otsek_sms3]])
end
function poshel_bazar_otsek_sms4()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_poshel_bazar_otsek_sms4_0"), nil, "pantera", 25000, nil, [[sms\pantera\poshel_bazar_otsek_sms4]])
end
function poshel_bazar_otsek_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_poshel_bazar_otsek_sms5_0"), nil, "strelok", 20000, nil, [[sms\strelok\poshel_bazar_otsek_sms5]])
end
function poshel_bazar_otsek_sms6()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_poshel_bazar_otsek_sms6_0"), nil, "doctor_black", 20000, nil, [[sms\doctor_black\poshel_bazar_otsek_sms6]])
end
function poshel_bazar_otsek_sms7()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_poshel_bazar_otsek_sms7_0"), nil, "pantera", 20000, nil, [[sms\pantera\poshel_bazar_otsek_sms7]])
end
function poshel_bazar_otsek_sms8()
	sms("%c[sender]"..translate("name_otets_panteri")..":\\n%c[sms_red]"..translate("sms_father_pantera_poshel_bazar_otsek_sms8_0"), nil, "father_pantera", 19000, nil, [[sms\father_pantera\poshel_bazar_otsek_sms8]])
end
function sidor_mina_sms()
	sms("%c[sender]"..translate("name_sidorovich")..":\\n%c[sms_red]"..translate("sms_sidor_sidor_mina_sms_0"), nil, "sidor", 20000, nil, [[sms\sidor\sidor_mina_sms]])
end
function sms_k_generalu()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_k_generalu_0"), nil, "strelok", 10000, nil, [[sms\strelok\sms_k_generalu]])
end
function sms_k_prizraku()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_k_prizraku_0"), nil, "strelok", 25000, nil, [[sms\strelok\sms_k_prizraku]])
end
function sms_k_prizraku1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_k_prizraku1_0_0"), nil, "strelok", 6000, nil, [[sms\strelok\sms_k_prizraku1]])
end
function sms_k_muhe()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_k_muhe_0"), nil, "strelok", 15000, nil, [[sms\strelok\sms_k_muhe]])
end
function atp_torgovetz_sms()
	sms("%c[sender]"..translate("name_sedoi")..":\\n%c[sms_red]"..translate("sms_sedoy_atp_torgovetz_sms_0"), nil, "sedoy", 41000, nil, [[sms\sedoy\atp_torgovetz_sms]])
	timer("run", 50.0, "arhara_dialog.atp_torgovetz_sms1()")
end
function atp_torgovetz_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_atp_torgovetz_sms_1"), nil, "strelok", 5000, nil, [[sms\strelok\atp_torgovetz_sms1]])
end
function sedoy_sms_poka()
		if has_info("atp_mobil_say_start") then
	sms("%c[sender]"..translate("name_sedoi")..":\\n%c[sms_red]"..translate("sms_sedoy_sedoy_sms_poka_0"), nil, "sedoy", 15000, nil, [[sms\sedoy\sedoy_sms_poka]])
          else
	sms("%c[sender]"..translate("name_sedoi")..":\\n%c[sms_red]"..translate("sms_sedoy_sedoy_sms_poka_1"), nil, "sedoy", 11000, nil, [[sms\sedoy\sedoy_sms_poka1]])
 end
end
function tu_sdurel_sms()
	sms("%c[sender]"..translate("name_sedoi")..":\\n%c[sms_red]"..translate("sms_sedoy_tu_sdurel_sms_0"), nil, "sedoy", 15000, nil, [[sms\sedoy\tu_sdurel_sms]])
end
function agro_muxa_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_agro_muxa_sms1_0"), 3, "strelok", 15000, nil, [[sms\strelok\agro_muxa_sms1]])
end
function agro_replika1()
	sms("%c[sender]"..translate("name_lukash")..":\\n%c[sms_red]"..translate("sms_lucash_agro_replika1_0"), nil, "lucash", 25000, nil, [[sms\lucash\agro_replika1]])
end

local final_sms = {
	{
		text = "%c[sender]"..translate("name_borov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms1_0"),
		icon="borov",
		snd = [[sms\borov\agro_boltobny_sms1]]
	}, {
		text = "%c[sender]"..translate("name_general_voronin")..":\\n%c[sms_red]"..translate("agro_boltobny_sms2_0"),
		icon="general_voronin",
		snd = [[sms\voronin\agro_boltobny_sms2]]
	}, {
		icon="leon",
		text = "%c[sender]"..translate("name_leon")..":\\n%c[sms_red]"..translate("agro_boltobny_sms3_0"),
		snd = [[sms\ara\agro_boltobny_sms3]]
	}, {
		text = "%c[sender]"..translate("name_lukash")..":\\n%c[sms_red]"..translate("agro_boltobny_sms4_0"),
		icon="lucash",
		snd = [[sms\lucash\agro_boltobny_sms4]]
	}, {
		text = "%c[sender]"..translate("name_kuznetsov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms5_0"),
		icon="kuznecov",
		snd = [[sms\kuznecov\agro_boltobny_sms5]]
	}, {
		text = "%c[sender]"..translate("name_ten_monolita")..":\\n%c[sms_red]"..translate("agro_boltobny_sms6_0"),
		icon="shadow_monolit",
		snd = [[sms\shadow_monolit\agro_boltobny_sms6]]
	}, {
		text = "%c[sender]"..translate("name_kuznetsov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms7_0"),
		icon="kuznecov",
		snd = [[sms\kuznecov\agro_boltobny_sms7]]
	}, {
		text = "%c[sender]"..translate("name_ten_monolita")..":\\n%c[sms_red]"..translate("agro_boltobny_sms8_0"),
		icon="shadow_monolit",
		snd = [[sms\shadow_monolit\agro_boltobny_sms8]]
	}, {
		text = "%c[sender]"..translate("name_saharov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms9_0"),
		icon="saharov",
		snd = [[sms\saharov\agro_boltobny_sms9]]
	}, {
		text = "%c[sender]"..translate("name_leon")..":\\n%c[sms_red]"..translate("agro_boltobny_sms10_0"),
		icon="leon",
		snd = [[sms\ara\agro_boltobny_sms10]]
	}, {
		text = "%c[sender]"..translate("name_barmen")..":\\n%c[sms_red]"..translate("agro_boltobny_sms11_0"),
		icon="barman",
		snd = [[sms\barman\agro_boltobny_sms11]]
	}, {
		text = "%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("agro_boltobny_sms12_0"),
		icon="strelok",
		snd = [[sms\strelok\agro_boltobny_sms12]]
	}, {
		text = "%c[sender]"..translate("name_leon")..":\\n%c[sms_red]"..translate("agro_boltobny_sms13_0"),
		icon="leon",
		snd = [[sms\ara\agro_boltobny_sms13]]
	}, {
		text = "%c[sender]"..translate("name_saharov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms14_0"),
		icon="saharov",
		snd = [[sms\saharov\agro_boltobny_sms14]]
	}, {
		text = "%c[sender]"..translate("name_lukash")..":\\n%c[sms_red]"..translate("agro_boltobny_sms15_0"),
		icon="lucash",
		snd = [[sms\lucash\agro_boltobny_sms15]]
	}, {
		text = "%c[sender]"..translate("name_muha")..":\\n%c[sms_red]"..translate("agro_boltobny_sms16_0"),
		icon="muha",
		snd = [[sms\muha\agro_boltobny_sms16]]
	}, {
		text = "%c[sender]"..translate("name_leon")..":\\n%c[sms_red]"..translate("agro_boltobny_sms17_0"),
		icon="leon",
		snd = [[sms\ara\agro_boltobny_sms17]]
	}, {
		text = "%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("agro_boltobny_sms18_0"),
		icon="strelok",
		snd = [[sms\strelok\agro_boltobny_sms18]]
	}, {
		text = "%c[sender]"..translate("name_leon")..":\\n%c[sms_red]"..translate("final_sms_0_0"),
		icon="leon",
		snd = [[sms\ara\agro_boltobny_sms19]]
	}, {
		text = "%c[sender]"..translate("name_saharov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms20_0"),
		icon="saharov",
		snd = [[sms\saharov\agro_boltobny_sms20]]
	}, {
		text = "%c[sender]"..translate("name_lukash")..":\\n%c[sms_red]"..translate("agro_boltobny_sms21_0"),
		icon="lucash",
		snd = [[sms\lucash\agro_boltobny_sms21]]
	}, {
		text = "%c[sender]"..translate("name_borov")..":\\n%c[sms_red]"..translate("agro_boltobny_sms22_0"),
		icon="borov",
		snd = [[sms\borov\agro_boltobny_sms22]]
	}, {
		text = "%c[sender]"..translate("name_akim")..":\\n%c[sms_red]"..translate("final_sms_1_0"),
		icon="akim",
		snd = [[sms\akim\agro_boltobny_sms23]],
		info = "komanda_na_posadku1",
		timeout = 20000
	}, {
		text = "%c[sender]"..translate("name_doktor")..":\\n%c[sms_red]"..translate("agro_boltobny_sms24_0"),
		icon="doctor",
		snd = [[sms\doctor\agro_boltobny_sms24]],
		info = "final_muzon",
		timeout = 20000
	}, {
		text = "%c[sender]"..translate("name_muha")..":\\n%c[sms_red]"..translate("agro_boltobny_sms25_0"),
		icon="muha",
		snd = [[sms\muha\agro_boltobny_sms25]],
		info = "agro_muxa_way2"
	}
}
function next_sms_skhodka( n )
	local t = final_sms[n]

	local snd = t.snd
	if snd then
		snd = sound_object(snd)
		snd:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
	end

	local timeout = math.max(
		t.timeout or 7000,
		snd and snd:length() or 0
	)

	local news_text = t.text
	local x,y = news_manager.get_sender_icon(nil, t.icon)
	db.actor:give_game_news(news_text, "ui\\ui_iconsTotal", Frect():set(x,y,83,47), 0, timeout)

	if t.info then
		give_info(t.info)
	end

	if next(final_sms, n) then
		timeout = timeout/1000 + math.random(10,20)/10
		timer("run", timeout, "arhara_dialog.next_sms_skhodka("..tostring(n+1)..")")
	else
		arhara_dialog.sp_imit_tele_final1()
	end
end

function agro_boltobny_sms1()
	next_sms_skhodka(1)
end


function arh_finish_sms1()
	sms("%c[sender]"..translate("name_arhara")..":\\n%c[sms_red]"..translate("sms_arhara_arh_finish_sms1_0"), nil, "arhara", 15000, nil, [[sms\arhara\arh_finish_sms1]])
end
function proschalnoe_sms1()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("proschalnoe_sms1_0_0"), nil, "prizrak", 5000, nil, [[sms\prizrak\proschalnoe_sms1]])
end
function proschalnoe_sms2()
	sms("%c[sender]"..translate("name_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_proschalnoe_sms2_0"), nil, "doctor", 15000, nil, [[sms\doctor\proschalnoe_sms2]])
end
function proschalnoe_sms3()
	sms("%c[sender]"..translate("name_piligrim")..":\\n%c[sms_red]"..translate("sms_piligrim_proschalnoe_sms3_0"), nil, "piligrim", 15000, nil, [[sms\piligrim\proschalnoe_sms3]])
end
function proschalnoe_sms4()
	sms("%c[sender]"..translate("name_arhara")..":\\n%c[sms_red]"..translate("sms_arhara_proschalnoe_sms4_0"), nil, "arhara", 15000, nil, [[sms\arhara\proschalnoe_sms4]])
end
function td_preduprezhdenie1_sms1()
	sms("%c[sender]"..translate("name_sistema_zaschiti")..":\\n%c[sms_red]"..translate("sms_zashita_td_preduprezhdenie1_sms1_0"), nil, "zashita", 30000, nil, [[sms\zashita\td_preduprezhdenie1_sms1]])
end
function td_preduprezhdenie2_sms2()
	sms("%c[sender]"..translate("name_sistema_zaschiti")..":\\n%c[sms_red]"..translate("sms_zashita_td_preduprezhdenie2_sms2_0"), nil, "zashita", 30000, nil, [[sms\zashita\td_preduprezhdenie2_sms2]])
end
function laba_skan_arts_sms1()
	sms("%c[sender]"..translate("name_sistema_zaschiti")..":\\n%c[sms_red]"..translate("sms_zashita_laba_skan_arts_sms1_0"), nil, "zashita", 20000, nil, [[sms\zashita\laba_skan_arts_sms1]])
end
function laba_skan_arts_sms2()
	sms("%c[sender]"..translate("name_sistema_zaschiti")..":\\n%c[sms_red]"..translate("sms_zashita_laba_skan_arts_sms2_0"), nil, "zashita", 20000, nil, [[sms\zashita\laba_skan_arts_sms2]])
end
function von_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_von_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\von_sms]])
end
function sark_art_negoden_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sark_art_negoden_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\sark_art_negoden_sms]])
end
function bomba_vzruv_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_bomba_vzruv_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\bomba_vzruv_sms]])
end
function spezdetektor_sms()
	sms("%c[sender]"..translate("name_poluchena_informatsiya")..":\\n%c[sms_red]"..translate("sms_net_spezdetektor_sms_0"), nil, "nano", 8000, nil, [[sms\net\spezdetektor_sms]])
end
function pda_slom_sms1()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_pda_slom_sms1_0"), nil, "nano", 10000, nil, [[sms\net\pda_slom_sms1]])
end
function pda_slom_sms2()
	sms("%c[sender]"..translate("name_mechenii")..":\\n%c[sms_red]"..translate("sms_strelok_pda_slom_sms2_0"), nil, "meceniy", 15000, nil, [[sms\strelok\pda_slom_sms2]])
end
function pda_slom_sms4()
	sms("%c[sender]"..translate("name_barmen")..":\\n%c[sms_red]"..translate("sms_barman_pda_slom_sms4_0"), nil, "barman", 11000, nil, [[sms\barman\pda_slom_sms4]])
end
function pda_slom_sms5()
	sms("%c[sender]"..translate("name_mechenii")..":\\n%c[sms_red]"..translate("sms_strelok_pda_slom_sms5_0"), nil, "meceniy", 25000, nil, [[sms\strelok\pda_slom_sms5]])
end
function pda_slom_sms6()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_pda_slom_sms1_0"), nil, "nano", 10000, nil, [[sms\net\pda_slom_sms1]])
end
function pda_sdelan_sms0()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_pda_sdelan_sms0_0"), nil, "nano", 10000, nil, [[sms\net\pda_sdelan_sms0]])
	Timer:start_game("run", 0, 0, math.random(50, 80), "arhara_dialog.pda_slom_part2()")
end
-- Повторная поломка
function pda_slom_part2()
	-- Если не починили, то ломаемся опять
	if not has_info("docent_kpk_gotov_start") then
		give_info("pda_dont_work")
		pda_slom_sms1()
	end
end
function pda_sdelan_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_pda_sdelan_sms_0"), nil, "nano", 10000, nil, [[sms\net\pda_sdelan_sms]])
end
function girl3_nachalo_sms()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_girl3_nachalo_sms_0"), nil, "molniy", 23000, nil, [[sms\molniy\girl3_nachalo_sms]])
end
function girl3_nachalo_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_girl3_nachalo_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\girl3_nachalo_sms1]])
end
function girl3_nachalo_sms2()
	sms("%c[sender]"..translate("name_chyornii_doktor")..":\\n%c[sms_red]"..translate("sms_doctor_black_girl3_nachalo_sms2_0"), nil, "doctor_black", 25000, nil, [[sms\doctor_black\girl3_nachalo_sms2]])
end
function girl3_nachalo_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_girl3_nachalo_sms3_0"), nil, "strelok", 25000, nil, [[sms\strelok\girl3_nachalo_sms3]])
end
function molniy_bar_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_bar_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\molniy_bar_sms]])
end
function molniy_bar_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_molniy_bar_sms1_0"), nil, "molniy", 18000, nil, [[sms\molniy\molniy_bar_sms1]])
end
function strannik_lima_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_strannik_lima_sms_0"), nil, "strelok", 32000, nil, [[sms\strelok\strannik_lima_sms]])
end
function strannik_lima_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_strannik_lima_sms1_0"), nil, "molniy", 12000, nil, [[sms\molniy\strannik_lima_sms1]])
end
function strannik_lima_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_strannik_lima_sms2_0"), nil, "strelok", 25000, nil, [[sms\strelok\strannik_lima_sms2]])
end
function after_semetskiy_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_after_semetskiy_sms_0"), nil, "strelok", 10000, nil, [[sms\strelok\after_semetskiy_sms]])
end
function after_semetskiy_sms1()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_after_semetskiy_sms1_0"), 3, "prizrak", 25000, nil, [[sms\prizrak\after_semetskiy_sms1]])
end
function preduprezhdenie_sms()
		if has_info("actor_cant_move") then
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_preduprezhdenie_sms_0"), nil, "imilian", 20000, nil, [[sms\maksimilian\preduprezhdenie_sms]])
end
end
function preduprezhdenie_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("preduprezhdenie_sms1_0_0"), nil, "strelok", 10000, nil, [[sms\strelok\preduprezhdenie_sms1]])
end
function preduprezhdenie_sms2()
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_preduprezhdenie_sms2_0"), nil, "imilian", 15000, nil, [[sms\maksimilian\preduprezhdenie_sms2]])
end
function preduprezhdenie_sms3()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_preduprezhdenie_sms3_0"), nil, "prizrak", 25000, nil, [[sms\prizrak\preduprezhdenie_sms3]])
end
function preduprezhdenie_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_preduprezhdenie_sms4_0"), nil, "strelok", 20000, nil, [[sms\strelok\preduprezhdenie_sms4]])
end
function odnon_proval_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_odnon_proval_sms_0"), nil, "nano", 10000, nil, [[sms\net\odnon_proval_sms]])
end
function foto_ok()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_foto_ok_0"), nil, "nano", 7000, nil, [[sms\net\foto_ok]])
end
function vopros_k_prizraku_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vopros_k_prizraku_sms_0"), nil, "strelok", 28000, nil, [[sms\strelok\vopros_k_prizraku_sms]])
end
function vopros_k_prizraku_sms1()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_vopros_k_prizraku_sms1_0"), nil, "prizrak", 15000, nil, [[sms\prizrak\vopros_k_prizraku_sms1]])
	timer("run", 17.0, "arhara_dialog.ds_password_zapisali()")
end
function pili_sdelal_psevdofoto_sms()
	sms("%c[sender]"..translate("name_piligrim")..":\\n%c[sms_red]"..translate("sms_piligrim_pili_sdelal_psevdofoto_sms_0"), nil, "piligrim", 20000, nil, [[sms\piligrim\pili_sdelal_psevdofoto_sms]])
end
function molniy_posle_foto_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_posle_foto_sms_0"), nil, "strelok", 10000, nil, [[sms\strelok\molniy_posle_foto_sms]])
end
function molniy_posle_foto_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_molniy_posle_foto_sms1_0"), nil, "molniy", 40000, nil, [[sms\molniy\molniy_posle_foto_sms1]])
end
function molniy_posle_foto_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_posle_foto_sms2_0"), nil, "strelok", 25000, nil, [[sms\strelok\molniy_posle_foto_sms2]])
end
function molniy_posle_foto_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_posle_foto_sms3_0"), nil, "strelok", 10000, nil, [[sms\strelok\molniy_posle_foto_sms3]])
end
function molniy_posle_foto_sms4()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_molniy_posle_foto_sms4_0"), nil, "klyk", 24000, nil, [[sms\kluk\molniy_posle_foto_sms4]])
end
function molniy_posle_foto_sms5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_posle_foto_sms5_0"), nil, "strelok", 10000, nil, [[sms\strelok\molniy_posle_foto_sms5]])
end
function molniy_posle_foto_sms6()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_molniy_posle_foto_sms6_0"), nil, "klyk", 34000, nil, [[sms\kluk\molniy_posle_foto_sms6]])
end
function molniy_posle_foto_sms7()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_molniy_posle_foto_sms7_0"), nil, "strelok", 7000, nil, [[sms\strelok\molniy_posle_foto_sms7]])
end
function molniy_posle_foto_sms8()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_molniy_posle_foto_sms8_0"), nil, "klyk", 30000, nil, [[sms\kluk\molniy_posle_foto_sms8]])
end
function pozisiy_bunker_gg_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pozisiy_bunker_gg_sms_0"), nil, "strelok", 10000, nil, [[sms\strelok\pozisiy_bunker_gg_sms]])
end
function pozisiy_bunker_gg_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_pozisiy_bunker_gg_sms1_0"), nil, "klyk", 30000, nil, [[sms\kluk\pozisiy_bunker_gg_sms1]])
end
function bunker_fotik_artu_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_bunker_fotik_artu_sms_0"), nil, "nano", 11000, nil, [[sms\net\bunker_fotik_artu_sms]])
end
function bunker_fotik_artu_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_bunker_fotik_artu_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\bunker_fotik_artu_sms1]])
end
function ozhivil_radista_sms()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_ozhivil_radista_sms_0"), nil, "klyk", 25000, nil, [[sms\kluk\ozhivil_radista_sms]])
end
function ozhivil_radista_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_ozhivil_radista_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\ozhivil_radista_sms1]])
end
function nashel_sadik_taynik_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_nashel_sadik_taynik_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\nashel_sadik_taynik_sms]])
end
function seif_zakrut_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_seif_zakrut_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\seif_zakrut_sms]])
end
function seif_zakrut_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_seif_zakrut_sms1_0"), nil, "klyk", 30000, nil, [[sms\kluk\seif_zakrut_sms1]])
end
function seif_sadik_otkrut_sms()
	sms("%c[sender]"..translate("name_radist")..":\\n%c[sms_red]"..translate("sms_radist_seif_sadik_otkrut_sms_0"), nil, "radist", 20000, nil, [[sms\radist\seif_sadik_otkrut_sms]])
end
function otkroem_bez_radista_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_otkroem_bez_radista_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\otkroem_bez_radista_sms]])
end
function otkroem_bez_radista_sms1()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_otkroem_bez_radista_sms1_0"), nil, "klyk", 25000, nil, [[sms\kluk\otkroem_bez_radista_sms1]])
end
function forest_pozisiy_na_dome_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_forest_pozisiy_na_dome_sms_0"), nil, "strelok", 15000, nil, [[sms\strelok\forest_pozisiy_na_dome_sms]])
end
function forest_pozisiy_na_dome_sms1()
	sms("%c[sender]"..translate("name_lesnik")..":\\n%c[sms_red]"..translate("sms_lesnik_forest_pozisiy_na_dome_sms1_0"), nil, "lesnik", 25000, nil, [[sms\lesnik\forest_pozisiy_na_dome_sms1]])
end
function pogib_stalk_sms()
	sms("%c[sender]"..translate("name_san_sanich")..":\\n%c[sms_red]"..translate("sms_sansanich_pogib_stalk_sms_0"), nil, nil, 15000, nil, [[sms\sansanich\pogib_stalk_sms]])
end
function pogib_stalk_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pogib_stalk_sms1_0"), nil, "strelok", 15000, nil, [[sms\strelok\pogib_stalk_sms1]])
end
function ozhivil2_radista2_sms()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_kluk_ozhivil2_radista2_sms_0"), nil, "klyk", 25000, nil, [[sms\kluk\ozhivil2_radista2_sms]])
end
function ozhivil2_radista2_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_ozhivil2_radista2_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\ozhivil2_radista2_sms1]])
end
function superzhekan_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_superzhekan_sms_0"), nil, "nano", 10000, nil, [[sms\net\superzhekan_sms]])
end
function superzhekan_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_superzhekan_sms1_0"), nil, "strelok", 30000, nil, [[sms\strelok\superzhekan_sms1]])
end
function foto_mozg_ok_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_foto_mozg_ok_sms_0"), nil, "nano", 10000, nil, [[sms\net\foto_mozg_ok_sms]])
end
function vodka_dly_kepa_sms()
	sms("%c[sender]"..translate("name_chasovoi")..":\\n%c[sms_red]"..translate("sms_chasovoy_vodka_dly_kepa_sms_0"), nil, nil, 20000, nil, [[sms\chasovoy\vodka_dly_kepa_sms]])
	timer("run", 7.0, "arhara_dialog.vodka_dly_kepa_sms1()")
end
function vodka_dly_kepa_sms1()
		if not has_info("agro_chsovoy_trezv_enemy") then
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_vodka_dly_kepa_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\vodka_dly_kepa_sms1]])
 end
end
function sms_kuznets()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_kuznets_0"), nil, "strelok", 20000, nil, [[sms\strelok\sms_kuznets]])
end
function sms_kuznets1()
	sms("%c[sender]"..translate("name_kuznetsov")..":\\n%c[sms_red]"..translate("sms_kuznecov_sms_kuznets1_0"), nil, "kuznecov", 28000, nil, [[sms\kuznecov\sms_kuznets1]])
end
function narod_napilsy_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_narod_napilsy_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\narod_napilsy_sms]])
end
function narod_napilsy_sms1()
	sms("%c[sender]"..translate("name_kuznetsov")..":\\n%c[sms_red]"..translate("sms_kuznecov_narod_napilsy_sms1_0"), nil, "kuznecov", 28000, nil, [[sms\kuznecov\narod_napilsy_sms1]])
end
function yntar_sms_k_molnii1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_yntar_sms_k_molnii1_0"), nil, "strelok", 15000, nil, [[sms\strelok\yntar_sms_k_molnii1]])
end
function yntar_sms_k_molnii2()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_yntar_sms_k_molnii2_0"), nil, "molniy", 5000, nil, [[sms\molniy\yntar_sms_k_molnii2]])
end
function mina_pant_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("mina_pant_sms_0_0"), nil, "strelok", 3000, nil, [[sms\strelok\mina_pant_sms]])
        disable_info("actor_cant_move")
end
function mina_pant_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_mina_pant_sms1_0"), nil, "strelok", 15000, nil, [[sms\strelok\mina_pant_sms1]])
end
function mina_pant_sms2()
	sms("%c[sender]"..translate("name_otets_panteri")..":\\n%c[sms_red]"..translate("sms_father_pantera_mina_pant_sms2_0"), nil, "father_pantera", 7000, nil, [[sms\father_pantera\mina_pant_sms2]])
end
function mina_pant_sms3()
	sms("%c[sender]"..translate("name_otets_panteri")..":\\n%c[sms_red]"..translate("sms_father_pantera_mina_pant_sms3_0"), nil, "father_pantera", 15000, nil, [[sms\father_pantera\mina_pant_sms3]])
end
function pantera_sms_stop1()
	if not has_info("pantera_umerla") then
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pantera_sms_stop1_0"), nil, "strelok", 20000, nil, [[sms\strelok\pantera_sms_stop1]])
 end
end
function pantera_sms_stop2()
	if not has_info("pantera_umerla") then
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pantera_sms_stop2_0"), nil, "pantera", 25000, nil, [[sms\pantera\pantera_sms_stop2]])
 end
end
function bazar_s_klenovum1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_bazar_s_klenovum1_0"), nil, "strelok", 25000, nil, [[sms\strelok\bazar_s_klenovum1]])
end
function bazar_s_klenovum2()
	sms("%c[sender]"..translate("name_klyonov")..":\\n%c[sms_red]"..translate("sms_klenov_bazar_s_klenovum2_0"), nil, "klenov", 20000, nil, [[sms\klenov\bazar_s_klenovum2]])
end
function bazar_s_klenovum3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_bazar_s_klenovum3_0"), nil, "strelok", 20000, nil, [[sms\strelok\bazar_s_klenovum3]])
end
function bazar_s_klenovum4()
	sms("%c[sender]"..translate("name_klyonov")..":\\n%c[sms_red]"..translate("sms_klenov_bazar_s_klenovum4_0"), nil, "klenov", 25000, nil, [[sms\klenov\bazar_s_klenovum4]])
end
function bazar_s_klenovum5()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_bazar_s_klenovum5_0"), nil, "strelok", 20000, nil, [[sms\strelok\bazar_s_klenovum5]])
end
function bazar_s_klenovum6()
	sms("%c[sender]"..translate("name_klyonov")..":\\n%c[sms_red]"..translate("sms_klenov_bazar_s_klenovum6_0"), nil, "klenov", 30000, nil, [[sms\klenov\bazar_s_klenovum6]])
end
function kl_pos_est_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kl_pos_est_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\kl_pos_est_sms]])
end
function kl_pos_est_sms1()
	sms("%c[sender]"..translate("name_klyonov")..":\\n%c[sms_red]"..translate("sms_klenov_kl_pos_est_sms1_0"), nil, "klenov", 25000, nil, [[sms\klenov\kl_pos_est_sms1]])
end
function kl_pos_est_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_kl_pos_est_sms2_0"), nil, "strelok", 31000, nil, [[sms\strelok\kl_pos_est_sms2]])
end
function prizrak_ranen_sms()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_prizrak_ranen_sms_0"), nil, "prizrak", 33000, nil, [[sms\prizrak\prizrak_ranen_sms]])
end
function prizrak_ranen_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_prizrak_ranen_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\prizrak_ranen_sms1]])
end
function prizrak_ranen_sms2()
	sms("%c[sender]"..translate("name_prizrak")..":\\n%c[sms_red]"..translate("sms_prizrak_prizrak_ranen_sms2_0"), nil, "prizrak", 35000, nil, [[sms\prizrak\prizrak_ranen_sms2]])
end
function prizrak_ranen_sms3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_prizrak_ranen_sms3_0"), nil, "strelok", 35000, nil, [[sms\strelok\prizrak_ranen_sms3]])
end
function perehov_na_yantar_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_perehov_na_yantar_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\perehov_na_yantar_sms]])
end
function perehov_na_yantar_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_perehov_na_yantar_sms1_0"), nil, "molniy", 10000, nil, [[sms\molniy\perehov_na_yantar_sms1]])
end
function perehov_na_yantar_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_perehov_na_yantar_sms2_0"), nil, "strelok", 20000, nil, [[sms\strelok\perehov_na_yantar_sms2]])
end
function pantera_na_kordone_sms()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_pantera_na_kordone_sms_0"), nil, "pantera", 25000, nil, [[sms\pantera\pantera_na_kordone_sms]])
end
function pantera_na_kordone_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pantera_na_kordone_sms1_0"), nil, "strelok", 25000, nil, [[sms\strelok\pantera_na_kordone_sms1]])
end
function poslednie_sms_pantera()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_poslednie_sms_pantera_0"), nil, "strelok", 30000, nil, [[sms\strelok\poslednie_sms_pantera]])
end
function poslednie_sms_pantera1()
	sms("%c[sender]"..translate("name_pantera")..":\\n%c[sms_red]"..translate("sms_pantera_poslednie_sms_pantera1_0"), nil, "pantera", 30000, nil, [[sms\pantera\poslednie_sms_pantera1]])
end
function moroz_sms()
	sms("%c[sender]"..translate("name_san_sanich")..":\\n%c[sms_red]"..translate("sms_sansanich_moroz_sms_0"), nil, nil, 25000, nil, [[sms\sansanich\moroz_sms]])
end
function pomosch_ot_chernomora_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_pomosch_ot_chernomora_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\pomosch_ot_chernomora_sms]])
end
function pomosch_ot_chernomora_sms1()
	sms("%c[sender]"..translate("name_chernomor")..":\\n%c[sms_red]"..translate("sms_chernomor_pomosch_ot_chernomora_sms1_0"), nil, "chernomor", 25000, nil, [[sms\chernomor\pomosch_ot_chernomora_sms1]])
end
function nashel_gada_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_nashel_gada_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\nashel_gada_sms]])
end
function sms_otez_poreshil()
	sms("%c[sender]"..translate("name_lokalnaya_set")..":\\n%c[sms_red]"..translate("sms_net_sms_otez_poreshil_0"), nil, "net", 7000, nil, [[sms\net\sms_otez_poreshil]])
end
function sms_otez_poreshil1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_otez_poreshil1_0"), nil, "strelok", 25000, nil, [[sms\strelok\sms_otez_poreshil1]])
end
function sms_otez_poreshil2()
	sms("%c[sender]"..translate("name_otets_panteri")..":\\n%c[sms_red]"..translate("sms_father_pantera_sms_otez_poreshil2_0"), nil, "father_pantera", 38000, nil, [[sms\father_pantera\sms_otez_poreshil2]])
end
function sms_otez_poreshil3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_otez_poreshil3_0"), nil, "strelok", 25000, nil, [[sms\strelok\sms_otez_poreshil3]])
end
function sms_otez_poreshil4()
	sms("%c[sender]"..translate("name_otets_panteri")..":\\n%c[sms_red]"..translate("sms_father_pantera_sms_otez_poreshil4_0"), nil, "father_pantera", 10000, nil, [[sms\father_pantera\sms_otez_poreshil4]])
end
function na_kamne_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_na_kamne_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\na_kamne_sms]])
end
function sms_razgovor_sxod_nz()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_razgovor_sxod_nz_0"), nil, "zlobny", 25000, nil, [[sms\zlobny\sms_razgovor_sxod_nz]])
end
function sms_razgovor_sxod_nz1()
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_sms_razgovor_sxod_nz1_0"), nil, "imilian", 25000, nil, [[sms\maksimilian\sms_razgovor_sxod_nz1]])
end
function sms_razgovor_sxod_nz2()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_razgovor_sxod_nz2_0"), nil, "zlobny", 25000, nil, [[sms\zlobny\sms_razgovor_sxod_nz2]])
end
function sms_razgovor_sxod_nz3()
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_sms_razgovor_sxod_nz3_0"), nil, "imilian", 25000, nil, [[sms\maksimilian\sms_razgovor_sxod_nz3]])
end
function sms_razgovor_sxod_nz4()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_razgovor_sxod_nz4_0"), nil, "zlobny", 25000, nil, [[sms\zlobny\sms_razgovor_sxod_nz4]])
end
function sms_razgovor_sxod_nz5()
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_sms_razgovor_sxod_nz5_0"), nil, "imilian", 25000, nil, [[sms\maksimilian\sms_razgovor_sxod_nz5]])
end
function sms_razgovor_sxod_nz6()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_razgovor_sxod_nz6_0"), nil, "zlobny", 25000, nil, [[sms\zlobny\sms_razgovor_sxod_nz6]])
end
function sms_taynik_zlobnuy()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_taynik_zlobnuy_0"), nil, "zlobny", 24000, nil, [[sms\zlobny\sms_taynik_zlobnuy]])
end
function sms_taynik_zlobnuy1()
	sms("%c[sender]"..translate("name_imilian")..":\\n%c[sms_red]"..translate("sms_maksimilian_sms_taynik_zlobnuy1_0"), nil, "imilian", 25000, nil, [[sms\maksimilian\sms_taynik_zlobnuy1]])
end
function ynt_after_perexod_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_ynt_after_perexod_sms_0"), nil, "strelok", 20000, nil, [[sms\strelok\ynt_after_perexod_sms]])
end
function ynt_after_perexod_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_ynt_after_perexod_sms1_0"), nil, "molniy", 6000, nil, [[sms\molniy\ynt_after_perexod_sms1]])
end
function ynt_after_perexod_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_ynt_after_perexod_sms2_0"), nil, "strelok", 25000, nil, [[sms\strelok\ynt_after_perexod_sms2]])
end
function preplastilin_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_preplastilin_sms_0"), nil, "nano", 10000, nil, [[sms\net\preplastilin_sms]])
end
function dialog_oborvan_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dialog_oborvan_sms_0"), nil, "strelok", 30000, nil, [[sms\strelok\dialog_oborvan_sms]])
end
function poluchenie_klucha_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_poluchenie_klucha_sms_0"), nil, "nano", 13000, nil, [[sms\net\poluchenie_klucha_sms]])
end
function del_blok_and_restr_sms()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_del_blok_and_restr_sms_0"), nil, "nano", 10000, nil, [[sms\net\del_blok_and_restr_sms]])
end
function sms_zaschita_portal()
	sms("%c[sender]"..translate("name_soobschenie_sistemi")..":\\n%c[sms_red]"..translate("sms_net_sms_zaschita_portal_0"), nil, "nano", 5000, nil, [[sms\net\sms_zaschita_portal]])
end
function pervoe_sms_dsity()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_pervoe_sms_dsity_0"), nil, "zlobny", 20000, nil, [[sms\zlobny\pervoe_sms_dsity]])
end
function sms_parfumer1()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_sms_parfumer1_0"), nil, "parfumer", 30000, nil, [[sms\parfumer\sms_parfumer1]])
end
function sms_zaschita_mg()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_zaschita_mg_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_zaschita_mg]])
end
function parfum_sms_kontrik1()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_parfum_sms_kontrik1_0"), nil, "parfumer", 15000, nil, [[sms\parfumer\parfum_sms_kontrik1]])
end
function parfum_sms_kontrik2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_parfum_sms_kontrik2_0"), nil, "strelok", 15000, nil, [[sms\strelok\parfum_sms_kontrik2]])
end
function parfum_sms_kontrik3()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_parfum_sms_kontrik3_0"), nil, "parfumer", 45000, nil, [[sms\parfumer\parfum_sms_kontrik3]])
end
function netu_kontrolera_sms()
	sms("%c[sender]"..translate("name_norman")..":\\n%c[sms_red]"..translate("sms_norman_vstrecha_0"), nil, "norman", 18000, nil, [[sms\norman\netu_kontrolera_sms]])
end
function sms_obmorok1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_obmorok1_0"), nil, "strelok", 15000, nil, [[sms\strelok\sms_obmorok1]])
end
function sms_obmorok2()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_sms_obmorok2_0"), nil, "obmorok", 20000, nil, [[sms\obmorok\sms_obmorok2]])
end
function sms_obmorok3()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_obmorok3_0"), nil, "strelok", 25000, nil, [[sms\strelok\sms_obmorok3]])
end
function sms_obmorok4()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_sms_obmorok4_0"), nil, "obmorok", 30000, nil, [[sms\obmorok\sms_obmorok4]])
end
function strelka_obmorok_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_strelka_obmorok_sms1_0"), nil, "strelok", 15000, nil, [[sms\strelok\strelka_obmorok_sms1]])
end
function strelka_obmorok_sms2()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_strelka_obmorok_sms2_0"), nil, "obmorok", 20000, nil, [[sms\obmorok\strelka_obmorok_sms2]])
end
function sms_dcity_zenter_doza()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_dcity_zenter_doza_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_dcity_zenter_doza]])
end
function sms_dcity_zenter_doza_otkl()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_dcity_zenter_doza_otkl_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_dcity_zenter_doza_otkl]])
	timer("run", 7.0, "arhara_dialog.spawn_city_last_zentr()")
end

function spawn_city_last_zentr()
	give_info("spawn_city_last_zentr")
-- say([[characters_voice\scenario\buusty\sirena]])
end

function ds_password_zapisali()
	give_info("ds_password_info")
end

function sms_dcity_gorod2_doza2()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_dcity_gorod2_doza2_0"), nil, "zashita", 30000, nil, [[sms\zashita\sms_dcity_gorod2_doza2]])
end
function sms_dcity_gorod_doza()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_dcity_gorod_doza_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_dcity_gorod_doza]])
end
function poziciy_cherdak_zanyta_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_poziciy_cherdak_zanyta_sms_0"), nil, "strelok", 15000, nil, [[sms\strelok\poziciy_cherdak_zanyta_sms]])
end
function hand_hoh_sms()
	sms("%c[sender]"..translate("boec_poslednego_dnia")..":\\n%c[sms_red]"..translate("hand_hoh_sms_0"), nil, nil, 7000, nil, [[sms\lastday\hand_hoh_sms]])
end
function suki_rasstrel_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_suki_rasstrel_sms_0"), nil, "strelok", 10000, nil, [[sms\strelok\suki_rasstrel_sms]])
end
function sms_zlobnomu_rasstrel()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_zlobnomu_rasstrel_0"), nil, "strelok", 25000, nil, [[sms\strelok\sms_zlobnomu_rasstrel]])
end
function sms_zlobnomu_rasstrel1()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_sms_zlobnomu_rasstrel1_0"), nil, "obmorok", 20000, nil, [[sms\obmorok\sms_zlobnomu_rasstrel1]])
end
function sms_zlobnomu_rasstrel2()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_zlobnomu_rasstrel2_0"), nil, "zlobny", 25000, nil, [[sms\zlobny\sms_zlobnomu_rasstrel2]])
end
function sms_zlobnomu_rasstrel3()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_sms_zlobnomu_rasstrel3_0"), nil, "obmorok", 25000, nil, [[sms\obmorok\sms_zlobnomu_rasstrel3]])
end
function sms_zlobnomu_rasstrel4()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_zlobnomu_rasstrel4_0"), nil, "zlobny", 10000, nil, [[sms\zlobny\sms_zlobnomu_rasstrel4]])
end
function sms_zlobnomu_rasstrel4_1()
	sms("%c[sender]"..translate("name_zlobnii")..":\\n%c[sms_red]"..translate("sms_zlobny_sms_zlobnomu_rasstrel4_1_0"), nil, "zlobny", 20000, nil, [[sms\zlobny\sms_zlobnomu_rasstrel4_1]])
end
function sms_zlobnomu_rasstrel5()
	sms("%c[sender]"..translate("name_norman")..":\\n%c[sms_red]"..translate("sms_zlobnomu_rasstrel5_0"), nil, "norman", 23000, nil, [[sms\norman\sms_zlobnomu_rasstrel5]])
end
function sms_zlobnomu_rasstrel6()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_zlobnomu_rasstrel6_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_zlobnomu_rasstrel6]])
end
function sms_zlobnomu_rasstrel7()
if not has_info("agro_tainik_norman_start") then
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_sms_zlobnomu_rasstrel7_0"), nil, "zashita", 20000, nil, [[sms\zashita\sms_zlobnomu_rasstrel7]])
		timer("run", 4.0, "new_spawn.atp_presled_last()")
end
end
function agro_tainik_norman_sms()
	sms("%c[sender]"..translate("name_norman")..":\\n%c[sms_red]"..translate("sms_agro_tainik_norman_sms_0"), nil, "norman", 21000, nil, [[sms\norman\agro_tainik_norman_sms]])
end
function sms_k_normany1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sms_k_normany1_0"), nil, "strelok", 30000, nil, [[sms\strelok\sms_k_normany1]])
end
function sms_k_normany2()
	sms("%c[sender]"..translate("name_norman")..":\\n%c[sms_red]"..translate("sms_k_normany2_0"), nil, "norman", 56000, nil, [[sms\norman\sms_k_normany2]])
end
function dcity_otvet_ok_obmor1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dcity_otvet_ok_obmor1_0"), nil, "strelok", 25000, nil, [[sms\strelok\dcity_otvet_ok_obmor1]])
end
function dcity_otvet_ok_obmor2()
	sms("%c[sender]"..translate("name_obmorok")..":\\n%c[sms_red]"..translate("sms_obmorok_dcity_otvet_ok_obmor2_0"), nil, "obmorok", 20000, nil, [[sms\obmorok\dcity_otvet_ok_obmor2]])
end
function dcity_otvet_ok_obmor3()
	sms("%c[sender]"..translate("name_saharov")..":\\n%c[sms_red]"..translate("sms_saharov_dcity_otvet_ok_obmor3_0"), nil, "saharov", 20000, nil, [[sms\saharov\dcity_otvet_ok_obmor3]])
end
function dcity_otvet_ok_obmor4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_dcity_otvet_ok_obmor4_0"), nil, "strelok", 20000, nil, [[sms\strelok\dcity_otvet_ok_obmor4]])
end
function dcity_duda_zvonok_sms1()
        if not has_info("spasty_doka_start") then
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_dcity_duda_zvonok_sms1_0"), 4, "parfumer", 20000, nil)--, [[sms\parfumer\dcity_duda_zvonok_sms1]])
 end
end
function dcity_duda_zvonok_sms2()
        if not has_info("spasty_doka_start") then
	sms("%c[sender]"..translate("name_duda")..":\\n%c[sms_red]"..translate("sms_duda_dcity_duda_zvonok_sms2_0"), nil, "duda", 20000, nil, [[sms\duda\dcity_duda_zvonok_sms2]])
 end
end
function dcity_duda_zvonok_sms3() 
        if not has_info("spasty_doka_start") then
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_dcity_duda_zvonok_sms3_0"), nil, "parfumer", 38000, nil)--, [[sms\parfumer\dcity_duda_zvonok_sms3]])
 end
end
function dcity_duda_zvonok_sms4()
        if not has_info("spasty_doka_start") then
	sms("%c[sender]"..translate("name_duda")..":\\n%c[sms_red]"..translate("sms_duda_dcity_duda_zvonok_sms4_0"), nil, "duda", 40000, nil, [[sms\duda\dcity_duda_zvonok_sms4]])
 end
end
function dcity_iskra_zvonok_sms1()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_dcity_iskra_zvonok_sms1_0"), nil, "parfumer", 25000, nil, [[sms\parfumer\dcity_iskra_zvonok_sms1]])
end
function dcity_iskra_zvonok_sms2()
	sms("%c[sender]"..translate("name_iskra")..":\\n%c[sms_red]"..translate("sms_iskra_dcity_iskra_zvonok_sms2_0"), nil, "iskra", 25000, nil, [[sms\iskra\dcity_iskra_zvonok_sms2]])
end
function dcity_iskra_zvonok_sms3()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_dcity_iskra_zvonok_sms3_0"), nil, "parfumer", 20000, nil, [[sms\parfumer\dcity_iskra_zvonok_sms3]])
end
function sms_otkl_zona1()
	sms("%c[sender]"..translate("name_iskra")..":\\n%c[sms_red]"..translate("sms_iskra_sms_otkl_zona1_0"), nil, "iskra", 25000, nil, [[sms\iskra\sms_otkl_zona1]])
end
function sms_otkl_zona2()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_sms_otkl_zona2_0"), nil, "parfumer", 25000, nil, [[sms\parfumer\sms_otkl_zona2]])
end
function sms_otkl_zona3()
	sms("%c[sender]"..translate("name_iskra")..":\\n%c[sms_red]"..translate("sms_iskra_sms_otkl_zona3_0"), nil, "iskra", 25000, nil, [[sms\iskra\sms_otkl_zona3]])
end
function sms_otkl_zona4()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_sms_otkl_zona4_0"), nil, "parfumer", 25000, nil, [[sms\parfumer\sms_otkl_zona4]])
end
function sms_otkl_zona5()
	sms("%c[sender]"..translate("name_vhodyaschee_soobschenie")..":\\n%c[sms_red]"..translate("sms_molniy_molniy_chmok_0"), nil, nil, 35000, nil, [[sms\molniy\sms_otkl_zona5]])
end
function vylozhit_oruzhie_sms()
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[255,0,255,0]"..translate("sms_zashita_vylozhit_oruzhie_sms_0"), nil, "zashita", 25000, nil, [[sms\zashita\vylozhit_oruzhie_sms]])
end
function remen_dialog_sms1()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("characters_voice_ozvuchka_molniy_zaxodi_0"), nil, "molniy", 11000, nil, [[sms\molniy\remen_dialog_sms1]])
end
function remen_dialog_sms2()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_remen_dialog_sms2_0"), nil, "strelok", 14000, nil, [[sms\strelok\remen_dialog_sms2]])
end
function remen_dialog_sms3()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_molniy_sex_0"), nil, "molniy", 34000, nil, [[sms\molniy\remen_dialog_sms3]])
end
function remen_dialog_sms4()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_remen_dialog_sms4_0"), nil, "strelok", 13000, nil, [[sms\strelok\remen_dialog_sms4]])
end
function remen_dialog_sms5()
	sms("%c[sender]"..translate("name_molniya")..":\\n%c[sms_red]"..translate("sms_molniy_molniy_ne_staraysy_0"), nil, "molniy", 30000, nil, [[sms\molniy\remen_dialog_sms5]])
end
function remen_dialog_sms6()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_remen_dialog_sms6_0"), nil, "parfumer", 35000, nil, [[sms\parfumer\remen_dialog_sms6]])
end
function otkr_perex_zaton_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_otkr_perex_zaton_sms1_0"), nil, "strelok", 20000, nil, [[sms\strelok\otkr_perex_zaton_sms1]])
end
function otkr_perex_zaton_sms2()
	sms("%c[sender]"..translate("name_norman")..":\\n%c[sms_red]"..translate("sms_otkr_perex_zaton_sms2_0"), nil, "norman", 7000, nil, [[sms\norman\otkr_perex_zaton_sms2]])
end
function acv_sol()
	give_info("acv_sol")
end
function nashel_listok_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_nashel_listok_sms1_0"), nil, "strelok", 7000, nil, [[sms\strelok\nashel_listok_sms1]])
end
function nashel_listok_sms2()
	sms("%c[sender]"..translate("name_parfyumer")..":\\n%c[sms_red]"..translate("sms_parfumer_nashel_listok_sms2_0"), nil, "parfumer", 10000, nil, [[sms\parfumer\nashel_listok_sms2]])
end
function operator_babki_otdat_sms()
	sms("%c[sender]"..translate("name_operator_svyazi")..":\\n%c[sms_red]"..translate("sms_net_operator_babki_otdat_sms_0"), nil, "svyaz", 13000, nil, [[sms\net\operator_babki_otdat_sms]])
end
function operator_babki_otdat_sms1()
	sms("%c[sender]"..translate("name_lukash")..":\\n%c[sms_red]"..translate("sms_lucash_operator_babki_otdat_sms1_0"), nil, "lucash", 10000, nil, [[sms\lucash\operator_babki_otdat_sms1]])
end
function operator_babki_otdat_sms2()
	sms("%c[sender]"..translate("name_kuznetsov")..":\\n%c[sms_red]"..translate("sms_kuznecov_operator_babki_otdat_sms2_0"), nil, "kuznecov", 10000, nil, [[sms\kuznecov\operator_babki_otdat_sms2]])
end
function operator_babki_otdat_sms3()
	sms("%c[sender]"..translate("name_lisii")..":\\n%c[sms_red]"..translate("sms_lisiy_operator_babki_otdat_sms3_0"), nil, "lisiy", 5000, nil, [[sms\lisiy\operator_babki_otdat_sms3]])
end
function operator_babki_otdat_sms4()
	sms("%c[sender]"..translate("name_operator_svyazi")..":\\n%c[sms_red]"..translate("sms_net_operator_babki_otdat_sms4_0"), nil, "svyaz", 10000, nil, [[sms\net\operator_babki_otdat_sms4]])
end
function bland_sms()
	sms("%c[sender]"..translate("name_blend")..":\\n%c[sms_red]"..translate("sms_bland_bland_sms_0"), nil, "bland", 30000, nil, [[sms\bland\bland_sms]])
end
function bland_sms1()
	sms("%c[sender]"..translate("name_blend")..":\\n%c[sms_red]"..translate("sms_bland_bland_sms1_0"), nil, "bland", 25000, nil, [[sms\bland\bland_sms1]])
end
function sborr_sms()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_sborr_sms_0"), nil, "strelok", 25000, nil, [[sms\strelok\sborr_sms]])
end
function nachalnik_zvonok_sms1()
	sms("%c[sender]"..translate("name_duda")..":\\n%c[sms_red]"..translate("sms_duda_nachalnik_zvonok_sms1_0"), nil, "duda", 30000, nil, [[sms\duda\nachalnik_zvonok_sms1]])
end
function nachalnik_zvonok_sms2()
	sms("%c[sender]"..translate("name_chasovoi")..":\\n%c[sms_red]"..translate("sms_chasovoy_nachalnik_zvonok_sms2_0"), nil, nil, 20000, nil, [[sms\chasovoy\nachalnik_zvonok_sms2]])
end

--' заспавним изломов в деревне рестриктором
function spawn_village_izlom()
	create("fracture_strong",xyz(77.537,10.171,26.215),37126,3333)
	create("fracture_strong",xyz(75.063,10.069,26.122),36278,3333)
end

function set_pantera()
	map_spot(server_object("marsh_pantera").id,"crlc_big","set_pantera_0") 
end

function remove_pantera_metka()
	del_map_spot(server_object("marsh_pantera").id,"crlc_big")
end

--' спавним пару кабанов у Пантеры на болотах
function spawn_boar1_marsh()
	create("boar_strong",xyz(-297.283,-0.292,113.592),1496,3378)
	create("boar_strong",xyz(-297.283,-0.292,113.592),1496,3378)
	create("boar_strong",xyz(-297.282,-0.292,113.592),1496,3378)
end

--' убираем людишек из Деревни
function delete_chel_village()
	release("village_kapatel3")
	release("village_stalk_dead1")
	release("village_stalk_dead2")
	release("village_stalk_dead3")
	release("village_brat_dead")
	release("village_kapatel1")
	release("village_kapatel2")
	release("village_magazin_kapatel1")
	release("village_magazin_kapatel2")
	release("village_magazin_kapatel3")
	release("village_xolm_kapatel1")
	release("village_xolm_kapatel2")
	release("village_xolm_kapatel3")
	release("village_xolm_kapatel4")
end

function metka_marsh_provodnik()
	map_spot(server_object("boloto_provodnik").id,"crlc_big","metka_marsh_provodnik_0") 
end

function remove_metka_marsh_provodnik()
	del_map_spot(server_object("boloto_provodnik").id,"crlc_big")
end

--' монстры на болотах
function marsh_many_monster()
	create("fracture_karlik",xyz(-220.359,0.839,232.703),32366,3378)
	create("fracture_karlik",xyz(-220.359,0.839,232.703),32366,3378)
	level.add_pp_effector ("blink.ppe", 234, false)
end

--' Удаляем трупы сталков с Болот
function delete_stalky_marsh()
	release("marsh_stalker_burer1")
	release("marsh_stalker_burer2")
	release("marsh_stalker_burer3")
end

--' убираем проводника, Пантеру с болот 
function delete_bol_provodnik()
	release("boloto_provodnik")
	release("marsh_pantera")
end

--' убираем Пилигрима с бара
function delete_pili_bar()
	release("piligrim_bar")
end

--' убираем Пантеру из Деревни
function delete_vill_pantera()
	release("village_pantera")
end

--' убираем мобильного торгаша с Агры
function delete_agro_mobil_torgash()
	local se_obj = server_object("agro_mobil_torgash")
	if se_obj then
		-- сначала прерываем диалог
		local obj = level_object(se_obj.id)
		if obj and obj:is_talking() then
			obj:stop_talk()
			db.actor:stop_talk()
		end
		-- затем удаляем
		timer("run", 0.2, "arhara_dialog.delete_agro_mobil_torgash2()")
	end
end
function delete_agro_mobil_torgash2()
	release("agro_mobil_torgash")
end

--' спавним пси-антенну на Кордоне
function x_ray_antenna_spawn()
	local obj = create("x_ray_antenna_fake",xyz(109.698,4.617,459.677),411976,223)
        netpacket:modify(obj, "mass", 1000, "fixed_bones", "link")
	map_spot(obj.id, "crlc_big", "metka_psi_antenna_0")
	got("af_spirit_3")
end

--' подменяем фейковую пси-антенну на настоящую
function x_ray_antenna_change()
	find_and_release("x_ray_antenna_fake")
	create("x_ray_antenna",xyz(109.698,4.617,459.677),411976,223)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("teleport.ppe", 2006, false)
level.add_pp_effector("snd_shock.ppe", 2008, false)
end

--' проверим наличие пси-антенны
function klenov_antena_have()
	return has("x_ray_antenna",1)
end

--' отдадим антенну Клёнову
function klenov_antena_done()
	find_and_release("x_ray_antenna")
end

--' пси-спавн на Кордоне рестриктором1
function spawn_psi_one_one()
	create("fracture_master",xyz(107.289,1.650,457.066),408582,223)
	create("fracture_master",xyz(108.022,1.703,456.664),409435,223)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("psi.ppe", 2008, false)
end
function spawn_psi_one_two()
	create("fire_chimera",xyz(106.582,1.580,458.101),407745,223)
	create("new_electro_chimera",xyz(105.914,1.565,457.573),406900,199)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("amk_shoot.ppe", 2011, false)
level.add_pp_effector("snd_shock.ppe", 2008, false) 
end
function spawn_psi_one_tri()
	create("pseudodog_normal",xyz(105.313,1.533,457.661),406045,199)
	create("pseudodog_big",xyz(106.582,1.580,458.101),407745,223)
	create("dog_habaruch",xyz(106.582,1.580,458.101),407745,223)
	create("dog_normal",xyz(107.289,1.650,457.066),408582,223)
	create("dog_habaruch",xyz(107.289,1.650,457.066),408582,223)
	create("dog_weak",xyz(107.289,1.650,457.066),408582,223)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("alcohol.ppe", 3000, false)
level.add_pp_effector("psi.ppe", 2008, false)
level.add_pp_effector("snd_shock.ppe", 2008, false)
end
function spawn_psi_one_four()
	create("psyonik",xyz(107.289,1.650,457.066),408582,223)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("alcohol.ppe", 3000, false)
end
function spawn_psi_one_five()
	create("nosales",xyz(105.914,1.565,457.573),406900,199)
	create("snork_nosach",xyz(105.914,1.565,457.573),406900,199)
	create("nosales",xyz(105.914,1.565,457.573),406900,199)
	create("snork_nosach",xyz(105.313,1.533,457.661),406045,199)
	create("nosales",xyz(105.313,1.533,457.661),406045,199)
	create("snork_nosach",xyz(105.313,1.533,457.661),406045,199)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("psychic.ppe", 2008, false)
level.add_pp_effector("snd_shock.ppe", 2008, false)
end
function spawn_psi_one_six()
	create("zombie_trup",xyz(105.313,1.533,457.661),406045,199)
	create("zombie_immortal",xyz(106.582,1.580,458.101),407745,223)
	create("zombie_beee",xyz(106.582,1.580,458.101),407745,223)
	create("zombie_babka_strong",xyz(106.582,1.580,458.101),407745,223)
	create("zombie_plague_komar",xyz(107.289,1.650,457.066),408582,223)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("teleport.ppe", 2006, false)
end
function spawn_psi_one_seven()
	create("bloodsucker_effector",xyz(107.289,1.650,457.066),408582,223)
	create("bloodsucker_effector",xyz(107.289,1.650,457.066),408582,223)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("amk_shoot.ppe", 2011, false)
level.add_pp_effector("psi.ppe", 2008, false)
level.add_pp_effector("alcohol.ppe", 3000, false) 
end

--' пси-спавн на Кордоне рестриктором2/Нет, теперь второй рестриктор просто отбрасывает от антенны
function spawn_psi_two_one()
	create("snork_normal",xyz(108.022,1.703,456.664),409435,223)
	create("snork_jumper",xyz(107.289,1.650,457.066),408582,223)
	create("snork_stronger",xyz(108.022,1.703,456.664),409435,223)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("psi.ppe", 2008, false)
level.add_pp_effector("amk_shoot.ppe", 2011, false)
end
function spawn_psi_two_two()
	create("kikimora",xyz(106.582,1.580,458.101),407745,223)
	create("kikimora",xyz(105.914,1.565,457.573),406900,199)
	create("kikimora",xyz(105.313,1.533,457.661),406045,199)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("amk_shoot.ppe", 2011, false)
level.add_pp_effector("snd_shock.ppe", 2008, false) 
end
function spawn_psi_two_tri()
timer("battle", 0, {"l01_escape", 56, 1})
	create("bibliotekar",xyz(105.313,1.533,457.661),406045,199)
	create("karlito",xyz(107.289,1.650,457.066),408582,223)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("alcohol.ppe", 3000, false) 
level.add_pp_effector("teleport.ppe", 2006, false)
level.add_pp_effector("snd_shock.ppe", 2008, false)
end

function spawn_psi_two_four()
local monsters={
"rat_weak",
"rat_normal",
"rat_strong",
"rat_plague",
"komar",
"fly_micro",
"fly_plague",
"bee_micro",
"tarakan_strong",
"tarakan_normal"
} 
	local ap = db.actor:position()
	local lv = db.actor:level_vertex_id()
	local gv = db.actor:game_vertex_id()
        for c=1,math.random(10,16) do
	create(table.random(monsters), xyz(ap.x+math.random(-15,15), ap.y, ap.z+math.random(-15,15)), lv, gv)
level.add_pp_effector ("blink.ppe", 234, false)
level.add_pp_effector("teleport.ppe", 2006, false)
level.add_pp_effector("snd_shock.ppe", 2008, false)
end
end

function to_limansk()
	if not has_info("black_doctor_finish_dialog") then
		sms("%c[sender]"..translate("name_sviblov")..":\\n%c[sms_red]"..translate("to_limansk_0_0"), nil, "sviblov", 20000, nil, [[sms\sviblov\to_limansk]])
	end
end

--' убираем 1 дес вертуху с Агры
function dell_arhara_desant_heli1()
	release("agr_arhara_desant_heli1")
end

--' убираем 2 дес вертуху с Агры
function dell_arhara_desant_heli2()
	release("agr_arhara_desant_heli2")
end

--' убираем вертуху торгаша с Агры
function dell_torgash_heli()
	release("agro_torgash_heli")
end

--' убираем 2 дес вертуху с Кордона
function dell_esc_desant_heli_2()
	release("esc_arhara_desant_heli_2")
end

--' убираем 1 дес вертуху с Кордона
function dell_esc_desant_heli_1()
	release("esc_arhara_desant_heli_1")
end

--' убираем 1 дес вертуху из деревни
function dell_village_heli1()
	release("lost_village_heli_1")
end

--' убираем 2 дес вертуху из деревни
function dell_village_heli2()
	release("lost_village_heli_2")
end

--' убираем Звездочёта из лагеря новисов
function dell_zvezd_novise()
	release("zvezd_after_warl")
end

--' спавним квестовые биомассы на хуторе
function spawn_quest_biomassa()
	local obj = create("quest_biomassa",xyz(-177.5,0.852,391.867),52699,3361)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-205.355,0.863,409.933),38896,3361)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-219.894,0.84,419.938),32728,3361)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-205.32,1.385,442.307),38927,3361)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-157.911,1.253,405.216),65923,3371)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-178.785,1.486,437.62),52271,3361)
	map_spot(obj.id, "green_location", "Biomass")
	local obj = create("quest_biomassa",xyz(-137.166,1.011,426.507),77640,3371)
	map_spot(obj.id, "green_location", "Biomass")
	sms("info_recieved_0", nil, nil, 10000)
end
function quest_biomassa_dead()
	local value = get_value("quest_biomassa_dead", 0)+1
	set_value("quest_biomassa_dead", value)
end

--' проверим убитые биомассы
function boloto_provod_vstrecha_have()
	local value = get_value("quest_biomassa_dead", 0)
	if value >= 7 then
		return true
	end
		return false
end

--' отправляем СМС Пантере
function boloto_provod_vstrecha_done()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_boloto_provod_vstrecha_done_0"), nil, "strelok", 25000, nil, [[sms\strelok\boloto_provod_vstrecha_done]])
	got("ammo_17x83",1)
	del_value("quest_biomassa_dead")
end	

function village_kap_pda1()
	sms("%c[sender]"..translate("name_vhodyaschee")..":\\n%c[sms_red]"..translate("village_kap_pda1_0_0"), nil, nil, 19000, nil, [[sms\net\village_kap_pda1]])
end

function village_kap_pda2()
	sms("%c[sender]"..translate("name_kapitan")..":\\n%c[sms_red]"..translate("village_kap_pda2_0_0"), nil, "filatov", 8000, nil, [[sms\pilot_verta\village_kap_pda2]])
end

function village_kap_pda3()
	sms("%c[sender]"..translate("name_vhodyaschee")..":\\n%c[sms_red]"..translate("village_kap_pda3_0_0"), nil, nil, 8000, nil, [[sms\sviblov\village_kap_pda3]])
end

--' отдадим ПДА Колмогору
function derevny_zashita_done(first_speaker, second_speaker)
	lost("kapitan_pda",1)
	got("wpn_s3000",1)
	got("ammo_40sw_hp",1)
	got("ammo_40sw_ap",1)
end

function delete_pereod_gen_bol()
	release(story_object(18100))
	release("gener_dok_stalk2")
	release("generators_black_dok")
end

--' проверим наличие 100000 для Земляка
function sto_shtuk(actor,npc)
    return actor:money() > 100000
end

--' отдадим 100000 Земляку
function zemlyk_take_money(t1,t2)
lost_money(100000)
end

--' проверим наличие 50000 для Земляка
function pytdesyt_shtuk(actor,npc)
    return actor:money() > 50000
end

--' отдадим 50000 Земляку
function zemlyk_take_pytdesyt(t1,t2)
lost_money(50000)
end

--' убираем квестовую вертуху с Генераторов
function dell_gen_heli_hit()
	release("generators_heli_hit")
end

--' спавним джойстик Андерсена
local anders_joystik={
    {position={x=77.743,y=37.345,z=-268.534},gv=3114,lv=428006},
    {position={x=20.606067657471,y=25.431090927124,z=-357.47396850586},gv=3108,lv=359821},
    {position={x=169.84191894531,y=28.01681098938,z=-210.60809326172},gv=3129,lv=533329},
    {position={x=77.765930175781,y=26.077334976196,z=-48.638679504395},gv=3120,lv=426644},
    {position={x=-37.93004989624,y=33.959664916992,z=-190.47549438477},gv=3106,lv=291208},
    {position={x=-154.287109375,y=34.242765045166,z=-393.30609130859},gv=3097,lv=157471}
}
function spawn_joystik()
	local a = table.random(anders_joystik)
	local obj = create("pult_anders", xyz(a.position.x,a.position.y,a.position.z), a.lv, a.gv)
	map_spot(obj.id, "green_location", "Joystick for Andersen")
	sms("info_recieved_0", nil, nil, 10000)
end

--' спавним немного артов на Генераторах
function spawn_generators_art1()
	create("af_spirit_1",xyz(20.610,34.871,-213.418),360023,3110)
	create("af_fireball",xyz(-68.352,23.909,-181.416),256639,3106)
	create("af_cristall",xyz(215.910,20.703,-358.402),585185,3141)
	create("af_armor_2",xyz(13.783,34.843,-270.739),352093,3109)
	create("af_fireball",xyz(14.385,23.251,-466.348),352666,3104)
	create("art_acumm",xyz(127.714,29.674,-562.987),483806,3128)
	timer("run", 2.0, "buusty_dialog.delete_zhivnost_alive()")
end

--' спавним ещё немного артов на Генераторах
function spawn_generators_art2()
	create("af_rusty_thorn",xyz(-65.445,30.138,-99.984),260558,3102)
	create("af_rusty_kristall",xyz(-204.705,29.777,-103.302),101471,3085)
	create("af_phantom",xyz(-204.805,29.777,-103.302),101471,3085)
	create("af_drops",xyz(-0.313,26.048,-400.088),335415,3108)
	create("art_acumm",xyz(249.126,18.879,-438.853),624290,3152)
	create("af_mincer_meat",xyz(74.540,30.205,-362.753),422955,3115)
	create("af_mincer_meat",xyz(19.410,35.915,-546.888),358722,3107)
end

--' заводим третий генератор
function generator3_vkl()
	create("imitator",xyz(-36.434,45.577,-257.662),295045,3105)
	create("imitator",xyz(-36.434,45.577,-257.662),295045,3105)
	create("imitator",xyz(-36.807,45.471,-257.168),291121,3105)
	create("imitator",xyz(-36.807,45.471,-257.168),291121,3105)
	create("imitator",xyz(-32.598,40.993,-255.071),296678,3105)
	create("imitator",xyz(-33.763,40.597,-260.812),295852,3105)
	create("imitator",xyz(-39.815,39.999,-258.828),291121,3105)
	create("imitator",xyz(-36.467,44.480,-254.494),291121,3105)
	create("imitator",xyz(-36.467,44.480,-254.494),291121,3105)
end

--' убираем Звездочёта с Генераторов
function dell_zvezd_generators()
	release("generators_zvezdochet")
	enabl_weapon()
	disable_info("actor_cant_move")
end

--' заспавним пёсиков на пути Удава на болотах
function spawn_dog_udav_boloto()
	create("dog_weak",xyz(-200.920,4.329,522.086),115055,3393)
	create("dog_weak",xyz(-200.920,4.329,522.086),115055,3393)
	create("dog_habaruch",xyz(-200.920,4.329,522.086),115055,3393)
	create("dog_habaruch",xyz(-200.920,4.329,522.086),115055,3393)
	create("pseudodog_weak",xyz(-200.920,4.329,522.086),115055,3393)
	create("pseudodog_weak",xyz(-200.920,4.329,522.086),115055,3393)
end

function marsh_atakker_bandit_dead()
	local value = get_value("marsh_atakker_bandit_dead", 0)+1
	set_value("marsh_atakker_bandit_dead", value)
end

function defend_udav_have()
	if get_value("marsh_atakker_bandit_dead", 0) >= 8 then
		give_info("vse_banditu_death")
		return true
     end
		return false
end

--' убираем Боцмана с болот
function dell_udav_bolota()
	del_value("marsh_atakker_bandit_dead")
	release("marsh_udav")
end

--' убираем вертуху с болот при смерти Боцмана
function dell_marsh_heli_dok()
	release("marsh_heli_dok")
end

--' убираем вертуху с дока с генераторов
function dell_generators_heli_dok()
	release("generators_heli_dok")
end

--' убираем переход болото-генераторы
function delete_pereod_bolota_gen()
	release(story_object(18101))
end

--' проверим наличие джойстика
function ander_joystik_say_have() 
	return has("pult_anders",1)
end

function metka_gener_udav()
local obj = server_object("generators_udav")
if obj then level_map_spot(obj.id, "blue_location", "spot_botsman")
 end
end

function remove_metka_gener_udav()
local obj = server_object("generators_udav")
if obj then del_map_spot(obj.id, "blue_location", "spot_botsman")
 end
end

--' отдадим джойстик Боцману
function joystik_otdal()
	lost("pult_anders",1)
end

--' убираем Фрица с Генераторов
function dell_frits()
	release("frits")
end

--' убираем Фрица2 с Генераторов
function delete_frits2()
	release("gener_frits2")
end

--' убираем охрану Андерсена 
function delete_ohrana_ander()
	release("gener_dok_stalk1")
	release("gener_dok_stalk3")
end

--' убираем Сапсана с генеров
function del_gen_komandir()
	release("gener_desant_black_komandir")
end

--' убираем тело Пантеры и Дока 
function delete_pebyta_after_proval()
	release("gener_bl_doktor1")
	release("generators_pantera_dead")
end

--' заспавним ключ от секретки НЗ
function kluch_teleport2_spawn()
	if not has_info("generators_code_door_unlocked_spawn") then
			create("kluch_dell_teleport2",xyz(172.326,29.329,-492.119),535422,3152)
			create("af_arhara_globus",xyz(172.326,29.329,-492.119),535422,3152)
			create("pseudodog_weak",xyz(172.366,28.740,-493.136),535420,3152)
			create("dog_habaruch",xyz(172.366,28.740,-493.136),535420,3152)
			create("pseudodog_weak",xyz(162.445,22.799,-500.679),523880,3152)
			create("pseudodog_big",xyz(162.445,22.799,-500.679),523880,3152)
			create("dog_weak",xyz(162.445,22.799,-500.679),523880,3152)
			create("dog_normal",xyz(162.445,22.799,-500.679),523880,3152)
			create("bloodsucker_effector",xyz(152.704,17.637,-500.195),512486,3152)
		give_info("generators_code_door_unlocked_spawn")
	end
end

--' убираем Боцмана с Генераторов 
function delete_botsman_gener()
	release("generators_udav")
end

--' Получим блокнот Пантеры от Призрака
function take_bloknot_pantera(first_speaker, second_speaker)
	got("bloknot_pantera")
end

--' заспавним арт и досье Звездочёта
function dosye_zvez_spawn()
	create("dosye_zvez",xyz(87.017,24.595,-15.456),437960,3119)
	create("af_spirit_3",xyz(86.514,24.580,-15.479),437960,3119)
	create("lican",xyz(90.968,25.641,-61.678),442584,3121)
	create("lican",xyz(46.080,23.543,-23.047),390432,3119)
end

--' спавним зомбаков на генераторах у деревни
function gener_spawn_zombaki()
	create("zombie_babka_weak",xyz(-127.703,43.418,-549.804),187271,3093)
	create("zombie_strong",xyz(-127.703,43.418,-549.804),187271,3093)
	create("zombie_trup",xyz(-127.703,43.418,-549.804),187271,3093)
	create("zombie_babka_normal",xyz(-130.494,43.038,-543.485),192838,3093)
	create("zombie_hell2",xyz(-130.494,43.038,-543.485),192838,3093)
	create("zombie_hell4",xyz(-130.494,43.038,-543.485),192838,3093)
	create("zombie_babka_strong",xyz(-121.858,42.962,-546.894),195197,3093)
	create("zombie_hell5",xyz(-121.857,42.962,-546.894),195197,3093)
	create("zombie_hell6",xyz(-121.859,42.962,-546.894),195197,3093)
end

--' убираем Клыка с Бара
function delete_kluk_bar()
	release("kluk_bar")
end

--' отдадим досье Клыку
function dosye_zvez_otdal(first_speaker, second_speaker)
	lost("dosye_zvez",1)
end

--' заспавним кошек на пути Клыка
function spawn_koshki_nz()
	create("cat_strong",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_strong",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_normal",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_normal",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_normal",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_normal",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_normal",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_strong",xyz(-9.490,-25.435,-169.116),849983,2897)
	create("cat_strong",xyz(-9.490,-25.435,-169.116),849983,2897)
end

--' убираем Пантеру и Звездочёта с НЗ 
function delete_aver_vragi()
	release("aver_zvezdochet2")
	release("aver_pantera_new")
end

--' спавним записку пилота на чаэс2
function spawn_chaes_pilot_zapiska()
local se_obj = create("pilot_zapiska", xyz(243.750,20.599,151.565),78081,2573)
local se_obj = create("samopisez", xyz(152.873,70.873,121.853),69353,2573)
local se_obj = create("m_inventory_box30", xyz(251.823,11.379,175.369),88107,2577)
end

--' убираем Призрака с ЧАЭС1
function dell_chaes1_prizrak()
	release("chaes1_prizrak")
end

--' убираем Призрака со Стройплощадки
function dell_new_prizrak()
find_and_release("forg_new_prizrak")
end

--' получим арты от Клёнова
function polt_art_done(first_speaker, second_speaker)
	got("af_part_monolit1")
	got("af_spiral")
end

--' проверим самописца
function voronin_samopisez_have()
	return has("samopisez",1)
  end

--' отдадим самописец Воронину
function voronin_samopisez_done(first_speaker, second_speaker)
	lost("samopisez",1)
	got("wpn_mp5a3_10")
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_voronin_samopisez_done_0"), nil, "strelok", 20000, nil, [[sms\strelok\voronin_samopisez_done]])
end

--' убираем вертуху Пантеры с авера
function dell_pantera_vertuha_aver()
	release("pantera_vertuha_aver")
end

--' убираем вертуху Отшельника с авера
function dell_aver_arhara_heli_1()
	release("aver_arhara_heli_1")
end

--' убираем военных с генер. вертолёта с НЗ 
function dell_muziki_aver()
	release("soprov_muha_soldat1")
	release("soprov_muha_soldat2")
end

--' убираем Муху с НЗ 
function dell_devchonka()
	release("devchonka")
end

--' получим фото от раненого
function dal_foto(first_speaker, second_speaker)
	got("foto_aver_zvezd")
	got("foto_aver_mono")
end

--' убираем тело Мухи и раненого с авера 
function dell_muha_die_aver()
	release("muha_soldat_ranen")
	release("muha_die")
end

--' спавним ящик с верта военных на авере
function spawn_general_prezent()
	if not has_info("spawn_general_prezent_info") then
		local obj = create("m_inventory_box31", xyz(-320.174,-8.726,21.975),320365,2889)
		map_spot(obj.id, "treasure", "Military Present")
		give_info("spawn_general_prezent_info")
	end
end

--' заспавним зомби на авере
function aver_spawn_zombiki()
	create("zombie_babka_weak",xyz(51.951,-13.962,-185.843),958151,2908)
	create("zombie_babka_normal",xyz(51.951,-13.962,-185.843),958151,2908)
	create("zombie_strong",xyz(51.951,-13.962,-185.843),958151,2908)
	create("zombie_trup",xyz(51.951,-13.962,-185.843),958151,2908)
	create("zombie_blow",xyz(51.951,-13.962,-185.843),958151,2908)
	create("zombie_hell7",xyz(51.9511,-13.962,-185.843),958151,2908)
	create("zombie_hell6",xyz(51.9512,-13.962,-185.843),958151,2908)
	create("zombie_babka_strong",xyz(51.9513,-13.962,-185.843),958151,2908)
	create("zombie_weak",xyz(51.9514,-13.962,-185.843),958151,2908)
	create("zombie_normal",xyz(51.9515,-13.962,-185.843),958151,2908)
	create("zombie_hell1",xyz(51.9516,-13.962,-185.843),958151,2908)
	create("zombie_hell2",xyz(51.9517,-13.962,-185.843),958151,2908)
	create("zombie_hell3",xyz(51.9518,-13.962,-185.843),958151,2908)
	create("zombie_trup",xyz(51.9519,-13.962,-185.843),958151,2908)
	create("zombie_hell5",xyz(51.95199,-13.962,-185.843),958151,2908)
	create("zombie_hell",xyz(51.95199,-13.962,-185.843),958151,2908)
	create("zombie_hell15",xyz(51.95199,-13.962,-185.843),958151,2908)
	create("zombie_hell15",xyz(51.95199,-13.962,-185.843),958151,2908)
end

--' убираем учёных с генераторов 
function dell_lomonosov()
local se_obj = server_object("solvador")
  if se_obj then
    release(se_obj, true)
  end 
local se_obj = server_object("andersen")
  if se_obj then
    release(se_obj, true)
  end
end

--' заспавним вороний глаз
function gener_spawn_eye_voron()
	create("af_eye_voron",xyz(184.070,28.537,-565.312),548909,3137)
	create("af_eye_voron",xyz(195.765,35.845,-573.473),562425,3152)
	local obj = create("m_inventory_box32",xyz(190.773,35.842,-574.642),556868,3152)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
	create("mini_antenna1",xyz(189.175,28.536,-566.536),554518,3137)
	create("mini_antenna2",xyz(195.494,28.630,-555.928),563238,3143)
	create("mini_antenna3",xyz(203.440,28.548,-565.897),571113,3143)
	create("mini_antenna4",xyz(189.671,28.536,-572.527),555297,3137)
	create("mini_antenna5",xyz(182.885,35.841,-562.001),547286,3152)
end

--' отключаем аномалии на генераторах
local zone_strory_id={
	["mini_antenna1"]=18104,
	["mini_antenna2"]=18105,
	["mini_antenna3"]=18106,
	["mini_antenna4"]=18107,	
	["mini_antenna5"]=18108
}

function delete_gen_zone_emi(object)
	local story_id=zone_strory_id[object:section()]
	if story_id then
		release(story_object(story_id))
		sms("delete_gen_zone_emi1_0", nil, nil, 20000)
	else
		log("! ERROR invalid object for delete_gen_zone_emi() call!!!")
	end
end

--' заспавним мнимый телепорт на генераторах
function spawn_psevdotele()
local obj = create("imitator_tele_final1",xyz(179.736,31.259,-454.935),544230,3133)
end

--' убираем Сапсана, свободовца и через таймер псевдотелепорт
function gen_dell_tele_sapsan()
--	release("imitator_tele_final1")
	release("gen_sapsan1")
	release("gen_svoboda_parlamenter")
	timer("run", 1.0, "arhara_dialog.imitat_tele_final1_dell()")
end


--' проверим наличие генераторов помех
function solvador_say_have() 
	return has("mini_antenna1",1) and
has("mini_antenna2",1) and
has("mini_antenna3",1) and
has("mini_antenna4",1) and
has("mini_antenna5",1)
end

--' отдадим это барахло Сольвадору
function solvador_say_done(first_speaker, second_speaker)
	lost("mini_antenna1",1)
	lost("mini_antenna2",1)
	lost("mini_antenna3",1)
	lost("mini_antenna4",1)
	lost("mini_antenna5",1)
end

--' убираем копии учёных с Генераторов 
function dell_uchen_gen_povtorno()
local se_obj = server_object("solvador")
  if se_obj then
    release(se_obj, true)
  end 
local se_obj = server_object("andersen")
  if se_obj then
    release(se_obj, true)
  end
local se_obj = server_object("gen_solvador1")
  if se_obj then
    release(se_obj, true)
  end 
local se_obj = server_object("gen_andersen1")
  if se_obj then
    release(se_obj, true)
  end
end

--' убираем Андерсена1 с генеров 
function dell_uchen_andersen1()
release(story_object(9995))
end

--' убираем Андерсена из подвала с генеров 
function dell_uchen_andersen()
local se_obj = server_object("andersen")
  if se_obj then
    release(se_obj, true)
  end
end

--' убираем Сольвадора1 с генеров 
function dell_uchen_solvador1()
release(story_object(9996))
end

--' заспавним парочку гигантов у шлагбаума
function gen_shlag_gigantu()
	create("gigant_red_strong",xyz(71.960,26.516,-96.341),420846,3120)
	create("gigant_strong",xyz(71.960,26.516,-96.341),420846,3120)
end

--' убираем второго Клыка с авера
function dell_new_kluk_nz()
	release("new_kluk_nz")
end

function set_kluk_chaes2()
	map_spot(server_object("kluk_chaes2").id,"crlc_big","set_kluk_chaes2_0") 
end

function remove_kluk_chaes2_metka()
	del_map_spot(server_object("kluk_chaes2").id,"crlc_big")
end

function priz_pamt_sms1()
	sms("%c[sender]"..translate("name_strelok")..":\\n%c[sms_red]"..translate("sms_strelok_priz_pamt_sms1_0"), nil, "strelok", 30000, nil, [[sms\strelok\priz_pamt_sms1]])
end

--' получим фото от Клыка на ЧАЭС2
function dal_chaes2_karta(first_speaker, second_speaker)
	got("chaes2_karta_kluk")
end

--' убираем Клыка с чаэс2 а заодно и Пантеру с генераторов
function dell_kluk_chaes2()
	release("kluk_chaes2")
	release("gen_pantera_life")
	release("chaes2_arhara_beter1")
end

--' заспавним бочки на чаэс2
function chaes2_expl_barrel()
	local obj = create("explosive_barrel",xyz(306.773,-0.101,229.625),104912,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
	local obj = create("explosive_barrel",xyz(306.687,-0.1,228.552),104912,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
	local obj = create("explosive_bomba",xyz(305.845,-0.1,229.209),104793,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
	local obj = create("explosive_mobiltank",xyz(304.172,-0.1,229.114),104557,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
	local obj = create("explosive_mobiltank",xyz(304.888,-0.1,228.517),104675,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
	local obj = create("explosive_mobiltank",xyz(304.786,-0.1,230.021),104557,2590)
	ai:set_switch_online(obj.id, true)
	ai:set_switch_offline(obj.id, false)
end

--' заспавним монолитовцев на трубе/нет, уберём, ибо, залазят внутрь трубы и оттуда стреляют, поставим всего лишь две турельки.
function mono_chaes2_truba_1()
--	create("sar_monolith_respawn",xyz(549.876770019531,80.1041946411133,202.959167480469),171515,2628)
--	create("sar_monolith_respawn",xyz(554.652709960938,80.102424621582,207.067840576172),171515,2628)
--	create("tank_spawn_zasada",xyz(554.652809960938,80.102424621582,207.067840576172),171515,2628)
	create_car("auto_turret_2",xyz(554.652809960938,80.102424621582,207.067840576172),171515,2628, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(549.84,80.10,201.50),171515,2628, "scripts\\technics\\turret.ltx")
end
function mono_chaes2_truba_2()
--	create("sar_monolith_respawn",xyz(558.519775390625,112.811256408691,199.679763793945),171515,2628)
--	create("tank_spawn_zasada5",xyz(558.519785390625,112.811256408691,199.679763793945),171515,2628)
--	create("sar_monolith_respawn",xyz(550.940307617188,112.814964294434,199.753204345703),171515,2628)
--	create("sar_monolith_respawn",xyz(550.940307617188,112.814964294434,199.753204345703),171515,2628)
	create_car("auto_turret_2",xyz(553.22,112.81,197.69),171515,2628, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(550.24,112.81,201.64),171515,2628, "scripts\\technics\\turret.ltx")
end

--' Оживим Муху
function otsek_ozivlenie()
local obj = create("imitator",xyz(-94.531,28.299,566.873),1087,3038)
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("snd_shock.ppe", 2008, false)
end

--' убираем труп Мухи из Госпиталя 
function dell_hospital_muha_trup()
	release("hospital_muha_trup")
end

--' заспавним живую капсулу Пузыря у ЧД для варки КУ
function sp_live_kapsula()
--	create("caps_buzz_average",xyz(-95.578,32.454,614.056),868,3038)
--	create("caps_buzz_average",xyz(-95.447,32.558,615.379),1026,3038)
--	create("caps_buzz_average",xyz(-95.606,32.499,614.533),869,3038)
	create("zone_sphere",xyz(-95.19,32.499,614.51),1025,3038)
		timer("run", 0.1, "buusty_dialog.delete_zhivnost_alive()")
end
--' заспавним живую капсулу Киселя у Мухи для её оживления и получения Компаса
function muha_kapsula()
	create("caps_buzz_average",xyz(-95.816,28.425,567.057),843,3038)
end

--' варим Камень Удачи
function otsek_varka_kamen()
level.add_pp_effector ("blink.ppe", 234, false) 
level.add_pp_effector("snd_shock.ppe", 2008, false)
level.add_pp_effector("teleport.ppe", 2006, false)
end

--' подмена артов в госпитале
function hosp_podmena()
	lost("af_part_monolit1",1)
	lost("af_water_flower",1)
end
function hosp_taik_new_art(first_speaker, second_speaker) 
	got("af_part_monolit2")
	got("af_water_flower1")
	sms("%c[sender]"..translate("name_poluchena_informatsiya")..":\\n%c[sms_red]"..translate("sms_net_hosp_taik_new_art_0"), nil, "nano", 7000, nil, [[sms\net\hosp_taik_new_art]])
end

--' убираем голограмму ЧД 
function dell_hospital_bl_dok()
	release("hospital_bl_dok")
end

--' проверим наличие артов для ЧД
function artu_chd() 
	return has("af_water_flower1",1) and has("af_part_monolit2",1)
end

--' убираем отца и Пантеру
function dell_otez_and_pant()
	release("hosp_father")
	release("hospital_pantera_girl")
end

--' Получим кредитку от ЧД и отдадим Сердце Полтергейста
function chd_dal_kreditku(first_speaker, second_speaker)
	lost("af_part_monolit2",1)
	got("kreditka")
end

--' Получим кредитку от ЧД и отдадим Камень Удачи
function chd_otdat_kamen(first_speaker, second_speaker)
	lost("af_kamen_udachy",1)
	got("kreditka")
end

--' проверим наличие Камня удачи
function af_kamen_est()
	return has("af_kamen_udachy",1)
  end

--' убираем Седого с атп 
function atp_sedoy_dell()
	local se_obj = server_object("atp_mobil_torgovetz")
	if se_obj then
		-- сначала прерываем диалог
		local obj = level_object(se_obj.id)
		if obj and obj:is_talking() then
			obj:stop_talk()
			db.actor:stop_talk()
		end
		-- затем удаляем
		timer("run", 0.2, "arhara_dialog.atp_sedoy_dell2()")
	end
end
function atp_sedoy_dell2()
	release("atp_mobil_torgovetz")
end

--' убираем вертуху Седого с атп
function atp_sedoy_heli_dell()
	release("atp_sedoy_heli")
end

--' заспавним имитатор перех. агро-болото
function agro_boloto_imitator()
	create("imitator_shar",xyz(-212.539,2.577,-293.192),23764,688)
end

--' заспавним имитатор перех. кордон-болото
function kopdon_boloto_imitator()
	create("imitator_shar",xyz(-247.803,-17.371,-204.223),10936,41)
end

--' убираём карту разведчика
function razved_karta_dell()
	release("razved_karta")
end

--' убираем дока с Припяти 
function prip_dok_arh_dell()
	release("prip_dok_arh")
end

--' заспавним имитатор финал Архара
function sp_imit_tele_final1()
	create("imitator_tele_final1",xyz(249.512,3.124,-257.802),426110,702)
	create("imitator_tele_final1",xyz(249.448,3.155,-257.985),426110,702)
	create("imitator_tele_final1",xyz(243.007,3.940,-245.595),424772,702)
	create("imitator_tele_final1",xyz(242.601,3.811,-245.950),424772,702)
end

--' спавним телепорт выхода ГГ с финала 
function spawn_teleport_final_vorota()
local se_obj = create("m_teleport_final_vorota",xyz(193.4518737793,3.6606612205505,-247.07885742188),404687,692)
end

--' убираем имитаторы телеп финала
function imitat_tele_final1_dell()
for a=1,65534,1 do
local obj=server_object(a)
if obj and string.find(obj:name(),"imitator_tele_final1") then
release(obj,true)
end
end
end

--' убираем 2финальную вертуху с Агры
function dell_agro_final_heli2()
	release("agro_final_vert2")
end

--' убираем 1финальную вертуху с Агры
function dell_agro_final_heli1()
	release("agro_final_vert1")
end

--' убираем пассажиров 1 финальной вертухи
function delete_ludi_vert1()
	release("kapitan_agro")
	release("kuzhetsov")
	release("final_barman")
	release("final_saharov")
	release("final_klenov")
	release("final_voronin")
	release("final_petrenko")
	release("final_dan")
	release("final_borov")
end

--' убираем пассажиров 2 финальной вертухи
function delete_ludi_vert2()
	release("final_shade_mono")
	release("final_shaxter")
	release("final_otshelnik")
	release("final_akim")
	release("final_holod")
	release("final_chimaera")
	release("final_kolmogor")
	release("final_ara")
	release("final_lukash")
	release("final_krot")
end

--' убираем группу стрелка
function delete_gpuppa()
	release("final_prizrak")
	release("final_dok_arh")
	release("final_piligrim")
	release("final_muxa")
end

--' убираем финального Архару 
function final_arhara_dell()
	release("final_arhara")
end

--' убираем финального Клыка 
function dell_kluk_final()
	release("final_kluk")
end

--' заспавним имитатор финал группы
function sp_imit_tele2_final2()
	create("imitator_tele_final1",xyz(265.387,5.630,-246.141),431101,702)
	create("imitator_tele_final1",xyz(265.532,5.796,-245.531),431102,702)
end

--' убираем Призрака
function delete_final_prizrak()
	release("final_prizrak")
end

--' убираем дока
function delete_final_dok_arh()
	release("final_dok_arh")
end

--' убираем Пили
function delete_final_piligrim()
	release("final_piligrim")
end
---------------------------------------------------------------------------------------------------------
local tabl_art_v_buliz = { 
    ["af_armor_1"] = 0.4,
    ["af_armor_2"] = 0.3,
    ["af_armor_3"] = 0.2,
    ["af_armor_4"] = 0.1,
    ["af_babka_1"] = 0.4,
    ["af_babka_2"] = 0.3,
    ["af_babka_3"] = 0.2,
    ["af_babka_4"] = 0.1,
    ["af_cry_1"] = 0.4,
    ["af_cry_2"] = 0.2,
    ["af_cry_3"] = 0.1,
    ["af_dik_1"] = 0.4,
    ["af_dik_2"] = 0.3,
    ["af_dik_3"] = 0.2,
    ["af_dik_4"] = 0.1,
    ["af_kol_1"] = 0.4,
    ["af_kol_2"] = 0.3,
    ["af_kol_3"] = 0.2,
    ["af_kol_4"] = 0.1,
    ["af_pudd_1"] = 0.4,
    ["af_pudd_2"] = 0.3,
    ["af_pudd_3"] = 0.2,  
    ["af_pudd_4"] = 0.1,
    ["af_simbion"] = 0.3,
    ["af_spirit_1"] = 0.4,
    ["af_spirit_2"] = 0.3,
    ["af_spirit_3"] = 0.2,
    ["af_spirit_4"] = 0.1,
    ["af_caterpillar"] = 0.25,
    ["af_eye_voron"] = 0.2,
    ["af_night_star"] = 0.25,
    ["af_gold_fish"] = 0.3,
    ["af_cristall"] = 0.3,
    ["af_soul"] = 0.35,
    ["af_electra_moonlight"] = 0.3,
    ["af_ameba_mica"] = 0.3,
    ["af_dummy_spring"] = 0.25,
    ["af_dummy_spring_red"] = 0.15,
    ["af_dummy_pellicle"] = 0.3,
    ["af_dummy_pellicle_red"] = 0.15,
    ["af_dummy_battery"] = 0.25,
    ["af_dummy_battery_red"] = 0.15,
    ["af_dummy_dummy"] = 0.25,
    ["af_dummy_glassbeads"] = 0.3,
    ["af_rusty_sea-urchin"] = 0.3,
    ["af_fuzz_kolobok"] = 0.3,
    ["af_medusa_green"] = 0.1,
    ["af_vyvert_green"] = 0.1,
    ["af_blood_green"] = 0.1,
    ["af_mincer_meat"] = 0.1,
    ["af_gold_mincer_meat"] = 0.1,
    ["af_cristall_flower"] = 0.2,
    ["af_gravi"] = 0.2,
    ["af_fireball"] = 0.2,
    ["af_electra_flash"] = 0.2,
    ["af_ameba_slug"] = 0.2,
    ["af_rusty_kristall"] = 0.2,
    ["af_electro_crystal_thorn"] = 0.05,
    ["af_teleport"] = 0.05
}

function get_tabl_art_v_buliz()
	return tabl_art_v_buliz
end

--' арты пришли в негодность
function radar_udalyem_art()
	prepare_degen(0.03,true)
end

--' арты пришли в негодность из-за радиации
function virogdenye_radiation_art()
	prepare_degen(0.08,false)
end

function prepare_degen(probability,is_deffered)
	if math.random() > probability then
		return
	end
	if is_deffered then
		if not Timer:has("degen_arts_names") then
			Timer:start_game("degen_arts_names",0,0,math.random(40,100),"arhara_dialog.prepare_degen_after_time()")
		end
		return
	end
	prepare_degen_after_time()
end

function prepare_degen_after_time()
	local degenerate_arts={}
	local degen_pre_count=math.random(1,2)
	local degen_cur_count=0
	db.actor:iterate_inventory_simple(function(item)
		if item:is_artefact() then
			local dga=tabl_art_v_buliz[item:section()]
			if dga~=nil and math.random() < dga and degen_cur_count<degen_pre_count then
				table.insert(degenerate_arts,item)
				degen_cur_count=degen_cur_count+1
			end
		end
	end)
	if degen_cur_count > 0 then
		for _,art in ipairs(degenerate_arts) do 
			if art then
				news_manager.relocate_item("out", art:section(), 1)
				release(art)
			end
		end
		got("af_buliz",degen_cur_count)
		archievements.acv_count_event("acv_buliz", 25, "acv_buliz")
		art_negoden_sms()
	else
		if not Timer:has("degen_arts_names") then
			Timer:start_game("degen_arts_names",0,0,math.random(20,40),"arhara_dialog.prepare_degen_after_time()")
		end
	end	
end

------------------------------------------------------------------------------------------------------------------
--' пьём водку
function xrypnem_sto_gramm()
level.add_pp_effector("alcohol.ppe", 3000, false)
end
---------------------------------------------------------------------------------------------------------
local tabl_laba_v_buliz = { 
    ["af_armor_1"] = 0.0001,
    ["af_armor_2"] = 0.0001,
    ["af_armor_3"] = 0.0001,
    ["af_armor_4"] = 0.0001,
    ["af_babka_1"] = 0.0001,
    ["af_babka_2"] = 0.0001,
    ["af_babka_3"] = 0.0001,
    ["af_cry_1"] = 0.0001,
    ["af_cry_2"] = 0.0001,
    ["af_cry_3"] = 0.0001,
    ["af_dik_1"] = 0.0001,
    ["af_dik_2"] = 0.0001,
    ["af_dik_3"] = 0.0001,
    ["af_dik_4"] = 0.0001,
    ["af_kol_1"] = 0.0001,
    ["af_kol_2"] = 0.0001,
    ["af_kol_3"] = 0.0001,
    ["af_kol_4"] = 0.0001,
    ["af_pudd_1"] = 0.0001,
    ["af_pudd_2"] = 0.0001,
    ["af_pudd_3"] = 0.0001,  
    ["af_pudd_4"] = 0.0001,
    ["af_simbion"] = 0.0001,
    ["af_spirit_1"] = 0.0001,
    ["af_spirit_2"] = 0.0001,
    ["af_spirit_3"] = 0.0001,
    ["af_spirit_4"] = 0.0001,
    ["af_caterpillar"] = 0.0001,
    ["af_vyvert_green"] = 0.0001,
    ["af_blood_green"] = 0.0001,
    ["af_medusa_green"] = 0.0001,
    ["af_night_star"] = 0.0001,
    ["af_gold_fish"] = 0.0001,
    ["af_cristall"] = 0.0001,
    ["af_soul"] = 0.0001,
    ["af_electra_moonlight"] = 0.0001,
    ["af_ameba_mica"] = 0.0001,
    ["af_dummy_spring"] = 0.0001,
    ["af_dummy_spring_red"] = 0.0001,
    ["af_dummy_pellicle"] = 0.0001,
    ["af_dummy_pellicle_red"] = 0.0001,
    ["af_dummy_battery"] = 0.0001,
    ["af_dummy_battery_red"] = 0.0001,
    ["af_dummy_dummy"] = 0.0001,
    ["af_dummy_glassbeads"] = 0.0001,
    ["af_rusty_sea-urchin"] = 0.0001,
    ["af_fuzz_kolobok"] = 0.0001,
    ["af_mincer_meat"] = 0.0001,
    ["af_gold_mincer_meat"] = 0.0001,
    ["af_cristall_flower"] = 0.0001,
    ["af_gravi"] = 0.0001,
    ["af_fireball"] = 0.0001,
    ["af_electra_flash"] = 0.0001,
    ["af_ameba_slug"] = 0.0001,
    ["af_rusty_kristall"] = 0.0001,
    ["af_electro_crystal_thorn"] = 0.0001,
    ["af_teleport"] = 0.0001,
    ["af_dummy_quill"] = 0.0001,
    ["af_power"] = 0.0001,
    ["af_dummy_node"] = 0.0001,
    ["af_dummy_bezi"] = 0.0001,
    ["af_repei"] = 0.0001,
    ["af_power_1"] = 0.0001,
    ["af_dummy_wool"] = 0.0001
 }
local laba_v_buliz_virogdeno_count = 0 -- количество вырожденных артефактов

--' х18 арты пришли в негодность
function laba_dell_art()
    laba_v_buliz_virogdeno_count = 0
    for a,v in pairs(tabl_laba_v_buliz) do
        --если вероятность вырождения "сработала"
        if math.random() < v then
            --а сколько у ГГ этих артов то ?
            aCount = 0
            db.actor:iterate_inventory(function (dummy, vItem)
                if vItem:section() == a then
                    aCount = aCount + 1 
                end 
            end, nil)
              --есть такие арты
            if aCount >= 1 then 
                lost(a, 1)
                laba_v_buliz_virogdeno_count = laba_v_buliz_virogdeno_count + 1
            end
        end
    end
end
--' получим  булыжники
function laba_bul(first_speaker, second_speaker) 
    for i=1,laba_v_buliz_virogdeno_count,1 do
        got("af_buliz")
    end
end
------------------------------------------------------------------------------------------------------------------
local tabl_laba_v_spiral = { 
    ["af_armor_1"] = 1,    
    ["af_cry_1"] = 1,    
    ["af_dik_1"] = 1,    
    ["af_kol_1"] = 1,    
    ["af_pudd_1"] = 1,    
    ["af_spirit_1"] = 1,    
    ["af_caterpillar"] = 1 
 }
local laba_v_spiral_virogdeno_count = 0 -- количество вырожденных артефактов

--' замена артов в Х-10
function laba_del_artu()
    laba_v_spiral_virogdeno_count = 0
    for a,v in pairs(tabl_laba_v_spiral) do
        --если вероятность вырождения "сработала"
        if math.random() < v then
            --а сколько у ГГ этих артов то ?
            aCount = 0
            db.actor:iterate_inventory(function (dummy, vItem)
                if vItem:section() == a then
                    aCount = aCount + 1 
                end 
            end, nil)
              --есть такие арты
            if aCount >= 1 then 
                lost(a, 1)
                laba_v_spiral_virogdeno_count = laba_v_spiral_virogdeno_count + 1
            end
        end
    end
end
--' получим спиральки
function laba_spir(first_speaker, second_speaker) 
    for i=1,laba_v_spiral_virogdeno_count,1 do
        got("af_spiral")
    end
end
------------------------------------------------------------------------------------------------------------------
local tabl_forest_v_izom = { 
    ["ammo_12x76_zhekan"] = 1
 }
local forest_v_izom_virogdeno_count = 0 

--' замена патронов в кр. лесу
function forest_del_pistonu()
    forest_v_izom_virogdeno_count = 0
    for a,v in pairs(tabl_forest_v_izom) do
        if math.random() < v then
            db.actor:iterate_inventory(function (actor, vItem)
                if vItem:section() == a then
                    release(vItem:id())
                    forest_v_izom_virogdeno_count = forest_v_izom_virogdeno_count + 1
                end 
            end, db.actor)
        end
    end
end
--' получим изоморфные пистоны
function forest_izom_est(first_speaker, second_speaker) 
    for i=1,forest_v_izom_virogdeno_count,1 do
        got("ammo_zhekan_izomorf")
    end
end
--' получим псевдоизоморф кристалл
function psevdokristall_have(first_speaker, second_speaker)
	got("psevdokristall")
end
--' убираем псевдоизоморф кристалл
--function dell_psevdokristall()
--lost("psevdokristall",1)
--end
------------------------------------------------------------------------------------------------------------------
local tabl_mozg_v_izom = { 
    ["preplastilin"] = 1
 }
local mozg_v_izom_virogdeno_count = 0 

--' замена препластилина
function mozg_del_preplastilin()
    forest_v_izom_virogdeno_count = 0
    for a,v in pairs(tabl_mozg_v_izom) do
        if math.random() < v then
            db.actor:iterate_inventory(function (actor, vItem)
                if vItem:section() == a then
                    release(vItem:id())
                    mozg_v_izom_virogdeno_count = mozg_v_izom_virogdeno_count + 1
                end 
            end, db.actor)
        end
    end
end
--' получим пластилин
function mozg_plastilin_est(first_speaker, second_speaker) 
    for i=1,mozg_v_izom_virogdeno_count,1 do
        got("izomorf_plastilin")
    end
end
--- Переход в МГ ----------------------------------------------------------------------------
function oruzhie_delet()
	local ignore_items={
		["device_torch"]=true,
		["device_pda"]=true,
		["bolt"]=true,
		["hand_radio"]= true,
		["val_zapis_52"]= true
	}
	local se_box = server_object('lima_podval_seif')
	local box = se_box and level_object(se_box.id) or abort("oruzhie_delet: box 'lima_podval_seif' not found")

	give_info("biznes_remove_special_item")
	db.actor:iterate_inventory_simple(
		function(item)
			 --переносим все
			if not ignore_items[item:section()] then
				db.actor:transfer_item(item, box) --это работает для переноса только в онлайне
			end
		end
	,db.actor)
	disable_info("biznes_remove_special_item")
end

-- Повторная чистка инвентаря ГГ уже в МГ (если всё-таки что-то пронесли)
function izaytie_habara_uzhevmg()
	local qkeep_items={ --итемы, которые не забираем
		["device_torch"]=true,
                ["device_pda"]=true,
                ["bolt"]=true,
                ["hand_radio"]= true,
		["val_zapis_52"]= true
	}
	give_info("biznes_remove_special_item")
	local ids={}
	db.actor:iterate_inventory_simple(
		function(item)
			if not qkeep_items[item:section()] then --запоминаем id итемов, которые удалить надо у игрока
				table.insert(ids,item:id()) 
			end
		end
	,db.actor)
	for index,id in pairs(ids) do
		release(id) --чистим инвентарь
	end
--	db.actor:give_money(-db.actor:money()) --деньги не забираем
	disable_info("biznes_remove_special_item")
end
---------------------------------------------------------------------------------------------

--' заспавним БПБ в гроте
function bpb_spawn()
	create("recipi_bpb",xyz(-129.441,22.309,472.120),147706,2973)
end

--' удаляем таймер базы на Генераторах
function del_baza_doza_timer(story_id)
	release(story_object(17017))
	sms("del_baza_doza_timer_0", nil, nil, 30000)
	got("wpn_ash12",1)
	got("ammo_12.7x55_fmj",3)
	create_car("auto_turret_1",xyz(172.47854614258,34.314182281494,-482.94235229492),535444,3137, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_1",xyz(196.6111907959,38.792930603027,-473.84768676758),563319,3076, "scripts\\technics\\turret.ltx")
end

--' удаляем таймер подстанции на Генераторах
function del_podstanziy_doza_timer(story_id)
	release(story_object(17018))
	sms("del_podstanziy_doza_timer_0", nil, nil, 30000)
end

function disabl_weapon(actor, npc)
    db.actor:hide_weapon()
end
function enabl_weapon(actor, npc)
    db.actor:restore_weapon()
end

--' убираем хели-блак с Генераторов
function dell_gener_heli_black()
	release("generators_heli_black")
end

--' убираем верт Звездочёта с Генераторов
function dell_gener_heli_zvez()
	release("gener_heli_zvez_pobeg")
end

--' Отдадим ключ от секретки авера
function otdal_kluch_dell_telep2(first_speaker, second_speaker)
	lost("kluch_dell_teleport2",1)
end

--' мешок охотника на кордоне
function sp_new_inventory33()
	local obj = create("m_inventory_box33", xyz(-11.449318885803,6.0457949638367,56.734508514404),265783,88)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end

--' проверим наличие запчастей для Захара
function zapchasti_est_vse() 
	return has("part_psevdogigant_hand",15) and
has("part_fracture_hand",20) and
has("part_hand_kontroler",10) and
has("part_flesh_eye",30) and
has("part_krovosos_jaw",15)
  end

--' отдадим запчасти Захару
function zaxar_chasti_mutantov(first_speaker, second_speaker)
	lost("part_psevdogigant_hand",15)
	lost("part_fracture_hand",20)
	lost("part_hand_kontroler",10)
	lost("part_flesh_eye",30)
	lost("part_krovosos_jaw",15)
	del_value("esc_sniper_dead")
end

--' получим арбалет и стрелы от Сепатора и спавним мешок
function arbalet_dal(first_speaker, second_speaker)
	got("wpn_crossbow")
	got("ammo_arbolt",1)
	local obj = create("m_inventory_box33", xyz(-10.764273643494,5.8658442497253,55.716773986816),266465,88)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
	local data = netpacket:get(obj)
	data.object_flags = bit_and(data.object_flags, bit_not(128))
	netpacket:set(data, obj, true)
end

--' Захар дал арт, СВУ и патроны
function zaxar_kvest_ok()
	got("af_eye_voron",1)
	got("wpn_svu",1)
	got("ammo_7.62x54_ap",1)
end

--' убираем Сепатора и Ко
function delete_sepator()
	release("esc_hunter_zaschita_2")
	release("esc_hunter_zaschita_1")
	release("esc_hunter_zaschita_3")
end

--' убираем хели-батя с Янтаря
function dell_yantar_heli_baty()
	release("yantar_heli_baty")
end

--' убираем Батю
function delete_yantar_baty()
	release("yantar_baty")
	timer("run", 2.0, "arhara_dialog.vrag_voyk()")
end

--' Сахар дал спецдетектор
function sah_dal_detektor(first_speaker, second_speaker)
	got("detektor_baty")
end

--' проверим наличие детектора и кассеты
function baty_zadanie_have()
	return has("video_kasseta",1) and
has("detektor_baty",1)
end

--' отдадим детектор и кассету и получим миниган
function baty_zadanie_done(first_speaker, second_speaker)
	lost("video_kasseta",1)
	lost("detektor_baty",1)
	got("wpn_m_134_baty")
end

--' спавним засаду и рандомно видеокассету из new_spawn 
function spawn_videokassete()
        create("sniper_james_1",xyz(-234.07,9.36,40.29),16639,1391)
        create("sniper_james_2",xyz(-238.32,9.36,40.63),14861,1391)
        create("sniper_james_3",xyz(-242.89,9.36,45.16),12489,1391)
        create("sniper_james_4",xyz(-247.08,9.36,47.75),10754,1391)
        create("sniper_james_5",xyz(-251.47,-0.00,41.15),9250,1393)
        create("sniper_james_6",xyz(-255.94,-0.00,32.45),7684,1423)
        create("sniper_james_7",xyz(-232.27,-0.00,34.51),17189,1394)
        create("sniper_james_8",xyz(-265.20,-0.00,14.99),5254,1395)
	timer("run", 1.0, "arhara_dialog.delete_dt_zone_zvuk()")
	timer("run", 1.5, "new_spawn.video_kasseta_spawn()")
end

function delete_dt_zone_zvuk()
	local obj = story_object(17019)
	if obj then
		release(obj)
--		sms("delete_dt_zone_zvuk_0", nil, nil, 20000)
	end
end

--' ГГ друг вояк
function drug_bati(actor, npc)
if db.actor ~= nil then
db.actor:set_character_community("stranger", 0, 0)
local chkgoodwill = relation_registry.community_goodwill("military", db.actor:id())
if chkgoodwill < 0 then 
chkgoodwill = chkgoodwill + 1600
relation_registry.set_community_goodwill ("military", db.actor:id(), chkgoodwill)
else
relation_registry.set_community_goodwill ("military", db.actor:id(), 1600)
end
end
end

--' сделаем ГГ нейтралом и портим отношения с вояками
function vrag_voyk(actor, npc)
if db.actor ~= nil then
db.actor:set_character_community("actor", 0, 0)
local chkgoodwill = relation_registry.community_goodwill("military", db.actor:id())
if chkgoodwill > 0 then 
chkgoodwill = chkgoodwill - 1700
relation_registry.set_community_goodwill ("military", db.actor:id(), chkgoodwill)
else
relation_registry.set_community_goodwill ("military", db.actor:id(), - 1700)
end
end
end

--' проверим наличие финансов для Бармена
function dvenadzat_shtuk(actor,npc)
    return actor:money() > 12000
end

--' отдадим деньги за ремонт ПДА
function dengi_remont_otdal(t1,t2)
	lost_money(12000)
end

--' заберём ПДА у Доцента
function dosemt_pda_zabral(first_speaker, second_speaker)
	got("device_pda_npc")
	timer("run", 25, "arhara_dialog.pda_sdelan_sms()")	-- таймер вместо рестриктора
	disable_info("pda_dont_work")	-- на случай, если пришли не в первый раз
end

--' спавним скелета у монолита
function spawn_skelel_monolit()
	create("scelet_strong",xyz(41.192,57.215,33.114),6321,2417)
end

--' спавним детектор изоморфов
function spawn_detek_izo()
	create("detektor_amorf",xyz(68.187,14.302,178.736),56983,3020)
end

--' удаляем первого Призрака с генераторов
function delete_gen_prizrak()
  	release("generators_prizrak")
end


--' спавним блокнот Странника
function spawn_blokn_strann()
	create("strannik_bloknot",xyz(68.187,14.302,178.736),56983,3020)
end

--' спавним портал в бункере
function spawn_portal_control()
	create("imitator_shar",xyz(-42.175,-34.479,21.473),54,2509)
	create("imitator_tele_final1",xyz(-42.175,-34.479,21.473),54,2509)
	create("anomal_pole",xyz(-42.175,-34.479,21.473),54,2509)
	create("imitator_snezka",xyz(-42.175,-34.479,21.473),54,2509)
end

--' спавним псевдышей в Лиме
function spawn_lima_psevdushi()
	create("gigant_strong",xyz(67.401,3.297,285.837),57187,3022)
	create("gigant_big_strong",xyz(57.739,3.310,268.578),54208,3022)
	create("gigant_red_strong",xyz(97.760,2.900,262.609),60715,3022)
end

--' спавним изоморфные патроны в Лиме
function spawn_izo_pistonu()
	create("ammo_5.45x39_izomorf",xyz(93.017,7.342,244.933),60324,3021)
	create("ammo_5.45x39_izomorf",xyz(93.017,7.342,244.933),60324,3021)
	create("ammo_5.45x39_izomorf",xyz(93.017,7.342,244.933),60324,3021)
end

--' спавним фоторужьё в Саркофаге
function spawn_fotoruzhy()
	create("wpn_svd_foto",xyz(-21.648,69.634,-31.996),598,2417)
	create("anomal_pole_foto",xyz(-21.546,69.630,-31.632),598,2417)
	create("bloknot_neizvestnogo",xyz(-21.546,69.630,-31.632),598,2417)
end

--' спавним фотографию в Саркофаге
function spawn_fotografiy_mono()
	create("foto_monolit",xyz(-21.153,69.636,-30.882),598,2417)
end

--' удаляем рестрикторы провала на задание с фото в Саркофаге
function del_proval_foto_restr(story_id)
	release(story_object(19019))
	release(story_object(19020))
	release(story_object(19021))
	release(story_object(17021))
	find_and_release("anomal_pole_foto")
end

--' заспавним имитатор фотоперехода
function spawn_imit_tele_foto()
--	create("imitator_tele_final1",xyz(-21.340,69.629,-31.520),598,2417)
end

--' проверяет наличие фотки
function odnonogiy_foto_have() 
	return has("foto_monolit",1)
  end

--' проверяет наличие псевдофотки
function psewdofoto_est() 
	return has("psewdofoto",1)
  end

--' проверим отсутствие псевдофотки
function psewdofoto_net()
	return has("psewdofoto",1) ~= true
  end

--' отдадим псевдофото одноногому
function otdal_psewdofoto(first_speaker, second_speaker)
	lost("psewdofoto",1)
end

--' заберём детектор изоморфов
function take_izo_detektor(first_speaker, second_speaker)
	got("detektor_amorf")
end

function metka_semetskiy()
local obj = server_object("stalk_semetskiy")
if obj then level_map_spot(obj.id, "blue_location", "spot_semeckii")
 end
end

--' отдадим фото Монолита Пилигриму
function otdal_foto_pili(first_speaker, second_speaker)
	lost("foto_monolit",1)
	release(story_object(18109))
end

--' заберём псевдофото у Пили
function take_psewdofoto_pili(first_speaker, second_speaker)
	got("psewdofoto")
end

function spawn_bunker_sekret()
	create("mulyz_bomba",xyz(8.089,-23.447,14.072),7800,2773)
	create("mulyz_bomba",xyz(7.608,-23.439,13.871),7695,2773)
	create("osnova_fotik",xyz(7.210,-23.435,14.039),7695,2773)
	create("neizv_zapiska",xyz(6.511,-23.436,14.206),7431,2773)
end

--' удаляем рестриктор оживления радиста
function del_ozh_radista_restr(story_id)
	release(story_object(19023))
end

--' удаляем 2рестриктор оживления радиста
function del2_ozh2_radista2_restr2(story_id)
	release(story_object(19027))
end

--' кровосос в детском садике
function spawn_sos_sadik()
	create("bloodsucker_strong",xyz(136.796,3.935,-25.153),237691,2242)
end

--' глобус в детском садике и рюкзачок
function spawn_globus_sadik()
	create("izom_globus",xyz(132.621,3.935,-52.783),235074,2245)
	create("linza_fotik",xyz(137.245,3.980,-51.995),238095,2245)
local se_obj = create("m_inventory_box34", xyz(134.43992614746,3.9388103485107,-54.601131439209),236350,2245)
map_spot(se_obj.id, "treasure", "Cache")
sms("Received a tip on the cache", nil, nil, 10000)
end

--' псевдыш после детс. садика
function spawn_gig_sadik()
	create("snork_nosach",xyz(63.161,-2.391,-66.476),174678,2137)
end

--' убираем Клыка и радиста из бункера
function delete_kluk_and_radist()
	release("stalk_radist")
	release("bunker_kluk")
end

--' убираем Клыка и радиста из Припяти
function delete_kluk_and_radist_pryp()
	local se_obj = server_object("radist_after")
	if se_obj then
		release(se_obj, true)
	end
	se_obj = server_object("pripyt_kluk")
	if se_obj then
		release(se_obj, true)
	end
end

--' убираем forest_lastday_snip1
function dell_forest_last_snip()
	release("forest_lastday_snip1")
end

--' проверим наличие частей фотика
function zapchasti_fotik_ok() 
	return has("osnova_fotik",1) and
has("linza_fotik",1) and
has("pushka_fotik",1)
end

--' отдадим запчасти фотика леснику
function zapchasti_fotik_otdal(first_speaker, second_speaker)
	lost("osnova_fotik",1)
	lost("linza_fotik",1)
	lost("pushka_fotik",1)
end

--' Леcник дал фотопистолет
function fotopistolet_have(first_speaker, second_speaker)
	got("wpn_eagle_m3")
end

--' проверим наличие финансов за снайпера
function lesnik_have_money_50000(actor,npc)
    return actor:money() > 50000
end

--' отдадим деньги Леснику
function lesnik_give_money_50000(t1,t2)
lost_money(50000)
end

--' спавним фотик у Лесника
function spawn_pushka_fot()
	create("pushka_fotik",xyz(29.470,4.654,25.713),83046,3263)
end

--' izomorf_kristal в лесу
function spawn_izomorf_krist()
	create("izomorf_kristal",xyz(219.859,-7.329,-94.606),139437,3315)
	create("imitator",xyz(220.545,-11.254,-101.263),139769,3315)
	create("anomal_pole",xyz(220.545,-11.254,-101.263),139769,3315)
	create("imitator_snezka",xyz(220.545,-11.254,-101.263),139769,3315)
	create("imitator_holodez",xyz(220.545,-11.254,-101.263),139769,3315)
end

--' заспавним собачек в кр лесу
function spawn_dog_to_red_forest()
	create("pseudodog_normal",xyz(198.575,5.418,118.760),129451,3319)
	create("pseudodog_big",xyz(198.575,5.418,118.760),129451,3319)
	create("volkodav",xyz(198.575,5.418,118.760),129451,3319)
	create("dog_habaruch",xyz(198.575,5.418,118.760),129451,3319)
	create("dog_habaruch",xyz(198.575,5.418,118.760),129451,3319)
	create("dog_habaruch",xyz(198.575,5.418,118.760),129451,3319)
	create("volkodav",xyz(198.575,5.418,118.760),129451,3319)
	create("volkodav",xyz(198.575,5.418,118.760),129451,3319)
end

--' заспавним мины в кр лесу
function spawn_mina_forest()
	local obj =  create("bomba_mina_b",xyz(200.102,4.937,117.763),130200,3319)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
	local obj =  create("bomba_mina_n",xyz(202.781,4.677,117.218),131707,3319)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
end

--' заспавним кактус
--function spawn_kaktus_izo()
--local obj = create("kaktus_izomorf",xyz(14.118,-0.538,23.657),6732,3215)
--end

--' проверим наличие мнимого фотопистолета
function fotopushka_est()
	return has("wpn_eagle_m3",1)
  end

--' отдадим фотик Клёнову на модернизацию
function modernizasiy_fotik(first_speaker, second_speaker)
	lost("wpn_eagle_m3",1)
end

--' Клёнов дал рабочий заряженный фотик и спавн кактуса
function fotopatronu_dal(first_speaker, second_speaker)
	got("wpn_eagle_m2")
create("kaktus_izomorf",xyz(14.118,-0.538,23.657),6732,3215)
	timer("run", 1.0, "arhara_dialog.kaktus_izomorf_timer()")
end

-- Запускаем таймер на 12 часов, в течении которых, ГГ должен порешать все дела с зомбарями и поговорить с Черномором
function kaktus_izomorf_timer()
	local delta= math.random(12, 13) * 60
	local ftime=game.minutes()+delta
        Timer:start_game("kaktus_izomorf_timer",0,0,delta,"arhara_dialog.kaktus_izomorf_goodbye()")
end

function kaktus_izomorf_goodbye()
	if not has_info("chernomor_zombi_say_start") then
	give_info("kaktus_izomorf_proval")
        find_and_release("kaktus_izomorf")
	timer("run", 1.0, "arhara_dialog.vrag_zombie()")
	timer("run", 1.5, "arhara_dialog.dell_chernomor_zombi()")
 end
end

--' проверим наличие кактуса для разговора с Черномором
function kaktus_izomorf_have()
	return has("kaktus_izomorf",1)
  end

--' получим фотку мозга
function fotka_mozga_have(first_speaker, second_speaker)
if not has_info("fotka_mozga_have") then
	got("foto_mozg_x16")
	arhara_dialog.foto_mozg_ok_sms()
	give_info("fotka_mozga_have")
end
end

--' ГГ друг зомбарей
function drug_psss(actor, npc)
	if db.actor ~= nil then
		db.actor:set_character_community("stranger", 0, 0)
		local chkgoodwill = relation_registry.community_goodwill("zombied", db.actor:id())
		if chkgoodwill < 0 then 
			chkgoodwill = chkgoodwill + 6000
			relation_registry.set_community_goodwill ("zombied", db.actor:id(), chkgoodwill)
		else
			relation_registry.set_community_goodwill ("zombied", db.actor:id(), 6000)
			give_info("xvatit_uzhe")
		end
	end
end

--' ГГ враг зомбарей
function vrag_zombie(actor, npc)
if db.actor ~= nil then
db.actor:set_character_community("actor", 0, 0)
local chkgoodwill = relation_registry.community_goodwill("zombied", db.actor:id())
if chkgoodwill > 0 then 
chkgoodwill = chkgoodwill - 6100
relation_registry.set_community_goodwill ("zombied", db.actor:id(), chkgoodwill)
else
relation_registry.set_community_goodwill ("zombied", db.actor:id(), - 6100)
end
end
end

--' убираем foto_monolitovets
function dell_foto_monolitovets()
	release("foto_monolitovets")
end

--' спавн живности в х16
function spawn_zivnost_x16()
	create("m_poltergeist_dd",xyz(-108.872,21.564,-23.246),266,1529)
	create("snork_stronger",xyz(-108.872,21.564,-23.246),266,1529)
	create("zombie_immortal",xyz(-115.406,21.564,-22.614),202,1529)
	create("electro_polter",xyz(-115.406,21.564,-22.614),202,1529)
	create("m_controller_act",xyz(-115.406,21.564,-22.614),202,1529)
	create("zombie_beee",xyz(-114.772,21.563,-37.471),223,1529)
	create("zombie_hell",xyz(-114.772,21.563,-37.471),223,1529)
	create("zombie_blow",xyz(-114.772,21.563,-37.471),223,1529)
	create("snork_stronger",xyz(-109.016,21.564,-37.757),295,1529)
	create("burer_strong",xyz(-106.343,21.782,-24.075),358,1529)
end

--' ЭХ в х16
function spawn_himera_x16()
	create("electro_chimera",xyz(-124.463,18.768,-21.276),84,1529)
	create("scelet_strong",xyz(-223.302,-18.648,-43.821),308,1458)
end

--' получим фотку аномального контрика
function fotka_kont_yazva_have(first_speaker, second_speaker)
if not has_info("fotka_kont_yazva_have") then 
	got("foto_kontroller_yazva")
	arhara_dialog.foto_mozg_ok_sms()
	give_info("fotka_kont_yazva_have")
end
end

--' проверим наличие фоток
function izomorf_dialog_have()
	return has("foto_kontroller_yazva",1) and
has("foto_mozg_x16",1)
end

--' проверим наличие 1фотоки контрика
function odna_fotka_kontrika()
	return has("foto_kontroller_yazva",1)
end

--' проверим наличие 1фотоки мозга
function odna_fotka_mozga()
	return has("foto_mozg_x16",1)
end

--' проверим отсутствие фотопистолета
function fotopushka_istin_net()
	return has("wpn_eagle_m2",1) ~= true
  end

--' проверим отсутствие фоток
function fotok_net_voobsche()
	return has("foto_kontroller_yazva",1) ~= true and
has("foto_mozg_x16",1) ~= true
  end

--' проверим отсутствие фотки контрика
function fotki_net_kontrollera()
	return has("foto_kontroller_yazva",1) ~= true
  end

--' проверим отсутствие фотки мозга
function fotki_net_mozga()
	return has("foto_mozg_x16",1) ~= true
  end

--' проверим отсутствие финансов
function net_pyati_shtuk(actor,npc)
    return actor:money() < 50000  
end

--' проверим наличие фотопистолета
function fotopushka_istinnay()
	return has("wpn_eagle_m2",1)
  end

--' отдадим фотик Клёнову 
function otdadim_fotik(first_speaker, second_speaker)
	lost("wpn_eagle_m2",1)
end

--' отдадим фотки Клёнову 
function otdal_fotki_vse(first_speaker, second_speaker)
	lost("foto_kontroller_yazva",1)
	lost("foto_mozg_x16",1)
end

--' отдадим фотку мозга Клёнову 
function otdal_fotku_mozga(first_speaker, second_speaker)
	lost("foto_mozg_x16",1)
end

--' отдадим фотку контрика Клёнову 
function otdal_fotku_kontroller(first_speaker, second_speaker)
	lost("foto_kontroller_yazva",1)
end

--' Клёнов дал изоморфные патроны
function klen_dal_pistonu(first_speaker, second_speaker)
	got("ammo_5.45x39_izomorf")
	got("ammo_9x39_izomorf")
	got("ammo_7.62x54_izomorf")
	got("ammo_zhekan_izomorf")
end

--' спавн антизомбина на Янтаре
function spawn_antizombin_yntar()
	create("antizombie",xyz(111.220,-8.769,-204.768),99041,1472)
	create("antizombie",xyz(111.194,-8.725,-204.325),99042,1472)
	create("antizombie",xyz(108.190,-8.870,-209.405),97185,1472)
end

--' проверим наличие антизомбина для Черномора
function antizombin_est()
	return has("antizombie",2)
  end

--' отдадим антизомбин
function antiz_otdal()
	lost("antizombie",2)
  end

--' убираем Черномора-зомби
function dell_chernomor_zombi()
	release("chernomor_zombi")
--	release("chernomor_zombi1")
end

--' изоморфы Черномора
function spawn_izomorfy_chernom()
	create("ammo_7.62x54_izomorf",xyz(-1.365,20.731,-10.072),38622,1525)
	create("ammo_7.62x54_izomorf",xyz(-1.365,20.731,-10.072),38622,1525)
	create("ammo_7.62x54_izomorf",xyz(-1.957,20.731,-9.989),38268,1525)
	create("ammo_7.62x54_izomorf",xyz(-1.957,20.731,-9.989),38268,1525)
	create("7.62x54_izomorf",xyz(-1.365,20.731,-10.072),38622,1525)
	create("7.62x54_izomorf",xyz(-1.957,20.731,-9.989),38268,1525)
	create("wa2000_izomorf",xyz(-1.906,20.731,-8.694),38991,1525)
end

--' получим снайперку Черномора
function ruzie_chern_have(first_speaker, second_speaker)
	got("wpn_walther_wa2000")
create("chimera_x_ray",xyz(11.763,0.031,-26.645),44985,1503)
end

--' заспавним сумку проверяющего
function spawn_chem_piyan()
	create("chemodan_piyan",xyz(-182.451,1.144,-305.586),53747,689)
end

--' проверим наличие 10 пузырей
function vodka_desyat_est()
	return has("vodka",10)
  end

--' отдадим пузыри часовому
function vodka_desyat_otdal()
	lost("vodka",10)
	del_value("start_sralomazalskiy")
  end

--' проверим наличие водки
function pollitra_est()
	return has("vodka",1)
  end

--' проверим отсутствие водяры
function pollitra_net()
	return has("vodka",1) ~= true
  end

--' отдадим водку пьяному кепу
function otdal_odnu_vodku()
	lost("vodka",1)
 end

--' убираем трезвого кепа
function dell_trezv_kapit()
	release("trezv_kapitan")
end

--' Кузя дал 5 бутылок
function vodka_kuzy_dal()
	got("vodka",5)
new_spawn.start_sralomazalskiy()
end

--' проверим наличие чумодана для кузи
function kuzy_artmodifikator_have()
	return has("chemodan_piyan",1)
  end

--' проверим отсутствие чумодана для кузи
function kuzy_artmodifik_net()
	return has("chemodan_piyan",1) ~= true
  end

--' отдадим кейс кузнецову
function otdal_chumodaniscte(first_speaker, second_speaker)
	lost("chemodan_piyan",1)
 end

--' Кузя дал артмодификатор
function devays_kuzy_dal(first_speaker, second_speaker)
	got("amk_transmutator")
end

--' проверим наличие 25 пузырей водки
function pollitra_dvadtsatpyat()
	return has("vodka",25)
  end

--' отдадим 25 пузырей водки кузнецову
function otdal_dvadtsatpyat(first_speaker, second_speaker)
	lost("vodka",25)
 end

--' проверим наличие 40 пузырей водки
function pollitra_sorok()
	return has("vodka",40)
  end

--' отдадим 40 пузырей водки кузнецову
function otdal_sorok(first_speaker, second_speaker)
	lost("vodka",40)
 end

--' убирём с Агры пьяный мусор
function delete_agro_musor()
	release("agro_chsovoy_trezv")
	release("agro_piyn_soldier1")
	release("agro_piyn_soldier2")
	release("piyan_psevdovodka")
	release("piyan_psevdovodka1")
	release("piyan_psevdovodka2")
	release("piyan_psevdokolbasa")
	release("piyan_psevdoconserva")
	release("piyan_koncepva1")
	release("piyan_kapitan")
	release("piyan_psevdokalash")
	release("piyan_psevdoabakan")
	release("trezv_kapitan")
end

--' мины для Пантеры на Кордоне
function spawn_bomba_i_mina()
	create("explosive_bomba",xyz(-228.545,-28.910,-223.067),26466,40)
end

--' убираем Пантеру с Кордона
function dell_esc_pantera()
	release("esc_pantera_bomba")
			db.actor.health=-db.actor.health+0.075
	level.add_cam_effector("camera_effects\\fusker.anm", 999, false, "")
end

function proba_posulki()
	create("af_drops",xyz(-255.655,-23.377,-134.334),7894,5)
	create("klenov_opisalovo",xyz(-255.655,-23.377,-134.334),7894,5)
end

function posulka_nomer_dva()
	create("wpn_eagle_m2",xyz(-255.655,-23.377,-134.334),7894,5)
end

function sp_ploti_svalka()
	local obj = create("flesh_strong",xyz(-236.463,-1.910,171.242),13329,343)
	create("wpn_desert_eagle",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("pisma_stalka",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("ammo_357_ap_mag",obj.position, obj.m_level_vertex_id, obj.m_game_vertex_id, obj.id)
	create("flesh_strong",xyz(-236.463,-1.910,171.242),13329,343)
	create("flesh_normal",xyz(273.645,1.435,147.333),378180,257)
	create("flesh_strong",xyz(273.645,1.435,147.333),378180,257)
	create("flesh_normal",xyz(273.645,1.435,147.333),378180,257)
	create("flesh_strong",xyz(210.098,0.399,-137.657),349493,401)
	create("flesh_normal",xyz(-78.291,-3.818,197.277),127104,351)
	create("flesh_strong",xyz(-78.291,-3.818,197.277),127104,351)
	create("flesh_normal",xyz(-78.291,-3.818,197.277),127104,351)
end

--' убираем Пантеру с отцом из Госпиталя
function dell_gospital_pantera2()
	release("hos_father_new")
	release("hos_new_panterka")
end

--' проверим наличие вещей сталкера
function plot_dialog_say_have()
	return has("pisma_stalka",1) and has("wpn_desert_eagle",1)
end

--' отдадим вещи сталкера
function otdal_veschi()
	lost("wpn_desert_eagle",1)
	lost("pisma_stalka",1)
 end

--' убираем запасное фото с кордона
function dell_zapasnoy_foto_muz()
	release("zapasnoy_foto_muzhik")
end

--' убираем основного фото с кордона
function dell_esc_foto_muzhik()
	release("esc_foto_muzhik")
end

--' Тушканы для шухера
function suher_tushk()
	create("tushkano_normal",xyz(-215.511,-19.960,-141.083),37916,61)
	create("tushkano_strong",xyz(-215.511,-19.960,-141.083),37916,61)
end

--' получим фотку убийцы с Кордона
function fotka_ubiysu_ok(first_speaker, second_speaker)
	got("shuher")
end

--' получим фотку лагеря новисов от Черномора
function fotka_kordon_dal(first_speaker, second_speaker)
	got("foto_kordon")
end

--' проверим наличие фотки убийцы с Кордона
function fotka_ubiysu_esc_est()
	return has("shuher",1)
  end

--' отдадим фотку убийцы отцу
function otdal_kartinku(first_speaker, second_speaker)
	lost("shuher",1)
 end

--' убираем одноногого с Генераторов
function dell_odnonogiy()
	release("odnonogiy_stalk")
end

--' получим фотку убийцы с Милилитари
function fotka_kisluy_ok(first_speaker, second_speaker)
	got("kisluy")
end

--' убираем military_fotomuzhik
function dell_milit_fotomuzhik()
	release("military_fotomuzhik")
end

--' убираем military_fotomuzhik запас
function dell_milit_zapas_fotomuz()
	release("milit_zapas_fotomuzhik")
end

--' Тушканы для Кислого
function militar_tushk()
	create("tushkano_normal",xyz(-51.788,-10.182,21.075),257887,1607)
	create("tushkano_strong",xyz(-51.788,-10.182,21.075),257887,1607)
end

--' убираем Шухера с кордона
function dell_stalk_shuher()
	release("esc_stalk_shuher")
end

--' проверим наличие фотки убийцы с Милитари
function fotka_kisluy_est()
	return has("kisluy",1)
  end

--' отдадим фотку Кислому
function vernul_kartinku(first_speaker, second_speaker)
	lost("kisluy",1)
 end

--' рюкзак Злобного
function rukzak_zlobnogo()
local se_obj = create("m_inventory_box36", xyz(-170.294,3.940,-148.568),66879,559)
map_spot(se_obj.id, "treasure", "Vile Cache")
sms("Received a tip on the cache", nil, nil, 10000)
 end

--' убираем Злобного с Авера
function dell_aver_zlobn()
	release("aver_zlobnuy")
end

--' удаляем рестриктор стрелки на авере
function del_strelka_mesto_restr(story_id)
	release(story_object(19034))
end

--' удаляем рестриктор радиуса провала стрелки на авере
function del_strelka_radius_restr(story_id)
	release(story_object(19035))
end

--' проверим наличие фотки жены Сахара
function fotka_zhena_ok()
	return has("zhena_sahara",1)
  end

--' отдадим фотку Сахару
function fotka_zhena_vernul(first_speaker, second_speaker)
	lost("zhena_sahara",1)
 end

--' убираем одноногого с Авера
function dell_aver_odnon()
	release("aver_odnonogiy")
end

--' убираем Сахар-переход, мозг-переход и телепорт
function delete_saxar_perex()
	release(story_object(18111))
	release(story_object(18112))
	release(story_object(17022))
end

--' проверим наличие пластилина
function plastilin_est()
	return has("izomorf_plastilin",1)
  end

--' убираем Молнию 
function dell_molniy()
	release("molniy")
end

--' камушки над мозгом
function plastil_spawn()
	create("preplastilin",xyz(-46.617,27.133,-11.055),7244,1543)
	create("preplastilin",xyz(-45.184,27.134,-14.642),7099,1543)
	create("nauch_recomend",xyz(-43.801,27.133,-10.206),7244,1543)
end

--' заспавним имитатор отхода Молнии
function sp_imit_tele_molniy()
	create("imitator_tele_final1",xyz(-42.458,-34.478,21.222),30,2509)
end

--' заспавним поле перехода в подвале Лимы
function spawn_pole_lima(first_speaker, second_speaker)
	create("anomal_pole",xyz(-52.082,-10.597,-182.625),2891,2993)
end

--' заспавним поле ключа в подвале Лимы
function spawn_pole_kluch(first_speaker, second_speaker)
	create("anomal_pole",xyz(-51.768,-11.915,-170.309),2891,2993)
end

--' убираем блок-телепорт и рестриктор ключа в подвале Лимы
function delete_blok_and_restr(story_id)
	release(story_object(17023))
	sms("delete_blok_and_restr_0", nil, nil, 25000)
end

--' убираем teleport_podval_ok_restrictor
function tele_podval_ok()
	release(story_object(19038))
end

--' защитные мины подвала
function spawn_mina_lima()
	local obj =  create("bomba_mina_b",xyz(-51.878,-9.562,-148.368),2891,2993)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
	local obj =  create("bomba_mina_b",xyz(-49.234,-8.562,-148.500),3051,2993)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
	local obj =  create("bomba_mina_b",xyz(-46.192,-7.561,-149.072),3051,2993)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
	local obj =  create("bomba_mina_b",xyz(-46.205,-6.353,-153.23),3051,2993)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
	create_car("auto_turret_1",xyz(-52.015579223633,-11.91429901123,-167.53782653809),2891,2993, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_1",xyz(-47.333358764648,-11.197814941406,-156.21212768555),3051,2993, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_1",xyz(-57.424324035645,-11.197772979736,-166.85122680664),2375,2993, "scripts\\technics\\turret.ltx")
	create("imitator_holodez",xyz(-56.837,-11.236,-164.933),2375,2993)
	create("imitator_holodez",xyz(-46.999,-11.197,-165.889),3051,2993)
	spawn_restrictor.actor_v_dead_city_restrictor()
	spawn_restrictor.babki_hutor_restrictor()
	spawn_restrictor.spawn_babki_dcity_restrictor()
	spawn_restrictor.sniper1_spawn_krusha1_restrictor()
	spawn_restrictor.sniper2_spawn_krusha2_restrictor()
	spawn_restrictor.dcity_tarakashki_restrictor()
	spawn_restrictor.dcity_poltergeist_flame_restrictor()
end

--' выстрел снайпера в красном лесу
function last_snip_zvuk(sound_name)
if sound_name then
if snd_obj and snd_obj:playing() then
snd_obj:stop()
end
snd_obj = voice([[weapons\vssk\shoot_new]])
if snd_obj then
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
else
log(translate("sound_not_found")..sound_name)
end
else
log("sound_not_set")
end
end

--' удаляем forest_last_snip_proval_restrictor
function del_last_snip_prov_restr(story_id)
	release(story_object(19039))
end

--' превращение Черномора
function chernom_zvuk(sound_name)
if sound_name then
if snd_obj and snd_obj:playing() then
snd_obj:stop()
end
snd_obj = voice([[monsters\zombie\zombie_die_0]])
if snd_obj then
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
else
log(translate("sound_not_found")..sound_name)
end
else
log("sound_not_set")
end
end

--' сначала убьём, потом удалим - иначе - вылет
function kill_fotosvobodovets(storyid)
	local obj = level_story_object(19044)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end
function kill_zapas_fotosvobodovets(storyid)
	local obj = level_story_object(19045)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end

--' сначала убьём, потом удалим - иначе - вылет
function kill_escfoto(storyid)
	local obj = level_story_object(19046)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end
function kill_escfoto_zapas(storyid)
	local obj = level_story_object(19047)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end

function zaschita_minka()
	local obj =  create("bomba_mina_n",xyz(-45.093,-7.057,32.530),265252,1607)
	timer("babah_drop_mine", 0.2, {id = obj.id, sect = obj:section_name()})
end

--' рюкзачок с арбалетом Нормана на чердаке
function yzik_norman_spawn()
	local obj = create("m_inventory_box37", xyz(-129.12908935547,19.055564880371,83.090309143066),223303,3609)
	map_spot(obj.id, "treasure", "Norman's cache")
	sms("Received a tip on the cache", nil, nil, 10000)
end
function uhod_iz_mg_have()
	return has("wpn_crossbow_m1",1)
end

function metka_city_parfumer()
	map_spot(server_object("dcity_parfumer").id,"crlc_big","metka_city_parfumer_0") 
end

function remove_parfumer_metka()
	del_map_spot(server_object("dcity_parfumer").id,"crlc_big")
end
-- Парфюмер выдал нож и куртку
function metka_city_starshoy()
	map_spot(server_object("city_starshoy").id,"crlc_big","metka_city_starshoy_0")
        got("wpn_knife")
        got("novice_outfit")
	create("af_blood",xyz(-126.125,-7.993,-250.333),216584,3607)
	create("af_blood",xyz(17.515,-6.292,-233.814),376070,3639)
	create("af_fuzz_kolobok",xyz(120.220,-3.865,-61.647),464011,3655)
	create("af_fuzz_kolobok",xyz(199.213,-10.649,155.184),484469,3652)
	create("af_electra_moonlight",xyz(148.207,-2.651,-3.675),515304,3657)
	create("af_electra_flash",xyz(151.786,-7.649,219.579),487145,3657)
	create("af_dummy_glassbeads",xyz(-83.458,-8.286,309.596),261779,3624)
	create("af_dummy_glassbeads",xyz(-86.169,-4.283,354.585),258719,3626)
	create("af_medusa",xyz(-138.884,5.649,316.075),199939,3601)
end

function remove_city_starshoy_metka()
	del_map_spot(server_object("city_starshoy").id,"crlc_big")
end

function metka_tema_likvidator()
	map_spot(server_object("city_tema_likvidator").id,"crlc_big","metka_tema_likvidator_0") 
end
function remove_tema_likvidator_metka()
	del_map_spot(server_object("city_tema_likvidator").id,"crlc_big")
end

function metka_norman()
	map_spot(server_object("dcity_kontr_last2").id,"crlc_big","metka_norman_0") 
end
function remove_norman_metka()
	del_map_spot(server_object("dcity_kontr_last2").id,"crlc_big")
end

--' удаляем зону защиты бандитов
function del_zona_bandosu(story_id)
	release(story_object(17026))
end

--' Старший выдаёт обрез
function starshoy_say_one_start() 
	got("wpn_win101_obrez",1)
	got("ammo_12x70_buck",1)
end

--' проверим наличие нужных предметов для Старшего
function starshoy_say_one_have() 
	return has("medkit",10) and
has("wpn_ak74u",2) and
has("vodka",5) and
has("ammo_5.45x39_ap",10) and
has("conserva",20)
end

--' отдадим всё Старшёму
function starshoy_say_one_done(first_speaker, second_speaker)
	lost("medkit",10)
	lost("wpn_ak74u",2)
	lost("vodka",5)
	lost("ammo_5.45x39_ap",10)
	lost("conserva",20)
end

--' заспавним монстриков в Тёмной деревне
function babki_spawn_dsity_hutor()
	create("zombie_babka_normal",xyz(-152.261,9.779,-165.322),185095,3606)
	create("zombie_babka_strong",xyz(-152.261,9.779,-165.322),185095,3606)
	create("bloodsucker_strong",xyz(-147.065,9.438,-160.811),190266,3606)
end

--' заспавним там же арты
function artu_spawn_dsity_hutor()
	create("af_gravi",xyz(-124.779,8.471,-166.461),215144,3614)
	create("af_buliz",xyz(-114.285,9.076,-173.302),224592,3614)
	create("af_babka_1",xyz(-146.363,9.210,-172.300),191016,3610)
end

--' получим фотку тайника от Нормана
function fotka_norman(first_speaker, second_speaker)
	got("taynik_mg")
end

--' получим Позиционер от Нормана
function pozisioner_norman(first_speaker, second_speaker)
	got("stco")
end

--' убираем защиту центра МГ и только после этого спавним гаусс-турели
function delete_zaschita_zenter_gorod()
	release(story_object(17029))
	release(story_object(17030))
	release(story_object(17031))
	release(story_object(17032))
	release(story_object(17033))
	release(story_object(17034))
	release(story_object(17035))
	release(story_object(17036))
	release(story_object(17037))
	release(story_object(17038))
		timer("run", 0.5, "arhara_dialog.spawn_gauss_naploshadi()")
end

--' убираем 10 минутную защиту центра МГ
function del_zasch_zent_gorod()
	release(story_object(17028))
end

--' удаляем первичную зону защиты бандитов(Обморок)
function del_zona_gorod_obmorok(story_id)
	release(story_object(17027))
end

-- Спавним обратно первичную зону защиты бандитов при убийстве Обморока
function zona_gorod_obmorok_spawn()
	local obj = story_object(17027)
	if not obj then
		obj=create(ai:spawn_id(17027))
	end
end

--' удаляем зону защиты здания с Доком
function del_plendok_doza_timer(story_id)
	release(story_object(17041))
	release(story_object(17042))
end

--  спавним гаусс-турели и защитные телепорты
function spawn_gauss_naploshadi()
	create_car("auto_turret_1",xyz(-111.59383392334,1.0800538063049,70.393539428711),229912,3612, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-68.165061950684,4.2167692184448,113.07334136963),279417,3623, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_1",xyz(-78.104820251465,1.0756624937057,22.091875076294),267035,3622, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-29.495235443115,9.3904418945313,37.179847717285),285428,3615, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_1",xyz(-35.908336639404,7.3838677406311,96.623115539551),315512,3630, "scripts\\technics\\turret.ltx")
	create_car("auto_turret_2",xyz(-34.007690429688,11.896708488464,89.098426818848),317230,3630, "scripts\\technics\\turret.ltx")
	create("mg_tele_doma",xyz(-128.29,19.12,91.18),210134,3604)
	create("mg_tele_doma1",xyz(-111.88,15.70,106.05),229950,3609)
	create("mg_tele_doma2",xyz(-133.00,1.41,95.56),205659,3604)
	create("mg_tele_doma3",xyz(-148.91,15.63,70.67),188305,3604)
	create("mg_tele_doma4",xyz(-110.12,19.05,100.87),231588,3609)
	create("mg_tele_doma5",xyz(-133.68,20.40,83.74),207147,3604)
	create("mg_tele_doma6",xyz(-126.99,24.15,91.98),210139,3604)
	create("mg_tele_doma7",xyz(-154.38,15.70,65.79),183115,3604)
end

--' убирём Злобного с МГ
function delete_zlo_and_ko()
	release("dead_city_zlobnuy")
 end

function kill_dsity_rasstrel1(storyid)
	local obj = level_story_object(19041)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end

function kill_dsity_rasstrel2(storyid)
	local obj = level_story_object(19042)
	if obj and iAmStalker[obj:clsid()] and obj:alive() then
		obj:kill(obj)
		return true
	else
		return false
	end
end

--' звук расстрела очередь
function rasstrel_zvuk_ochered(sound_name)
if sound_name then
if snd_obj and snd_obj:playing() then
snd_obj:stop()
end
snd_obj = voice([[weapons\ak47\kalash_ochered]])
if snd_obj then
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
else
log(translate("sound_not_found")..sound_name)
end
else
log("sound_not_set")
end
end

--' звук расстрела одиночка
function rasstrel_zvuk_odinochka(sound_name)
if sound_name then
if snd_obj and snd_obj:playing() then
snd_obj:stop()
end
snd_obj = voice([[weapons\ak47\kalash_odinoch]])
if snd_obj then
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
else
log(translate("sound_not_found")..sound_name)
end
else
log("sound_not_set")
end
end

--' удаляем скриптовый переход МГ-АТП
function del_perexodik(story_id)
	release(story_object(18114))
		timer("run", 1.0, "arhara_dialog.imitat_tele_final1_dell()")
end

--' спавним телепорт в тайник на Агре
function spawn_teleport_agro_norm_taynik()
    local se_obj = create("m_teleport_agro_norm_taynik",xyz(-39.155300140381,0.77279758453369,39.892715454102),203745,700)
	ai:assign_story_id(se_obj.id,17040)
		timer("run", 2.0, "new_spawn.level_changer_na_kordon_spawn()")
end

--' спавним блок включения переходов на агре
function spawn_mem_module()
local obj = create("mem_module",xyz(-37.030,-3.887,46.352),203086,672)
end

--' портим отношения с вояками
function vrag_speznaza(actor, npc)
--if db.actor ~= nil then
--db.actor:set_character_community("actor", 0, 0)
local chkgoodwill = relation_registry.community_goodwill("military", db.actor:id())
if chkgoodwill > 0 then 
chkgoodwill = chkgoodwill - 500
relation_registry.set_community_goodwill ("military", db.actor:id(), chkgoodwill)
else
relation_registry.set_community_goodwill ("military", db.actor:id(), - 500)
end
end
--end

function spawn_babki_d_city()
	create("zombie_babka_normal",xyz(59.981,15.624,44.041),416820,3644)
	create("zombie_babka_strong",xyz(52.225,10.889,46.796),409618,3644)
	create("zombie_immortal",xyz(52.225,10.889,46.796),409618,3644)
	create("zombie_babka_weak",xyz(52.225,10.889,46.796),409618,3644)
	create("kontroller_yazva",xyz(53.321,15.624,45.421),410925,3644)
end

--' проверим наличие финансов для Дуды
function dengi_dude_est(actor,npc)
    return actor:money() > 500000
end

--' отдадим бабки
function otdal_dengi_dude(t1,t2)
lost_money(500000)
end

--' убирём Дуду
function delete_duda()
	release("last_dokplen_nachalnik")
	release("last_dokplen_ox_dok")
end

--' проверим наличие маскировочной экзы
function dok_ekza_est()
	return meceniy_work.have_meceniy_outfit() and has("wpn_m16a2_sk12",1)
end

--' отдадим маскхалат и кольт доку
function otdadim_doku_exzu()
	meceniy_work.give_meceniy_outfit()
	lost("wpn_m16a2_sk12",1)
end

--' убираем видимого Дока из МГ
function dell_dcity_dok_vidim()
	release("dcity_dok_bolot")
end

--' убираем невидимого Дока из МГ
function dell_dok_nevidim()
	release("dcity_dok_nevidim")
end

--' убираем дока Сак с Припяти 
function prip_dok_sak_dell()
local se_obj = server_object("doktor")
  if se_obj then
    release(se_obj, true)
	-- стори ид переносим Доку в МГ, чтобы продолжить ЦЗ
	local obj = server_object("dcity2_dok2_bolot2_vid")
	ai:assign_story_id(obj.id,9502)
  end
end

--' Вступаем в стрейнджеры
function join_stranger (actor, npc)
    printf ("ACTOR NOW IN stranger COMMUNITY")
    if db.actor then
       db.actor:set_character_community ("stranger", 0, 0)
    end
end

--' получим streyndzher
function take_streyndzher(first_speaker, second_speaker)
	got("streyndzher")
end

--' убираем streyndzher
function dell_streyndzher()
--	lost("streyndzher",1)
find_and_release("streyndzher")
	sms("%c[green]"..translate("name_sistema_zaschiti")..":\\n%c[sms_red]"..translate("sms_zashita_streyndzher_zablokirovan_sms"), nil, "zashita", 15000)
end

--' убираем Муху из госпиталя
function dell_muha_hosp_live()
	release("muha_hosp_live")
end

--' получим от Дока маскхалат обратно
function dok_vernul_mashalat(first_speaker, second_speaker)
	got("meceniy_outfit_new")
end

--' убираем Молнию из МГ
function dell_dcity_molniy()
--	disable_info("actor_cant_move")
	db.actor:clear_blocked_slots()
	enabl_weapon()
	release("dead_city_molniy")
say([[anomaly\teleport_work_2]])
		timer("run", 1.0, "arhara_dialog.delete_mg_tele_doma()")
		timer("run", 2.0, "arhara_dialog.delete_dcity_molniy_teleport()")
end

-- Заспавним телепорт в МГ, в который зайдёт Молния и исчезнет
function spawn_dcity_molniy_teleport()
        create("imitator_tele_final1",xyz(-14.72,7.39,95.60),340851,3630)
end

-- Удаляем телепорт Молнии в МГ
function delete_dcity_molniy_teleport()
for a=1,65534,1 do
local obj=server_object(a)
if obj and string.find(obj:name(),"imitator_tele_final1") then
release(obj,true)
    end
        disable_info("actor_cant_move")
  end
end

-- Удаляем телепорты с крыш
function delete_mg_tele_doma()
for a=1,65534,1 do
local obj=server_object(a)
if obj and string.find(obj:name(),"mg_tele_doma") then
release(obj,true)
end
end
end

--' спавним записку Искры
function iskra_listok_spawn()
	create("listok_spark",xyz(-109.715,3.154,37.802),231506,3622)
	spawn_restrictor.kanaliy_dinamit1_vzryv_restrictor()
	spawn_restrictor.kanaliy_dinamit2_vzryv_restrictor()
	spawn_restrictor.kanaliy_dinamit_nevid_vzryv_restrictor()
	spawn_restrictor.otkr_perex_zaton()
	spawn_restrictor.kanaliy_imitator_hit_restrictor()
		timer("run", 1.0, "arhara_dialog.taynik_d6_spawn()")
end

function taynik_d6_spawn()
if not has_info("bland_dead") then
	local obj = create("a_inventory_box8",xyz(-224.558,-24.95,-124.78),26478,10443)
	map_spot(obj.id, "treasure", "Cache")
	sms("Received a tip on the cache", nil, nil, 10000)
 end
end


--' спавним телепорт в ливнёвку МГ
function spawn_tele_dcity_kanaliy()
    local se_obj = create("m_teleport_dcity_kanaliy",xyz(-89.229080200195,1.1233458518982,-27.065231323242),254634,3620)
	ai:assign_story_id(se_obj.id,17043)
end

function kanaliy_dinamit1 (actor, npc)
    local source = nil
       local se_obj = story_object (17044)  
       if se_obj then
          source = level_object(se_obj.id)
       end
    if source == nil then
        return
    end
    local h = hit ()
    h.power = 100
    h.direction = vector():set( 1, 0, 0 )
    h.impulse = 60
    h.draftsman = source
    h.type = hit.chemical_burn
    source:hit (h)
end

function kanaliy_dinamit2 (actor, npc)
    local source = nil
       local se_obj = story_object (17045)  
       if se_obj then
          source = level_object(se_obj.id)
       end
    if source == nil then
        return
    end
    local h = hit ()
    h.power = 200
    h.direction = vector():set( 1, 0, 0 )
    h.impulse = 60
    h.draftsman = source
    h.type = hit.chemical_burn
    source:hit (h)
end

function kanaliy_dinamit_nevid2 (actor, npc)
    local source = nil
       local se_obj = story_object (17046)  
       if se_obj then
          source = level_object(se_obj.id)
       end
    if source == nil then
        return
    end
    local h = hit ()
    h.power = 200
    h.direction = vector():set( 1, 0, 0 )
    h.impulse = 60
    h.draftsman = source
    h.type = hit.chemical_burn
 --   h.type = hit.fire_wound
    source:hit (h)
end

function kanaliy_dinamit_nevid1 (actor, npc)
    local source = nil
       local se_obj = story_object (17047)  
       if se_obj then
          source = level_object(se_obj.id)
       end
    if source == nil then
        return
    end
    local h = hit ()
    h.power = 200
    h.direction = vector():set( 1, 0, 0 )
    h.impulse = 60
    h.draftsman = source
    h.type = hit.chemical_burn
--  h.type = hit.fire_wound
    source:hit (h)
end

function hit_dcity_imitator()
    local h = hit ()
    h.power = 1.5
h.direction = vector_rotate_y(db.actor:direction(), 90)
    h.impulse = 190
h.draftsman = db.actor
   h.type = hit.strike
db.actor:hit(h)
end

function imitator_gener_spavn()
	create("imitator",xyz(14.1453580856323,46.1324005126953,-174.886108398438),349707,3112)
	create("imitator",xyz(12.7922649383545,46.1104927062988,-175.030914306641),349707,3112)
	create("imitator",xyz(13.0828914642334,41.1308479309082,-178.822647094727),351371,3112)
	create("imitator",xyz(9.48082637786865,41.120964050293,-174.294830322266),347116,3112)
	create("imitator",xyz(14.1029558181763,41.1306571960449,-170.866104125977),352208,3112)
	create("imitator",xyz(17.6013641357422,41.1303024291992,-175.369445800781),356617,3112)
	create("imitator",xyz(13.8957996368408,40.6325912475586,-207.103958129883),352170,3110)
	create("imitator",xyz(58.6876487731934,45.9572601318359,-260.544982910156),404981,3114)
	create("imitator",xyz(58.6876487731934,45.9572601318359,-260.544982910156),404981,3114)
	create("imitator",xyz(56.4247131347656,40.8750076293945,-256.978088378906),402536,3114)
	create("imitator",xyz(62.013557434082,40.8754501342773,-257.889007568359),409206,3114)
	create("imitator",xyz(61.2656860351563,40.8751411437988,-263.562530517578),408351,3114)
	create("imitator",xyz(55.6032638549805,40.8755035400391,-262.710906982422),400910,3114)
	create("imitator",xyz(45.4872398376465,40.5109367370605,-252.432556152344),387744,3114)
	create("imitator",xyz(33.3227081298828,40.3606071472168,-243.254913330078),375267,3114)
	create("imitator",xyz(13.5879325866699,47.8379516601563,-230.732391357422),350469,3110)
end

function imitator_gospilal_spavn()
	create("imitator_snezka",xyz(-95.15917,28.38907,567.27117),1003,3038)
	create("imitator_snezka",xyz(-95.60807,28.52086,568.32916),845,3038)
	create("imitator_holodez",xyz(-95.49827,32.41429,613.68133),1024,3038)
	create("imitator_holodez",xyz(-96.06416,32.54857,614.63214),869,3038)
	create("imitator_holodez",xyz(-95.53624,32.58135,615.53179),1026,3038)
	create("imitator_holodez",xyz(-94.12352,32.463905,615.60363),1104,3038)
	create("imitator_holodez",xyz(-93.64558,32.35847,614.88037),1171,3038)
	create("imitator_holodez",xyz(-92.82126,32.22382,614.169372),1378,3038)
	create("imitator_holodez",xyz(-92.28500,32.23130,614.78918),1638,3038)
	create("imitator_holodez",xyz(-91.746139,32.26699,615.73327),1972,3038)
	create("imitator",xyz(-93.587043,32.309429,614.39288),1171,3038)
	create("imitator",xyz(-92.75412,32.16616,613.60137),1637,3038)
	create("imitator_holodez",xyz(-94.68213,28.18796,565.45812),1085,3038)
	create("imitator_holodez",xyz(-94.73439,28.27208,566.36437),1086,3038)
	create("imitator_holodez",xyz(-95.12808,28.32499,566.57604),1002,3038)
	create("imitator_holodez",xyz(-95.03950,28.38788,567.38183),1004,3038)
end

function imitator_kanaliy_spavn()
	create("imitator_holodez",xyz(-96.308708190918,-1.8240934610367,-19.150089263916),247176,3620)
	create("imitator",xyz(-94.969078063965,-1.824152469635,-20.891218185425),248712,3620)
	create("imitator",xyz(-95.195724487305,-1.8241112232208,-19.7877368927),248713,3620)
end

function pantera_dinamit_nevid (actor, npc)
    local source = nil
       local se_obj = story_object (17048)  
       if se_obj then
          source = level_object(se_obj.id)
       end
    if source == nil then
        return
    end
    local h = hit ()
    h.power = 20
    h.direction = vector():set(0,0,0)
    h.impulse = 60
    h.draftsman = source
    h.type = hit.chemical_burn
    source:hit (h)
end

--' Ара, паразит, подох раньше времени - будет вылет
function delete_khutor_zone2_restrictor()
	release(story_object(17049))
end

--' убираем рестриктор вместе с Седым - а то стрёмно...
function sedoy_del_restrictor()
	release(story_object(17050))
end

--' убираем Парфюмера1 из МГ
function dell_parfuym1()
local se_obj = server_object("dcity_parfumer")
  if se_obj then
    release(se_obj, true)
  end
end

--' убираем Обморока из МГ
function dell_obmorok()
	release("dcity_obmorok")
	release("dcity_bodyguard_obmorok")
end

--' тайник-ящик у бандосов 3 гулага МГ
function spawn_yzik_3gulag()
local se_obj = create("m_inventory_box40", xyz(-0.265,4.332,-0.748),357228,3633)
map_spot(se_obj.id, "treasure", "Cache")
sms("Received a tip on the cache", nil, nil, 10000)
end

--' отдадим бабки за пользование ПДА
function operator_babki_otdat(t1,t2)
	if has_money(3000) then
		lost_money(3000)
	else
		db.actor:give_money(-db.actor:money())	
	end
end

--' убираем рестрикторы Бленда
function dell_spawn1_bland1_restr()
	release(story_object(17052))
end
function dell_spawn_bland_restr()
	release(story_object(17051))
end

--' Бленд отдал флешку
function bland_otdal_flesh(first_speaker, second_speaker)
	got("bland_flash")
	timer("run", 60.0, "arhara_dialog.join_stalker()")
	timer("run", 4.0, "arhara_dialog.val_attackers()")
end

--' убираем Блэнда из ТД
function dell_dark_bland()
	release("dark_bland")
	timer("run", 2.0, "arhara_dialog.join_stalker()")
end

--' сходка авторитетов по Бленду
function val_attackers()
	create("val_attackers_1",xyz(24.91,-3.46,-279.52),204836,842)
	create("val_attackers_2",xyz(-17.73,0.43,-217.18),153805,866)
	create("val_attackers_3",xyz(-4.01,1.58,-173.09),169050,872)
	create("val_attackers_4",xyz(56.93,0.20,-176.65),245197,867)
	create("val_attackers_5",xyz(37.81,0.06,-208.31),221313,856)
	create("val_attackers_6",xyz(95.09,-3.11,-214.16),289974,928)
	create("val_attackers_7",xyz(137.95,0.21,-221.37),335584,927)
	timer("run", 8.0, "arhara_dialog.val_attackers1()")
end

function val_attackers1()
	create("val_attackers_8",xyz(174.22,0.15,-230.33),374949,927)
	create("val_attackers_9",xyz(86.12,-3.11,-248.42),279748,930)
	create("val_attackers_10",xyz(99.75,0.28,-364.46),295214,939)
	create("val_attackers_11",xyz(153.17,0.18,-299.33),352831,936)
	create("val_attackers_12",xyz(162.21,0.05,-291.37),362705,936)
	create("val_attackers_1",xyz(124.39,0.05,-301.69),321603,932)
	create("val_attackers_2",xyz(27.10,-3.97,-323.24),207454,842)
	create("val_attackers_3",xyz(95.09,-3.11,-214.16),289974,928)
end

--' таракашки в доме МГ
function mg_spawp_tarakashki()
	create("tarakan_strong",xyz(-170.146,15.623,57.121),166135,3599)
	create("tarakan_normal",xyz(-170.146,15.623,57.121),166135,3599)
	create("tarakan_strong",xyz(-173.322,15.624,54.904),162448,3599)
	create("tarakan_normal",xyz(-173.322,15.624,54.904),162448,3599)
	create("tarakan_strong",xyz(-166.88,15.624,54.501),169708,3599)
	create("tarakan_normal",xyz(-166.88,15.624,54.501),169708,3599)
	create("tarakan_strong",xyz(-162.841,15.626,48.662),173338,3600)
	create("tarakan_normal",xyz(-162.841,15.626,48.662),173338,3600)
	create("tarakan_strong",xyz(-174.055,15.624,40.553),161636,3599)
	create("tarakan_normal",xyz(-174.055,15.624,40.553),161636,3599)
	create("tarakan_strong",xyz(-179.561,15.623,47.734),156157,3599)
	create("tarakan_normal",xyz(-179.561,15.623,47.734),156157,3599)
	create("tarakan_strong",xyz(-177.969,15.625,50.948),157710,3599)
	create("tarakan_normal",xyz(-177.969,15.625,50.948),157710,3599)
end

--' звук библиотекаря
function zvuk_bibliotekar(sound_name)
	if sound_name then
		if snd_obj and snd_obj:playing() then
			snd_obj:stop()
		end
		snd_obj = voice([[monsters\alligator]])
		if snd_obj then
			snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
		else
			log(translate("sound_not_found")..sound_name)
		end
	else
		log("sound_not_set")
	end
end

--' убираем рестриктор видео в Лиманске
function dell_video_finish_restr()
	release(story_object(17053))
end

--' убираем скриптовый переход лима-МГ
function del_pereod_lima_dcity()
	release(story_object(18113))
end

--' убираем Нормана и Парфюмера2 из МГ
function dell_dcity_norman() --doktor has too many items... wtf?????
	local sobj=server_object("dcity2_dok2_bolot2_vid")
	local npc=level_object(sobj.id)
	if npc then
		npc:iterate_inventory_simple(
				function(item)
					release(item) --release child items individually
				end
			)
	end
	Timer:start_game("run", 0, 0, 10, "arhara_dialog.dell_dcity_npcs()") --allow release doktor on next update[s]
end

function dell_dcity_npcs()
	release("parfumer_dcity_shtab")
	release("dcity_kontrol_stalk")
	release("dcity2_dok2_bolot2_vid")
	Timer:start_game("run", 0, 0, math.random(20, 40), "arhara_dialog.dok_return_to_pripyat()")
end

function dok_return_to_pripyat()
	local obj = story_object(9502)
	if obj == nil then create(ai:spawn_id(9502)) end
end

function dell_torgov_restr()
	release("atp_torgovetz_sms_restrictor")
end

function dell_restri()
	release("agro_muxa_sms1_restrictor")
	release("otshel_chel_dell_restrictor")
	release("petrenko_chel_dell_restrictor")
end

function delet_otshel()
	release("final_otshelnik")
	release("final_petrenko")
end

function psev_have()
	create('ver', db.actor:position(), db.actor:level_vertex_id(), db.actor:game_vertex_id(), db.actor:id())
	give_info("komanda_gg_posadka")
	give_info("komanda_na_posadku2")
end

--' удаляем рестрикторы сходки авторитетов
function dell_sxodnyak()
	release("muxa_chel_dell_restrictor")
	release("otshel_chel_dell_restrictor")
	release("petrenko_chel_dell_restrictor")
end

function nax_poshel()
	release("chernomor_zombi")
end

--' убираем Черномора-зомби
function dell_chernomor_zombi1()
	release("chernomor_zombi1")
end
function del_chern_zombi1()
	release(story_object(9626))
end
-- удаляем Черномора со стоянки сталкеров на Янатре
function del_yantar_chernomor()
	release(story_object(19028))
end

-- вырубаем трясучку на ЧАЭС2 и ненужные вертолеты в ЦП
function delete_eartquake()
	release("aes2_space_restrictor_eartquake")
	release(story_object(800))
	release(story_object(801))
	release(story_object(803))
end

function semetskiy_obmen_have()
	return 
		has("detektor_amorf",1) and
		has("stco",1) and
		has("red_mozg",1)
end
function semetskiy_obmen_not_have()
	return not semetskiy_obmen_have()
end
function semetskiy_obmen_done()
	lost("detektor_amorf",1)
	lost("stco",1)
	lost("red_mozg",1)
	got("det_artefact_super", 1)
end
-- убираем странные рестрикторы в Припяти
function delete_pri_hotel_zone()
	release("pri_hotel_zone")
end
function delete_pri_monolith_sniper_to_walker_zone()
	release("pri_monolith_sniper_to_walker_zone")
end

--' заспавним листок Стрелка и телепорт в Саркофаге
function sp_listok()
	create("arhara_listok",xyz(37.540,56.258,31.288),6321,2417)
	create("arhara_obman5",xyz(37.765,56.252,32.024),6321,2417)
end

-- Отправим смс-ку от Клыка, чтобы не тащиться в Бар с документом от охотников
function sms_denis_wound_start()
	sms("%c[sender]"..translate("name_klik")..":\\n%c[sms_red]"..translate("sms_denis_wound_start_0"), 2, "klyk", 22000, nil, [[sms\kluk\sms_denis_wound_start]])
	timer("run", 22.0, "arhara_dialog.sms_denis_wound_start1()")
end

function sms_denis_wound_start1()
	give_info("denis_wound_start")
end

-- Спавн 3х последневцев-невидимок в Х-10
function spawn_bunker_last()
	create("bunker_last7",xyz(6.86,-21.91,54.50),7625,2758)
	create("bunker_last8",xyz(3.52,-21.83,55.47),6993,2757)
	create("bunker_last9",xyz(6.81,-21.91,52.88),7623,2759)
	timer("run", 1.0, "arhara_dialog.delete_vzryvchata_bunker()")
end

function delete_vzryvchata_bunker()
local rem_sections={
	["bomba"]=true,
	["bomba_big"]=true,
	["quest_mina"]=true,
	["bomba_small"]=true,
	["smoke_bomba"]=true,
	["bomba_mina_n"]=true,
	["bomba_mina_b"]=true,
	["amk_kanistra"]=true,
	["amk_ballon"]=true	
}
	if not level.name():lower()=="l10u_bunker" then
		return
	end
	local actor_pos=db.actor:position()
          ai:iterate_alife_objects(function(sobj)
		if sobj 
			and sobj.parent_id~=db.actor:id()
			and rem_sections[sobj:section_name()]
			and object_level_name(sobj):lower()=="l10u_bunker"
		then
			local s_dist=actor_pos:distance_to(sobj.position)
			if s_dist >7 and s_dist < 50 then
				release(sobj)
			end
		end
	end) 
end

function sidor_amulet_exo_wearing()
	local outfit=db.actor:item_in_slot(inventory_slots.OUTFIT)
	local is_good=false
	if outfit~=nil then
		is_good=outfit:section()=="monolit_exoskeleton"
		if has_info("stealth2_done") then
			is_good=(outfit:section()=="monolit_exoskeleton" or outfit:section()=="meceniy_outfit_new")
		end
	end	
	return is_good 
end

function check_mono_mon()
	local outfit=db.actor:item_in_slot(inventory_slots.OUTFIT)
	local is_good=outfit~=nil and (outfit:section()=="monolit_exoskeleton" or outfit:section()=="meceniy_outfit_new")
	if not is_good then
		give_info("sidor_amulet_proval")
	end
end

function start_check_mono_mon()
	if has_info("sidor_amulet_vzyt_start") and not has_info("sidor_amulet_vzyt_done") then
		if has_info("stealth2_done") then
			if not Timer:has("sidor_box_timer") then
				Timer:start_game("sidor_box_timer",0,0,0.3,"arhara_dialog.check_mono_mon()")
			else
				Timer:restart_game("sidor_box_timer",0,0,0.3,"arhara_dialog.check_mono_mon()")
			end
			return 
		end
		give_info("sidor_amulet_proval")
	end
end