public static void EquipItem(Client client, PacketIn packet) { int itemId = (int)packet.ReadUInt32(); PlayerItem item = PlayerItem.Get(itemId); if (item == null) { ServerConsole.WriteLine( System.Drawing.Color.Red, "Player #{0} attempted to equip non-existant item!", client.Character.Player.PlayerId ); return; } if (item.PlayerId != client.Character.Player.PlayerId) { ServerConsole.WriteLine(System.Drawing.Color.Red, "Player #{0} attempted to equip item that belongs to #{1}!", client.Character.Player.PlayerId, item.PlayerId ); return; } if (!item.Wearable) { ServerConsole.WriteLine( System.Drawing.Color.Red, "Player #{0} attempted to equip non-equipable item #{1}!", item.PlayerId, item.ItemId ); return; } PlayerItem.Equip(item); client.Send(new Packets.EquipItem(item), "Equip Item"); }