var k = [];
for (var i = 0; i < spawnedEntities.length; i++) {
    var ent = spawnedEntities[i];
    ent.maxHealth = 30
    ent.health = 30
}
function drop(ent) {
    var rand = Math.floor(Math.random() * 10);
    if (rand < 2) {
        ent.dropItem(Item(288, 1+Math.floor(Math.random() * 3)));
    }
    else if (rand == 3) {
        ent.dropItem(Item(296, 1));
    }
    else if (rand == 4) {
        ent.dropItem(Item(337, 1+Math.floor(Math.random() * 3)));
    }
    else if (rand > 8)  {
      var aCount = 0;
      if (pinv.getSlotContainingItem(472) != -1) {
        for(i=0;i<=35;i++)
        {
          if(pinv.getItemInSlot(i) != null)
          {
            var curItem = pinv.getItemInSlot(i);
            if (curItem.getItemID() == 472) {
              if (curItem.getQuantity() > 0) {
                aCount += curItem.getQuantity();
              }
            }
          }
        }
      }
      if (Math.random() * 25 > aCount*aCount) {
        ent.dropItem(Item(472, 1 ));
      }
    }
    return;
}