if flags.zolotayaVstav and flags.serebrVstav then
  set_visible_object(5,true)
  speciale_action(2,100)
  setcolor(1,1,1,1,1)
  setcolor(3,1,1,1,1)
  ActivateObject(1,false)
  ActivateObject(3,false)
end

if flags.zolotayaVstav then
  setcolor(3,1,1,1,1)
  setCursor(3,3)
  ActivateObject(3,false)
end;
if flags.serebrVstav then
setcolor(1,1,1,1,1)
setCursor(1,3)
ActivateObject(1,false)
end;
local b = false

function gameinput (sender,obj_id,attachedID)
  MiniInterfaceHandler(sender, obj_id);
  sendersProcessing(sender, obj_id, attachedID);
  if wrongItemWarning(sender, obj_id, attachedID, "roza_18_1", "zolotaya_roza_17_1") then
    return
  end
  if sender==1 then
    if obj_id == 1 then
      if obj.roza_18_1 and attachedID == obj.roza_18_1.id then
        removeFromMouse()
        UnStoreObj(obj.roza_18_1.id)
        playeffect("rose")
        setCursor(1,3)
        Block_Show_Cur(true)
        SetAlfa(1,0.01,1,1,"frame1")
        flags.serebrVstav = true
      else
        CreatePlashechka("612")
      end
    end
    if obj_id == 3 then
      if obj.zolotaya_roza_17_1 and attachedID == obj.zolotaya_roza_17_1.id then
        removeFromMouse()
        UnStoreObj(obj.zolotaya_roza_17_1.id)
        setCursor(3,3)
        playeffect("rose")  
        Block_Show_Cur(true)
        SetAlfa(3,0.01,1,1,"frame2")
        flags.zolotayaVstav = true
      else
        CreatePlashechka("612")
      end
    end
    if obj_id == 5 then
      b = true
      CloseSatelite()
    end
  end
  if sender == 30 then
    if b then
      jump("final")
    end
  end
end

function frame1()
  SetAlfa(1,1,0,1)
  SetAlfa(2,0,1,1,"check")
end

function frame2()
  SetAlfa(3,1,0,1)
  SetAlfa(4,0,1,1,"check")
end

function check()

  if flags.zolotayaVstav and flags.serebrVstav then
    playeffect("open_box")
    SetAlfa(10,0,1,2,"frame3")
  else
    Block_Show_Cur(false)
  end
end

function frame3()
  speciale_action(2,100,true,2)
  set_visible_object(5,true)
  StartTimer(timerID,2,"unBlock_Show_Cur")
end