public byte[] Dummy = new byte[31]; // Probably guild name... Or I'm out of ideas. public CharacterShape(Character character) { CharId = character.Id; IsDead = character.IsDead; Motion = character.Motion; Country = character.Country; Race = character.Race; Hair = character.Hair; Face = character.Face; Height = character.Height; Class = character.Class; Gender = character.Gender; Mode = character.Mode; Kills = character.Kills; Name = character.NameAsByteArray; for (byte i = 0; i < 17; i++) { character.InventoryItems.TryGetValue((0, i), out var item); EquipmentItems[i] = new EquipmentItem(item); if (item != null) { EquipmentItemHasColor[i] = item.DyeColor.IsEnabled; if (item.DyeColor.IsEnabled) { EquipmentItemColor[i] = new DyeColorSerialized(item.DyeColor.Saturation, item.DyeColor.R, item.DyeColor.G, item.DyeColor.B); } } } if (character.HasParty) { if (character.IsPartyLead) { PartyDefinition = 2; } else { PartyDefinition = 1; } } else { PartyDefinition = 0; } }
public CharacterEquipmentChange(int characterId, byte slot, Item item) { CharacterId = characterId; Slot = slot; if (item != null) { Type = item.Type; TypeId = item.TypeId; EnchantLevel = 20; // TODO: implement enchant here. HasColor = item.DyeColor.IsEnabled; if (HasColor) { DyeColor = new DyeColorSerialized(item.DyeColor.Saturation, item.DyeColor.R, item.DyeColor.G, item.DyeColor.B); } } }