示例#1
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)5); // version

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);
            SetSaveFlag(ref flags, SaveFlag.IPYInvisible, IsInvisible);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_AosResistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }
        }
示例#2
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)3);                // version

            m_AosAttributes.Serialize(writer);
            m_AosClothingAttributes.Serialize(writer);
            m_AosSkillBonuses.Serialize(writer);
            m_AosResistances.Serialize(writer);

            writer.Write((bool)m_PlayerConstructed);

            writer.Write((Mobile)m_Crafter);
            writer.Write((int)m_Quality);
        }
示例#3
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)3);                // version

            if (m_AosAttributes == null)
            {
                new AosAttributes(this).Serialize(writer);
            }
            else
            {
                m_AosAttributes.Serialize(writer);
            }

            if (m_AosClothingAttributes == null)
            {
                new AosArmorAttributes(this).Serialize(writer);
            }
            else
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (m_AosSkillBonuses == null)
            {
                new AosSkillBonuses(this).Serialize(writer);
            }
            else
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (m_AosResistances == null)
            {
                new AosAttributes(this).Serialize(writer);
            }
            else
            {
                m_AosResistances.Serialize(writer);
            }

            writer.Write((bool)m_PlayerConstructed);

            writer.Write((Mobile)m_Crafter);
            writer.Write((int)m_Quality);
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)6);                // version

            writer.Write((string)m_Crafter_Name);

            writer.Write((int)m_MaxHitPoints);
            writer.Write((int)m_HitPoints);

            writer.Write((int)m_Resource);

            m_AosAttributes.Serialize(writer);
            m_AosClothingAttributes.Serialize(writer);
            m_AosSkillBonuses.Serialize(writer);
            m_AosResistances.Serialize(writer);

            writer.Write((bool)m_PlayerConstructed);

            writer.Write((Mobile)m_Crafter);
            writer.Write((int)m_Quality);
        }
示例#5
0
        public override void Serialize(GenericWriter writer)
        {
            #region Ethics
            if (m_EthicState != null && m_EthicState.HasExpired)
            {
                m_EthicState.Detach();
            }
            #endregion

            #region Factions
            if (m_FactionState != null && m_FactionState.HasExpired)
            {
                m_FactionState.Detach();
            }
            #endregion

            base.Serialize(writer);

            writer.Write((int)5);                // version

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != ClothingQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);
            SetSaveFlag(ref flags, SaveFlag.Identified, m_Identified != false);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_AosResistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.WriteEncodedInt((int)m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.WriteEncodedInt((int)m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }
        }
示例#6
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)9);                // version

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_ClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_SkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_Resistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Exceptional, m_Exceptional != false);
            SetSaveFlag(ref flags, SaveFlag.AbsorptionAttributes, !m_AbsorptionAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Altered, m_Altered);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.Write((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_ClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_SkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_Resistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.Write((int)m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.Write((int)m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.AbsorptionAttributes))
            {
                m_AbsorptionAttributes.Serialize(writer);
            }
        }
示例#7
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)5);                // version

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.SpellEffect, m_Effect != SpellEffect.None && m_EffectCharges > 0);
            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != ClothingQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.SpellEffect))
            {
                writer.Write((bool)m_Identified);
                writer.WriteEncodedInt((int)m_Effect);
                writer.WriteEncodedInt((int)m_EffectCharges);
            }

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_AosResistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.WriteEncodedInt((int)m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.WriteEncodedInt((int)m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)6);                // version

            #region Set Items

            SetFlag sflags = SetFlag.None;

            SetSaveFlag(ref sflags, SetFlag.Attributes, !m_SetAttributes.IsEmpty);
            SetSaveFlag(ref sflags, SetFlag.SkillBonuses, !m_SetSkillBonuses.IsEmpty);
            SetSaveFlag(ref sflags, SetFlag.SetHue, m_SetHue != 0);
            SetSaveFlag(ref sflags, SetFlag.LastEquipped, m_LastEquipped);
            SetSaveFlag(ref sflags, SetFlag.SetEquipped, m_SetEquipped);

            writer.WriteEncodedInt((int)sflags);

            if (GetSaveFlag(sflags, SetFlag.Attributes))
            {
                m_SetAttributes.Serialize(writer);
            }

            if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
            {
                m_SetSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(sflags, SetFlag.SetHue))
            {
                writer.WriteEncodedInt((int)m_SetHue);
            }

            if (GetSaveFlag(sflags, SetFlag.LastEquipped))
            {
                writer.Write((bool)m_LastEquipped);
            }

            if (GetSaveFlag(sflags, SetFlag.SetEquipped))
            {
                writer.Write((bool)m_SetEquipped);
            }


            #endregion

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != ClothingQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);


            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_AosResistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.WriteEncodedInt((int)m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.WriteEncodedInt((int)m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }
        }
