local need_all = 0;

function Buttons_T(sender,obj_id)
    ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"parom",false)    
end; 


function gameinput (sender,obj_id,attachedID)   
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID); 
  if sender == 30 then
        DeleteResource("prichal_box2");
        DeleteResource("prichal_box_b1");
        DeleteResource("prichal_box_b1");         
        DeleteResource("prichal_box8");    
        DeleteResource("prichal_box9");     
        DeleteResource("ploski");                    
    setcurentleaf("parom",9,0);    
    if flags.prichbox_open and (not flags.prichbox_openM) then
      flags.prichbox_openM=true;
      speciale_action(2,6);
      speciale_action(2,4);
      speciale_action(2,3);
      speciale_action(2,2);
      ActivateObject(4,true)
      Set_Anim_Cur(4,2);
      AddParticleToObject(4,"prichal_box",232,511);
      MoveEmiter("prichal_box",232,511);
      StartEmiter("prichal_box");      
    end;    
    Block_Show_Cur(false);
    if flags.prichal_box then
      flags.help_ploski_fomka = true;
      if not flags.prichbox_openM then
      flags.prichbox_openM=true;
      speciale_action(2,6);
      speciale_action(2,4);
      speciale_action(2,3);
      speciale_action(2,2);
      end;
      ActivateObject(4,false)
      Set_Anim_Cur(4,3);      
      StopEmiter("prichal_box");
    end;    
  return;end;
  
  if sender==15 then
    if obj_id==10 then
        speciale_action(2,9,true)
    return;end;
    if obj_id==9 then
        Block_Show_Cur(false)
        Set_Anim_Cur(11,3);
        Set_Anim_Cur(12,3);
        Set_Anim_Cur(obj.ploks.id,4);
    return;end;    
  return;end;
  
  
  if sender==50 then
        StartTimer(8882,1.5);
        Block_Show_Cur(true);
  return;end;
  
  if sender == 1 then

    if obj_id == 12 or obj_id == 11 then
      if obj.kislot ~= nil and attachedID == obj.kislot.id then
          RemObjFromMouse()
        UnStoreObj(obj.kislot.id);
        Block_Show_Cur(true);                
        speciale_action(2,15,true);    
      return; end;
      if attachedID~=-1 and ((obj.kislot~=nil and attachedID ~= obj.kislot.id) or (obj.kislot==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;    
        CreatePlashechka(900000,"119")
    return; end;
    if obj_id == obj.ploks.id then
       RemObjFromMouse()    
        flags.prichal_box = true;
       StoreObj(obj.plosk.id,obj_id,"117",285,350,"ploski",323,217)    
    return; end;

    
  return ;end;
  
  if sender == 16 then
    if obj_id==15 then
        speciale_action(2,15,true,1)
        StartEmiter("kap")
        playeffect("acid")
        StartTimer(8888,1)
        StartTimer(8889,1.1)
    
    return;end;
    if obj_id==10 then
        speciale_action(2,10,true)
    return;end;
  return; end;
  
  if sender == 36 then
    if obj_id == 8882 then
     
      Block_Show_Cur(false);
      UnStoreObj(obj.kislot.id);
      clear_satelite_leaf("parom");
    return; end;
    if obj_id==8883 or obj_id==8887 then
        if not flags.chain1 then 
            flags.chain1=true;  
            speciale_action(2,12,true);
            speciale_action(2,11,true);            
        return;end;
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,11,true);
        speciale_action(2,10,true);    
        flags.prichbox_open=true;    
    return;end;
    if obj_id==8884 then
       StopEmiter("kislota",true)
    return;end;
    if obj_id==8886 then
       StopEmiter("kislota1",true)
    return;end;    
    if obj_id==8885 then
        speciale_action(2,15,true,1)
    return;end;    
    if obj_id==8888 then
        StopEmiter("kap")
    return;end;        
    if obj_id==8889 then
            if not kapaem then
            kapaem=true
            MoveEmiter("kap",586,102)
            SetObjectPosition(15,586,72)
            StartEmiter("kislota")            
            StartTimer(8883,5)
            StartTimer(8884,3.5)
            StartTimer(8885,2)    
            return;end;
        StartEmiter("kislota1")
        StartTimer(8887,5)           
        StartTimer(8886,3.5)            
    return;end;        
  return; end;
  
end
function SheetSwitched(nCount)
end;