Ok, so basically this method should almost suit you
private void onEventDieDropItem(L2Character killer)
{
if (killer == null)
return;
L2PcInstance pk = killer.getActingPlayer();
if(pk == null) return;
List<L2ItemInstance> itemsToDrop = new FastList<L2ItemInstance>();
for (L2ItemInstance itemDrop : getInventory().getItems()) {
// Don't drop
if (
itemDrop.isShadowItem() || // Dont drop Shadow Items
!itemDrop.isDropable() ||
itemDrop.getItemId() == 57 || // Adena
itemDrop.getItem().getType2() == L2Item.TYPE2_QUEST || // Quest Items
getPet() != null && getPet().getControlItemId() == itemDrop.getItemId() || // Control Item of active pet
Arrays.binarySearch(Config.KARMA_LIST_NONDROPPABLE_ITEMS, itemDrop.getItemId()) >= 0 || // Item listed in the non droppable item list
Arrays.binarySearch(Config.KARMA_LIST_NONDROPPABLE_PET_ITEMS, itemDrop.getItemId()) >= 0 // Item listed in the non droppable pet item list
) continue;
// Don't drop if the item is not equiped
if (!itemDrop.isEquipped())
continue;
// Adding the item to the "must-drop" list
itemsToDrop.add(itemDrop);
}
int chance = pk.isInParty() && pk.getParty() != null ? 100 - pk.getParty().getMemberCount() * 10 : 100;
if (Rnd.get(100) < chance) {
L2ItemInstance itemDrop = itemsToDrop.get(Rnd.get(itemsToDrop.size() - 1));
dropItem("EventDieDrop", itemDrop, killer, true);
sendMessage("You drop " + itemDrop.getCount() + " " + itemDrop.getName());
} else {
sendMessage("You haven't dropped anything this time.");
}
}
You may want to edit it a bit for your needs though