
function SelectRandom()
    if (flags.hidden_zarosli and flags.hidden_stol_police_two and flags.hidden_kucha_two
    and  flags.hidden_chulan_two and flags.hidden_stulja_two)
    then
        if not flags.zamok_in_world then
        if not flags.idol_one then
            selectrandomobject1(1.5,10,false);
        return;end;
        if not flags.idol_two then
            selectrandomobject1(1.5,11,false);
        return;end;
        if not flags.idol_three then
            selectrandomobject1(1.5,12,false);
        return;end;
        if not flags.idol_four then
            selectrandomobject1(1.5,13,false);
        return;end;
        if not flags.idol_five then
            selectrandomobject1(1.5,14,false);
        return;end;    
       selectrandomobject1(1.5,7,false);
           return;end;   
 not_hint=true		   
CreatePlashechka(900000,"10005")
    return;end;        
 not_hint=true
    CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(15,11);
    if not flags.idol_one  then
      Set_Anim_Cur(10,4);
    end;
    if not flags.idol_two then
      Set_Anim_Cur(11,4);
    end;
    if not flags.idol_three then
      Set_Anim_Cur(12,4);
    end;
    if not flags.idol_four then
      Set_Anim_Cur(13,4);
    end;
    if not flags.idol_five then
      Set_Anim_Cur(14,4);
    end;
    if (flags.idol_one and flags.idol_two and flags.idol_three and flags.idol_four and flags.idol_five) and not flags.zamok_in_world then
      Set_Anim_Cur(7,2);
    end;
    if flags.zamok_in_world and not fromzamok then
      Set_Anim_Cur(16,14);
    end;
end;


function SetParticles()
    if not flags.idol_one then
      AddParticleToObject(10,"book",628+20,422+30);
      MoveEmiter("book",628+20,422+30);
      StartEmiter("book");
    end;
    if not flags.idol_two then
      AddParticleToObject(11,"case",591+20,423+30);
      MoveEmiter("case",591+20,423+30);
      StartEmiter("case");
    end;
    if not flags.idol_three then
      AddParticleToObject(12,"vaza",368+20,255+30);
      MoveEmiter("vaza",368+20,255+30);
      StartEmiter("vaza");
    end;
    if not flags.idol_four then
      AddParticleToObject(13,"kanistra",390+20,355+30);
      MoveEmiter("kanistra",390+20,355+30);
      StartEmiter("kanistra");
    end;
    if not flags.idol_five then
      AddParticleToObject(14,"pjatnashki",342+20,354+30);
      MoveEmiter("pjatnashki",342+20,354+30);
      StartEmiter("pjatnashki");
    end;
    if not (flags.zamok_in_world) then
      AddParticleToObject(1,"conteiner",508,390);
      MoveEmiter("conteiner",508,390);
      StartEmiter("conteiner");
    end;     
