protected bool ReadMaterials(Creature creature, Packet packet, out List<ProductionMaterial> materials)
{
materials = new List<ProductionMaterial>();
var count = packet.GetByte();
for (int i = 0; i < count; ++i)
{
var itemEntityId = packet.GetLong();
var amount = packet.GetShort();
// Check item
var item = creature.Inventory.GetItem(itemEntityId);
if (item == null)
{
Log.Warning("CreationSkill.ReadMaterials: Creature '{0:X16}' tried to use non-existent material item.", creature.EntityId);
return false;
}
materials.Add(new ProductionMaterial(item, amount));
}
return true;
}
}