void main()

{
   object oPC = GetPCSpeaker();
   int antal = 10;
   string tag = "bloodofberserk";

   object oItem = GetFirstItemInInventory( oPC );
   int count = 0;
   int stackSize;
   int i;

   while(GetIsObjectValid(oItem) && count < antal)
   {
      // Check tag
        if (GetTag(oItem) == tag)
        {
           stackSize = GetItemStackSize(oItem);
           if(stackSize == 1)
           {
              DestroyObject(oItem);
           }
           else
           {
              for(i=0; i<stackSize; i++)
              {
                 SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
                 count+=1;
                 if(count == antal)
                 {
                    return;
                 }
              }
              // Take care of last one.
              DestroyObject(oItem);
           }
        }
        oItem = GetNextItemInInventory(oPC);
   }
   return;
}