playeffect("gate_f",true)

setCursor(obj.door_Muzey_4_0.id,5);
setCursor(obj.door_DorogaKMuzeyu_4_0.id,6);
setCursor(obj.mini_VorotaMuzeyaSteklo_4_0.id,2);
setCursor(obj.mini_Wall_4_0.id,2);
setCursor(obj.vedro_3_0.id,4);

if not flags.firstloc4 then
  flags.firstloc4=true
  CreatePlashechka("681")
end;

function SelectRandom()
  if not obj.vedro_3_0.is_collapsed then
    giveMeHint(obj.vedro_3_0.id)
  return end
  if obj.almaz_9_14 and obj.almaz_9_14.is_collapsed and not neighbors.VorotaMuzeyaSteklo.lock then
    giveMeHint(obj.mini_VorotaMuzeyaSteklo_4_0.id);
  return end
  if obj.nozhnicy_3_10 and obj.nozhnicy_3_10.is_stored then
    giveMeHint(obj.mini_Wall_4_0.id);
  return end
  CreatePlashechka("10001")
end;

if neighbors.Golubok.lock then
  set_visible_object(obj.dver.id,true)
else
  set_visible_object(obj.dver.id,false)
end;

if neighbors.Muzey.lock then
  setCursor(obj.door_Muzey_4_0.id,4);
  set_visible_object(obj.gatesopen_4_0.id,false)
else
  set_visible_object(obj.gatesopen_4_0.id,true)
  set_visible_object(obj.gatesclosed_4_0.id,false)
  if not flags.plashkaNaVorotah then
    flags.plashkaNaVorotah = true
    StartTimer(timerID,0.2,"frame1")
  end
end
if neighbors.VorotaMuzeyaSteklo.lock then
  set_visible_object(obj.mini_VorotaMuzeyaSteklo_4_0.id,false)
  set_visible_object(obj.kist_4_0.id,false)
end
if flags.steklo then
  set_visible_object(obj.vitrina_bez_stekla_4_0.id,true)
  set_visible_object(obj.steklo_pol_4_0.id,true)
  set_visible_object(obj.vitrina_4_0.id,false)
else
  set_visible_object(obj.vitrina_bez_stekla_4_0.id,false)
  set_visible_object(obj.steklo_pol_4_0.id,false)
  set_visible_object(obj.vitrina_4_0.id,true)
end
if neighbors.Wall.lock then
  set_visible_object(obj.mini_Wall_4_0.id,false)
  setCursor(obj.mini_Wall_4_0.id,3);
  StopEmiter("Standart_4_4");
  set_visible_object(obj.plyusch_4_0.id,false)
end
if neighbors.Lions.lock then
  set_visible_object(obj.mini_Wall_4_0.id,false)
end

function gameinput (sender,obj_id,attachedID)
  sendersProcessing(sender,obj_id,attachedID)
  if sender==36 then
    if obj_id==2111 then
      StartTravel(211,2,nil,nil,flySp,flySp1);
      StartTimer(2111,15)
    return;end;
    if obj_id==2121 then
      StartTravel(212,2,nil,nil,flySp2,flySp1);
      StartTimer(2121,17)
    return;end;  
    if obj_id==2131 then
      StartTravel(213,2,nil,nil,flySp3,flySp1);
      StartTimer(2131,7)
    return;end;    
    if obj_id==2141 then
      StartTravel(214,2,nil,nil,flySp4,flySp1);
      StartTimer(2141,11)
    return;end;      
  return;end;  
  
  if sender==1 then
    -- if obj_id == obj.gatesclosed_4_0.id then
      -- CreatePlashechka("615")
    -- end
    if obj_id == obj.vedro_3_0.id then
      StoreObj(obj.vedro_3_0.id)
      StopEmiter("Inv_3_1");
    end    
    if obj_id == obj.door_Muzey_4_0.id then
      if neighbors.Muzey.lock then
        CreatePlashechka("615")
      else
        jump("Muzey");
      end
    end;
    if obj_id == obj.door_DorogaKMuzeyu_4_0.id then
      jump("DorogaKMuzeyu");
    end;

    if obj_id == obj.mini_VorotaMuzeyaSteklo_4_0.id then
      CreateSatelite("VorotaMuzeyaSteklo");
      playeffect("sat")
    end;
    if obj_id == obj.mini_Wall_4_0.id then
      CreateSatelite("Wall");
      playeffect("sat")
    end;
  end
end

function frame1()
  CreatePlashechka("633")
end
