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

function LevelComplete()
  AddElement("gr",1656);
  MoveObjectToTree(1656);
  DeleteElement("gr",26);
  DeleteElement("gr",106);
  speciale_action(2,500);
  flags.levelcomplete=true;
  whole_darkness=false;
  DarkScreen(true);
  ShowMenu(false)
end;
location={}
location["hotel"] = true
location["hotel"] = {}
location["hotel"]["id"] = 2
location["hotel"]["sub_id"] = 0

frame=0;

flags={};
flags["comx"]=false;
flags["comx1"]=false;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["access"]=false;
flags["objects"]=false;
flags["konec"]= false;
flags["levelcomplete"]= false;
flags["videlit"]= false;
flags["nohints"]=false;
flags["HintCount"]=5;
add_tree_leaf("Root","hotel",2,0);
  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()
  -- ShowMenu(true);

dofile("./data/2/0/res.lua");
setcurentleaf("hotel",2,0);
WaitRender()
flags.comx= true

ShowMenu(false);
    playfile(".\\sound\\game_theme2.ogg",true,true);
function LoadingLevel(param)
if flags.levelcomplete then
  delete_tree_leaf("Root","hotel");-- Добавляет лист в дерево 
  setnextlavel(3);
  loadlavel();
return; end;
SetAlfaValue(503,0);
     SLevel=param;
return;end;
function StartLevel()
    DarkScreen(false);
    SetCurrentRM("menu");
    AddImgToBook("photoaparat",821,637);
    AddHints()
    SetCurrentRM("main");
    ShowMenu(true);
  AddParticleToObject(6,"Zvezd",381,126);
  MoveEmiter("Zvezd",381,126);
  AddParticleToObject(42,"pu4ok",445,302);
  MoveEmiter("pu4ok",445,302);
  AddParticleToObject(50,"Svet",570,300);
  MoveEmiter("Svet",570,300);
  if not flags.access then
  -- messagebox("игра пожарка не пройдена");
  StartEmiter("Zvezd"); 
  end;

  if not flags.minicomplete33 then
    if not flags.minicomplete9 then 
      -- messagebox("игра печати не пройдена");
      StartEmiter("pu4ok"); 
    end;
    if flags.minicomplete9 then 
      -- messagebox("игра ключи не пройдена");
      StartEmiter("Svet");
      set_visible_object(50,true)
    end;  
  end;  

end
