protected void EquipItem(Pocket pocket, int itemId, uint color1 = 0, uint color2 = 0, uint color3 = 0, ItemState state = ItemState.Up)
{
if (this.NPC == null)
throw new InvalidOperationException("NPC's race has to be set first.");
if (!pocket.IsEquip())
{
Log.Error("Pocket '{0}' is not for equipment ({1})", pocket, this.GetType().Name);
return;
}
if (!AuraData.ItemDb.Exists(itemId))
{
Log.Error("Unknown item '{0}' ({1})", itemId, this.GetType().Name);
return;
}
var item = new Item(itemId);
item.Info.Pocket = pocket;
item.Info.Color1 = color1;
item.Info.Color2 = color2;
item.Info.Color3 = color3;
item.Info.State = (byte)state;
this.NPC.Inventory.InitAdd(item);
}