end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID) 
 SetParticles()
 CursorTreatment(obj_id,sender,attachedID);
  if sender==100 then
    SetCursors()

    BlockCursor(false)
     playeffect("fon_dark",true);
     if not flags.first_hell then
        flags.first_hell=true;
        CreatePlashechka(900000,"3051")
     end;
     if fromzamok then
        fromzamok=false
        StopEmiter("conteiner");
        RotateObject(48,0,360,3)
        RotateObject(43,0,-360,3)
        MoveObjectX(49,465,565,3)
        MoveObjectX(44,301,201,3)        
     end;
  return;end;
  if sender==28 then
      if obj_id==44 then
        for i = 2, 6, 1 do
          speciale_action(2,i,true,3);
        end;
        for i = 10, 14, 1 do
          speciale_action(2,i,true,3);
        end;      
        for i=40,51,1 do
            speciale_action(2,i,true,3)
        end;        
    -- speciale_action(10,15)
      return;end;
  return;end;
  if sender==15 then
    if obj_id==51 then
        speciale_action(2,16)
        Set_Anim_Cur(16,14);         
        Block_Show_Cur(false);
    end;
  return;end;
  if sender==33 then
      Block_Show_Cur(false);
  return;end; 
  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == 15 then
        playeffect("step_street")
        RemObjFromMouse()   
        jump("to_another_world","obryv",17,0);
    return; end;
    if obj_id == 16 then    
        playeffect("step_street")
        flags.is_jumping = false;    
        flags.is_hidden_loc = true;
        flags.is_final_loc=true;
        RemObjFromMouse()
        ShowMenu(false)       
        jump("to_another_world","another_world",21,0);
    return; end;
    ----1-ый идол
    if obj_id == 10 then
      if (obj.lodio ~= nil and attachedID == obj.lodio.id) or (obj.lodit ~= nil and attachedID == obj.lodit.id) or (obj.loditr ~= nil and attachedID == obj.loditr.id) or (obj.lodifp ~= nil and attachedID == obj.lodifp.id) or (obj.lodifv ~= nil and attachedID == obj.lodifv.id) then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        playeffect("statuetka")
        speciale_action(2,2,true);
        ActivateObject(10,false);
        Set_Anim_Cur(10,3);
        StopEmiter("book");
        flags.idol_one = true;
        if flags.idol_two and flags.idol_three and flags.idol_four and flags.idol_five then
          Block_Show_Cur(true);
          StartTimer(88815,0.5);
        return; end;
      return; end;
      CreatePlashechka(900000,"562")
    return; end;
    -------------
    ----2-й идол-
    if obj_id == 11 then
      if (obj.lodio ~= nil and attachedID == obj.lodio.id) or (obj.lodit ~= nil and attachedID == obj.lodit.id) or (obj.loditr ~= nil and attachedID == obj.loditr.id) or (obj.lodifp ~= nil and attachedID == obj.lodifp.id) or (obj.lodifv ~= nil and attachedID == obj.lodifv.id) then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,3,true);
        ActivateObject(11,false);
        Set_Anim_Cur(11,3);
        playeffect("statuetka")
        flags.idol_two = true;
        StopEmiter("case");
        if flags.idol_one and flags.idol_three and flags.idol_four and flags.idol_five then
          Block_Show_Cur(true);
          StartTimer(88815,0.5);
        return; end;
      return; end;
      CreatePlashechka(900000,"562")
    return; end;
    ----3-й идол-
    if obj_id == 12 then
      if (obj.lodio ~= nil and attachedID == obj.lodio.id) or (obj.lodit ~= nil and attachedID == obj.lodit.id) or (obj.loditr ~= nil and attachedID == obj.loditr.id) or (obj.lodifp ~= nil and attachedID == obj.lodifp.id) or (obj.lodifv ~= nil and attachedID == obj.lodifv.id) then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,4,true);
        ActivateObject(12,false);
        Set_Anim_Cur(12,3);
        playeffect("statuetka")
        flags.idol_three = true;
        StopEmiter("vaza");
        if flags.idol_one and flags.idol_two and flags.idol_four and flags.idol_five then
          Block_Show_Cur(true);
          StartTimer(88815,0.5);
        return; end;
      return; end;
     CreatePlashechka(900000,"562")
    return; end;
    -------------
    ----4-й идол-
    if obj_id == 13 then
      if (obj.lodio ~= nil and attachedID == obj.lodio.id) or (obj.lodit ~= nil and attachedID == obj.lodit.id) or (obj.loditr ~= nil and attachedID == obj.loditr.id) or (obj.lodifp ~= nil and attachedID == obj.lodifp.id) or (obj.lodifv ~= nil and attachedID == obj.lodifv.id) then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,5,true);
        ActivateObject(13,false);
        Set_Anim_Cur(13,3);
        playeffect("statuetka")
        flags.idol_four = true;
        StopEmiter("kanistra");
        if flags.idol_one and flags.idol_two and flags.idol_three and flags.idol_five then
          Block_Show_Cur(true);
          StartTimer(88815,0.5);
        return; end;
      return; end;
      CreatePlashechka(900000,"562")
    return; end;
    -------------
    ----5-й идол-
    if obj_id == 14 then
      if (obj.lodio ~= nil and attachedID == obj.lodio.id) or (obj.lodit ~= nil and attachedID == obj.lodit.id) or (obj.loditr ~= nil and attachedID == obj.loditr.id) or (obj.lodifp ~= nil and attachedID == obj.lodifp.id) or (obj.lodifv ~= nil and attachedID == obj.lodifv.id) then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,6,true);
        ActivateObject(14,false);
        Set_Anim_Cur(14,3);
        playeffect("statuetka")
        flags.idol_five = true;
        StopEmiter("pjatnashki");
        if flags.idol_one and flags.idol_two and flags.idol_three and flags.idol_four then
          Block_Show_Cur(true);
          StartTimer(88815,0.5);
        return; end;
      return; end;
      CreatePlashechka(900000,"562")
    return; end;
    -------------
    if obj_id == 7 then
        RemObjFromMouse()
        IsMiniGame=true        
        Set_Sat("zamok_in_world",20,11,"to_another_world")
    return; end;
  return; end;
  
  if sender == 36 then      
    if obj_id == 88815 then
      AddParticleToObject(1,"conteiner",508,390);
      MoveEmiter("conteiner",508,390);
      StartEmiter("conteiner");    
      speciale_action(2,7)
      Set_Anim_Cur(7,2);
      Block_Show_Cur(false);
    AddParticleToObject(811,"EyeS1",166,191);
    MoveEmiter("EyeS1",166,191);
    StartEmiter("EyeS1");

    AddParticleToObject(804,"EyeS2",212,188);
    MoveEmiter("EyeS2",212,188);
    StartEmiter("EyeS2");

    AddParticleToObject(805,"EyeS3",161,375);
    MoveEmiter("EyeS3",161,375);
    StartEmiter("EyeS3");

    AddParticleToObject(806,"EyeS4",211,374);
    MoveEmiter("EyeS4",211,374);
    StartEmiter("EyeS4");

    AddParticleToObject(807,"EyeS5",826,203);
    MoveEmiter("EyeS5",826,203);
    StartEmiter("EyeS5");

    AddParticleToObject(808,"EyeS6",851,202);
    MoveEmiter("EyeS6",851,202);
    StartEmiter("EyeS6");
    AddParticleToObject(809,"EyeS7",830,392);
    MoveEmiter("EyeS7",830,392);
    StartEmiter("EyeS7");
    AddParticleToObject(810,"EyeS8",857,392);
    MoveEmiter("EyeS8",857,392);
    StartEmiter("EyeS8");
    AddParticleToObject(800,"EyeG",460,48);
    MoveEmiter("EyeG",460,48);
    StartEmiter("EyeG");
    AddParticleToObject(803,"EyeG1",556,48);
    MoveEmiter("EyeG1",556,48);
    StartEmiter("EyeG1");        
    return; end;

  return; end;

  
end
function SheetSwitched(nCount)
end;