dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");
location={}
location["rouk_enter"] = true
location["rouk_enter"] = {}
location["rouk_enter"]["id"] = 25
location["rouk_enter"]["sub_id"] = 1
location["rouk_room"] = true
location["rouk_room"] = {}
location["rouk_room"]["id"] = 25
location["rouk_room"]["sub_id"] = 2
function LevelComplete()
  setcurentleaf("rouk_room",25,2);
  AddElement("gr",114);
  MoveObjectToTree(114);
  AddElement("gr",115);
  MoveObjectToTree(115);
  flags.levelcomplete=true;
    whole_darkness=false;
  DarkScreen(true);
  ShowMenu(false)
end;
function LoadingLevel(param)
if flags.levelcomplete then
  delete_tree_leaf("Root","rouk_enter");-- Добавляет лист в дерево 
  delete_tree_leaf("Root","rouk_room");-- Добавляет лист в дерево 
  setnextlavel(9);
  loadlavel();
return; end;
SetAlfaValue(503,0);
     SLevel=param;
return;end;
frame=0;

flags={};
flags["comx"]=false;
flags["comx1"]=false;
flags["proideno"]=false;
flags["loc1"] = false;
flags["loc2"] = false;
flags["loc3"] = false;
flags["firstloc2"]=true;
flags["firstloc3"]=true;
flags["firstloc4"]=true;
flags["HintCount"]=5;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["minicomplete2"]=false;
flags["minicomplete3"]=false;
flags["minicomplete4"]=false;
flags["minicomplete5"]=false;
flags["minicomplete6"]=false;
flags["minicomplete7"]=false;
flags["nohints"]=false;
flags["auto"]=false;
flags["wheel"]=false;
flags["bolt"]=false;
flags["door"]=false;
flags["enter"]=false;
flags["dog"]=false;
flags["oil"]=false;
flags["snake"]=false;
flags["case"]=false;
flags["address"]=false;
flags["card"]=false;
flags["keys"]=false;
flags["sms"]=false;
flags["levelcomplete"]= false;
flags["first1"]= false;
flags["first"]= false;
flags["one"]= false;
flags["first2"]= false;
flags["addressdlyapodskazki"]=false;
flags["maping"]=false;
flags["endmap"]=false;
flags["maincomics"]=false;
flags["items"]=0;

add_tree_leaf("Root","rouk_enter",25,1);
  addstaticobjecttogame(877777777,"buttons",114,625,"",60,0,61,61);
  SetCurrentRM("menu");
  AddSheet(1002,"re","red_b",103,656,37,41,"",99,657,650,80,92,21,5,5,0,59,877777777,nil,"buttonsY");
SetCurrentRM("main");
loadresource("data\\photoaparat.png","photoaparat",2000029);
loadresource("data\\animationMENU3.png","menuAn",2000030);
AddImgToBook("photoaparat",821,637);
AddHints()
dofile("./data/25/1/res.lua");
 UpdateStack();
add_tree_leaf("Root","rouk_room",25,2);
  addstaticobjecttogame(877777777,"buttons",114,625,"",60,0,61,61);
  SetCurrentRM("menu");
  AddSheet(1002,"re","red_b",103,656,37,41,"",99,657,650,80,92,21,5,5,0,59,877777777,nil,"buttonsY");
SetCurrentRM("main");
dofile("./data/25/2/res.lua");  
 UpdateStack();
setcurentleaf("rouk_enter",25,1);
WaitRender()
flags.comx= true

    ShowMenu(false);
playfile(".\\sound\\game_theme2.ogg",true,true);
function StartLevel()
    DarkScreen(false);
    SetCurrentRM("menu");
    AddImgToBook("photoaparat",821,637);
    AddHints()
    SetCurrentRM("main");
    ShowMenu(true);
    setcurentleaf("rouk_enter",25,1);
    AddParticleToObject(2,"pu4ok",269,460);
    MoveEmiter("pu4ok",269,460);
    AddParticleToObject(46,"dver",393,295);
    MoveEmiter("dver",393,295);  
    AddParticleToObject(40,"dog",528,376);
    MoveEmiter("dog",528,376);
     
    if flags.minicomplete17 and not flags.dog then 
      StartEmiter("dog");
    end;
    if not flags.minicomplete17 then 
      StartEmiter("pu4ok"); 
    end;
    if not flags.minicomplete29 and flags.dog then 
        StartEmiter("dver"); 
    end;
    setcurentleaf("rouk_room",25,2);
      AddParticleToObject(38,"zvezd4",608,457);
      MoveEmiter("zvezd4",608,457);
      AddParticleToObject(49,"zvezd3",104,534);
      MoveEmiter("zvezd3",104,534);
    AddParticleToObject(200,"pasport",241,420);
    MoveEmiter("pasport",241,420);
    if (not flags.minicomplete3) then
      StartEmiter("zvezd4");
    end;
    if  flags.snake and not flags.case then
      StartEmiter("zvezd3");
    end;
    if (not flags.minicomplete10) and flags.case then
      StartEmiter("pasport");
    end;

end