public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int)8); // version writer.Write((bool)m_Exceptional); writer.Write((bool)m_PlayerConstructed); writer.Write((Mobile)m_Crafter); m_AbsorptionAttributes.Serialize(writer); writer.WriteEncodedInt((int)m_TimesImbued); writer.WriteEncodedInt((int)m_MaxHitPoints); writer.WriteEncodedInt((int)m_HitPoints); writer.WriteEncodedInt((int)m_Resource); writer.WriteEncodedInt((int)m_GemType); m_AosAttributes.Serialize(writer); m_AosResistances.Serialize(writer); m_SkillBonuses.Serialize(writer); }
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); } }