public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_MasterSphinx = reader.ReadBool(); m_Duplicates = new List <MysterySphinx>(); //Version 0 if (version >= 0) { int duplicateCount = reader.ReadInt(); for (int a = 0; a < duplicateCount; a++) { MysterySphinx MysterySphinx = reader.ReadMobile() as MysterySphinx; if (MysterySphinx != null) { m_Duplicates.Add(MysterySphinx); } } m_Transformations = reader.ReadInt(); } }
public void TransformAndRestore() { if (m_Duplicates.Count == 0) { return; } List <Point3D> m_Locations = new List <Point3D>(); for (int a = 0; a < m_Duplicates.Count; a++) { MysterySphinx mysterySphinx = m_Duplicates[a]; mysterySphinx.Restore(); m_Locations.Add(mysterySphinx.Location); } int locationCount = m_Locations.Count; if (m_Locations.Count > 0) { for (int a = 0; a < m_Duplicates.Count; a++) { int index = Utility.RandomMinMax(0, m_Locations.Count - 1); m_Duplicates[a].Location = m_Locations[index]; m_Locations.RemoveAt(index); } } for (int a = 0; a < m_Duplicates.Count; a++) { CustomizationAbilities.Vanish(m_Duplicates[a]); m_Duplicates[a].m_MasterSphinx = false; m_Duplicates[a].Say("Sorry, try again."); m_Duplicates[a].m_NextSpeechAllowed = DateTime.UtcNow + NextSpeechDelay; } MysterySphinx newMasterSphinx = m_Duplicates[Utility.RandomMinMax(0, m_Duplicates.Count - 1)]; newMasterSphinx.m_MasterSphinx = true; }