dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");

function LoadingLevel(param)
    SetAlfaValue(501,0)
	SetAlfaValue(502,0)
	SLevel=param;
return;end;

location={}
location["kabinet"] = true
location["kabinet"] = {}
location["kabinet"]["id"] = 21
location["kabinet"]["sub_id"] = 0

function LevelComplete()
	if not flags.case then
	SetCurrentRM("menu");
		addstaticobjecttogame(777777777,"menubuttons",62,679,"",0,0,61,61);
		AddSheet(1001,"gr","green_b",62,679,61,61,"green",156,619,638,101,15,41,15,10,1,55,777777777,9);
		AddLeftScroller("gr",2000029,"leftbtn",nil,nil,nil,122,105,46,90)
		AddRightScroller("gr",2000030,"rightbtn",nil,nil,nil,782,100,46,90)		
	SetCurrentRM("main");	
	flags.case=true;
	LevelComplete();
	return;end;
	if not flags.photo then

		AddImgToBook("photoaparat",838,580);
		AddHints()	
		flags.photo=true;
		LevelComplete();
	return;end;
	DeleteElement("gr",30);
	ShowMenu(false);
	flags.levelcomplete=true;
	DarkScreen(true);
end;

function StartLevel()
	ShowMenu(true);
	AddParticleToObject(67,"Door",390,291);
	MoveEmiter("Door",390,291);
	StartEmiter("Door");
	if flags.photo then
		AddImgToBook("photoaparat",838,580);
		AddHints()	
		flags.photo=true;
	end;
			StartAnimation(110);		

			StartAnimation(111);	

		  StartAnimation(106);		

			StartAnimation(109);	

			StartAnimation(108);	

			StartAnimation(105);	

		StartAnimation(107);	

Set_Cursor(67,4);
end;



flags={};

flags["loc1"]=false;
flags["firstloc1"] = true;
flags["case"]=false;
flags["photo"]=false;
flags["keys"]=false;
flags["doorisopen"]=false;
flags["byphoto"]=false;
--flags["comics"]=false;
flags["whole_darkness"]=false;
flags["skip"]=false;
flags["levelcomplete"]=false;
flags["allobject"]=false;
flags["exit"]=false;
flags["onkeys"]=false;
flags["HintCount"]=5;

add_tree_leaf("Root","kabinet",21,0);-- Добавляет лист в дерево 
	SetCurrentRM("menu");
		addstaticobjecttogame(877777777,"menubuttons",63,622,"",60,0,61,61);
		AddSheet(1002,"re","red_b",63,622,61,61,"",128,640,690,115,15,5,6,5,0,59,877777777);	
	SetCurrentRM("main");


dofile("./data/21/0/res.lua");

setcurentleaf("kabinet",21,0);
DarkScreen(true);
speciale_action(2,502,true,2);		
speciale_action(4,502);

playfile(".\\sound\\Music_1.ogg",true,true);
