-- db.lvlstart = true
function proceed()
    local actor = db.actor
	
	if	not has_alife_info("tutorial_artefact_start") and
		not has_alife_info("tutorial_artefact_gain") and 
		actor:object("af_blood_tutorial") ~= nil 
	then		
		actor:give_info_portion("tutorial_artefact_gain")
	end 
	
	if	(has_alife_info("tutorial_end") or
		has_alife_info("esc_kill_bandits_quest_done")) and
		not has_alife_info("esc_path_to_lager") 
	then		
		actor:give_info_portion("esc_path_to_lager")
	end 
	
	if not has_alife_info("tutorial_wounded_fail") and not has_alife_info("tutorial_wounded_help")then
		if has_alife_info("tutorial_wounded_die") or
		   has_alife_info("tutorial_wounded_death")
		then
			actor:give_info_portion("tutorial_wounded_fail")
		end	
	end
	
	if has_alife_info("garbage_meetstalker_die") and
		has_alife_info("escape_stalker_give") and
		not has_alife_info("agr_krot_band_start")
	then
		actor:give_info_portion("agr_krot_band_start")
		news_manager.send_tip(db.actor, "gar_seryi_info")
	end

	if not has_alife_info("tutorial_wounded_give_info") and
	   actor:object("esc_wounded_flash") ~= nil
	then
		actor:give_info_portion("tutorial_wounded_give_info")
		actor:disable_info_portion("esc_trader_direct")
	end     	


--' Туториальный труп
	if has_alife_info("escape_blockpost_case") and
	   not has_alife_info("escape_blockpost_case_have") and 
	   actor:object("quest_case_01") ~= nil
	then
		actor:give_info_portion("escape_blockpost_case_have")
	end       	
	
	if has_alife_info("escape_stalker_meet") and
		not has_alife_info("escape_stalker_done") and
		actor:object("fox_flash") ~= nil
	then
		actor:give_info_portion("escape_stalker_done")
		actor:give_info_portion("garbage_meetstalker_start")
	end

	if has_alife_info("escape_blockpost_case") and
		not has_alife_info("escape_blockpost_case_have") and
		actor:object("quest_case_01") ~= nil
	then
		actor:give_info_portion("escape_blockpost_case_have")
	end
	
	if has_alife_info("esc_kill_bandits_quest_done") and
	   not has_alife_info("esc_petruha_great")
	then
		actor:give_info_portion("esc_petruha_great")
	end
end

function task_lager_complete()
	if has_alife_info("escape_lager_help") and
		has_alife_info("escape_lager_killers_die") and
	   (has_alife_info("esc_fanat_die") or
	   has_alife_info("escape_lager_complete"))
	then
		return true
	else
		return false
	end
end	

function task_fox_complete()
	if has_alife_info("garbage_meetstalker_start") or
	   has_alife_info("escape_stalker_done")
	then
			-- alterei
			local snorkafterbridge = vector():set( 142.01, 1.75, 337.88 )
			alife():create("snork_weak", snorkafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			local snorkafterbridge = vector():set( -5.05, 2.17, 251.47 )
			alife():create("snork_weak", snorkafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			local tushkanoafterbridge = vector():set( -5.05, 2.17, 251.47 )
			alife():create("tushkano_normal", tushkanoafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			alife():create("tushkano_normal", tushkanoafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			alife():create("tushkano_normal", tushkanoafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			alife():create("tushkano_normal", tushkanoafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
			local bloodafterbridge = vector():set( -9.17, 2.17, 296.04 )
			alife():create("bloodsucker_weak", bloodafterbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
		return true
	else
		return false
	end
end	

function kill_tutorial_bandits()
	if has_alife_info("esc_first_novice_dead") and
		has_alife_info("esc_second_novice_dead")
	then
		return true
	else
		return false
	end
end

function task_volk_fail()
	if has_alife_info("esc_wolf_dead")
	then
		return true
	else
		return false
	end
end	

function petruha_talk()
	if has_alife_info("escape_factory_assault_say_hello") or
		has_alife_info("esc_petruha_great")
	then
		return true
	else
		return false
	end
end

function is_actor_enemy_lager ()
    local gulag = xr_gulag.get_gulag_by_name ("esc_lager")
    if has_alife_info("esc_fanat_die") then return true end
	if gulag == nil or gulag:npc_is_enemy_to_anybody (db.actor) == false then
       return false
    end    
    return true
end

function process_info_portion(info_id)

	--' пометки на карте
	
	if info_id == "esc_tutorial_secret_place" then
		level_tasks.add_location(025, "green_location", "tutorial_secret_place1")
		
	elseif info_id == "esc_tutorial_secret_place_found" then
		level_tasks.remove_location(025, "green_location")
		
	elseif info_id == "esc_kolyan_lost" then
		level_tasks.add_location(028, "crlc_big", "esc_mill")
		
	elseif info_id == "esc_kolyan_found" then
		level_tasks.remove_location(028, "crlc_big")
		
	elseif info_id == "esc_bridge_soldiers" then
		level_tasks.add_location(031, "crlc_big", "soldiers_bridge")
		
	elseif info_id == "esc_tutorial_secret" then
		level_tasks.add_location(026, "crlc_small", "tutorial_secret")

	elseif info_id == "esc_tutorial_secret_find" then
		level_tasks.remove_location(026, "crlc_small")
		
	elseif info_id == "esc_shustryi_secret" then
		level_tasks.add_location(027, "crlc_small", "tutorial_secret_shustryi")

	elseif info_id == "esc_shustryi_secret_find" then
		level_tasks.remove_location(027, "crlc_small")
		
	return false
	end
end