if(fee + adenaDeposit > activeChar.getAdena())
{
activeChar.sendPacket(Msg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
return;
}
Warehouse warehouse = new PcFreight(_objectID);
// Item Max Limit Check
if(_items.size() + warehouse.listItems(ItemClass.ALL).length > activeChar.getFreightLimit())
{
activeChar.sendPacket(Msg.THE_CAPACITY_OF_THE_WAREHOUSE_HAS_BEEN_EXCEEDED);
return;
}
// Transfer the items from activeChar's Inventory Instance to destChar's Freight Instance
for(Integer itemObjectId : _items.keySet())
{
L2ItemInstance found = inventory.getItemByObjectId(itemObjectId);
if(found == null || !found.canBeDropped(activeChar, false))
{
continue;
}
warehouse.addItem(inventory.dropItem(found, _items.get(itemObjectId), false), null);
}
activeChar.reduceAdena(fee, true);
activeChar.updateStats();
// Delete destination L2Player used for freight
activeChar.sendPacket(Msg.THE_TRANSACTION_IS_COMPLETE);