示例#9
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write(7);               // version

            writer.Write(DonationClothing);
            writer.Write(Owner);

            writer.Write(m_IsRenamed);

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != ClothingQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
            {
                m_AosClothingAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Resistances))
            {
                m_AosResistances.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.WriteEncodedInt(m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.WriteEncodedInt(m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write(m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt(m_StrReq);
            }
        }
示例#10
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)1);                // version

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ArmorAttributes, !m_AosArmorAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != CraftQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);
            SetSaveFlag(ref flags, SaveFlag.DexReq, m_DexReq != -1);
            SetSaveFlag(ref flags, SaveFlag.IntReq, m_IntReq != -1);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
            SetSaveFlag(ref flags, SaveFlag.BonusRandomAttributes, m_BonusRandomAttributes != null && m_BonusRandomAttributes.Length > 0);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ArmorAttributes))
            {
                m_AosArmorAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                writer.WriteEncodedInt((int)m_Resource);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }

            if (GetSaveFlag(flags, SaveFlag.DexReq))
            {
                writer.WriteEncodedInt((int)m_DexReq);
            }

            if (GetSaveFlag(flags, SaveFlag.IntReq))
            {
                writer.WriteEncodedInt((int)m_IntReq);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.BonusRandomAttributes))
            {
                writer.Write(m_BonusRandomAttributes.Length);
                for (int i = 0; i < m_BonusRandomAttributes.Length; i++)
                {
                    m_BonusRandomAttributes[i].Serialize(writer);
                }
            }
        }
示例#11
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)8);                // version

            writer.WriteMobileList(m_Identified);

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.ArmorAttributes, !m_AosArmorAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.PhysicalBonus, m_PhysicalBonus != 0);
            SetSaveFlag(ref flags, SaveFlag.FireBonus, m_FireBonus != 0);
            SetSaveFlag(ref flags, SaveFlag.ColdBonus, m_ColdBonus != 0);
            SetSaveFlag(ref flags, SaveFlag.PoisonBonus, m_PoisonBonus != 0);
            SetSaveFlag(ref flags, SaveFlag.EnergyBonus, m_EnergyBonus != 0);
            //SetSaveFlag( ref flags, SaveFlag.Identified,		m_Identified != false );
            SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
            SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
            SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != CraftQuality.Regular);
            SetSaveFlag(ref flags, SaveFlag.Durability, m_Durability != DurabilityLevel.Regular);
            SetSaveFlag(ref flags, SaveFlag.Protection, m_Protection != ArmorProtectionLevel.Regular);
            SetSaveFlag(ref flags, SaveFlag.BaseArmor, m_ArmorBase != -1);
            SetSaveFlag(ref flags, SaveFlag.StrBonus, m_StrBonus != -1);
            SetSaveFlag(ref flags, SaveFlag.DexBonus, m_DexBonus != -1);
            SetSaveFlag(ref flags, SaveFlag.IntBonus, m_IntBonus != -1);
            SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);
            SetSaveFlag(ref flags, SaveFlag.DexReq, m_DexReq != -1);
            SetSaveFlag(ref flags, SaveFlag.IntReq, m_IntReq != -1);
            SetSaveFlag(ref flags, SaveFlag.MedAllowance, m_Meditate != (AMA)(-1));
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);

            writer.WriteEncodedInt((int)flags);

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.ArmorAttributes))
            {
                m_AosArmorAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.PhysicalBonus))
            {
                writer.WriteEncodedInt((int)m_PhysicalBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.FireBonus))
            {
                writer.WriteEncodedInt((int)m_FireBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.ColdBonus))
            {
                writer.WriteEncodedInt((int)m_ColdBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.PoisonBonus))
            {
                writer.WriteEncodedInt((int)m_PoisonBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.EnergyBonus))
            {
                writer.WriteEncodedInt((int)m_EnergyBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
            {
                writer.WriteEncodedInt((int)m_MaxHitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.HitPoints))
            {
                writer.WriteEncodedInt((int)m_HitPoints);
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                writer.Write((Mobile)m_Crafter);
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                writer.WriteEncodedInt((int)m_Quality);
            }

            if (GetSaveFlag(flags, SaveFlag.Durability))
            {
                writer.WriteEncodedInt((int)m_Durability);
            }

            if (GetSaveFlag(flags, SaveFlag.Protection))
            {
                writer.WriteEncodedInt((int)m_Protection);
            }

            if (GetSaveFlag(flags, SaveFlag.BaseArmor))
            {
                writer.WriteEncodedInt((int)m_ArmorBase);
            }

            if (GetSaveFlag(flags, SaveFlag.StrBonus))
            {
                writer.WriteEncodedInt((int)m_StrBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.DexBonus))
            {
                writer.WriteEncodedInt((int)m_DexBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.IntBonus))
            {
                writer.WriteEncodedInt((int)m_IntBonus);
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                writer.WriteEncodedInt((int)m_StrReq);
            }

            if (GetSaveFlag(flags, SaveFlag.DexReq))
            {
                writer.WriteEncodedInt((int)m_DexReq);
            }

            if (GetSaveFlag(flags, SaveFlag.IntReq))
            {
                writer.WriteEncodedInt((int)m_IntReq);
            }

            if (GetSaveFlag(flags, SaveFlag.MedAllowance))
            {
                writer.WriteEncodedInt((int)m_Meditate);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }
        }