// [StartupInvoke("Item SkinModule", StartupInvokePriority.Modules)] public static void SynchronizeItems() { BigEndianReader reader = new BigEndianReader(File.ReadAllBytes(ItemsPath)); List <MA3Item> items = new List <MA3Item>(); while (reader.BytesAvailable > 0) { MA3Item item = new MA3Item(); item.Deserialize(reader); items.Add(item); } foreach (var item in items) { ItemRecord record = ItemRecord.GetItem((ushort)item.Id); if (record != null && record.AppearanceId != item.Skin && item.Skin != 0) { if (record.Weapon) { var weaponRecord = WeaponRecord.GetWeapon((ushort)item.Id); weaponRecord.Template.AppearanceId = (ushort)item.Skin; weaponRecord.UpdateInstantElement(); } else { record.AppearanceId = (ushort)item.Skin; record.UpdateInstantElement(); } logger.Gray("Fixed: " + record.Name); } } }