{
if(playable == null || count < 1)
{
return;
}
L2Playable player;
if(playable.isSummon())
{
player = playable.getPlayer();
}
else
{
player = playable;
}
Inventory inv = player.getInventory();
if(inv == null)
{
return;
}
L2ItemInstance[] items = inv.getItems();
for(L2ItemInstance item : items)
{
if(item.getObjectId() == item_obj_id && count > 0)
{
long item_count = item.getCount();
int item_id = item.getItemId();
long removed = count <= item_count ? count : item_count;
player.getInventory().destroyItem(item, removed, true);
if(removed > 1)
{
player.sendPacket(SystemMessage.removeItems(item_id, removed));
}
}
}
}