public static CharacterMountRecord New(CharacterItemRecord item) { MountRecord template = MountRecord.GetMount(item.GId); long uid = CharactersMounts.DynamicPop(x => x.UId); return(new CharacterMountRecord(uid, item.CharacterId, false, true, false, false, template.Id, DefaultMountName, template.Effects.ConvertAll <EffectInteger>(x => x.GenerateEffect() as EffectInteger), false, false)); }
public static void SynchnronizeMounts() { BigEndianReader reader = new BigEndianReader(File.ReadAllBytes(MountsPath)); while (reader.BytesAvailable > 0) { MA3Mount mount = new MA3Mount(); mount.Deserialize(reader); var record = MountRecord.GetMount(mount.Id); if (record == null) { var itemRecord = ItemRecord.Items.Find(x => x.Name == mount.Name); MountRecord newRecord = new MountRecord(mount.Id, mount.Name, ContextActorLook.Parse(mount.Look), itemRecord.Id, new List <Models.Effects.EffectInstance>()); newRecord.AddInstantElement(); logger.Gray(mount.Name + " added to mount records."); } } }