Esempio n. 1
0
        private void BeginSequence()
        {
            m_Sequencing = false;

            if (m_ToTransport.Count == 0)
            {
                m_NextBossEncounter = DateTime.UtcNow + EncounterCheckDuration;
                m_SequenceAlignment = Alignment.Neutral;
                return;
            }

            if (m_SequenceAlignment == Alignment.Good)
            {
                m_Boss = new AndrosTheDreadLord();
            }
            else
            {
                m_Boss = new AdrianTheGloriousLord();
            }

            ResetSpawners(false);

            m_Boss.MoveToWorld(BossLocation, Map.Trammel);
            m_DeadLine = DateTime.UtcNow + DeadLineDuration;

            BeginSequenceTimer();
            KickFromBossRegion(false);

            Timer.DelayCall(TimeSpan.FromSeconds(60), new TimerCallback(TransportPlayers));

            Timer.DelayCall(TimeSpan.FromSeconds(12), new TimerStateCallback(SendReadyMessage_Callback), 1153339); // You have been called to assist in a fight of good versus evil. Fight your way to the Lake, and defeat the enemy overlord and its lieutenants!
            Timer.DelayCall(TimeSpan.FromSeconds(24), new TimerStateCallback(SendReadyMessage_Callback), 1153340); // The Overlord is shielded from all attacks by players, but not by creatures possessed by Wisp Orbs. You must protect your controlled creature as it fights.
            Timer.DelayCall(TimeSpan.FromSeconds(36), new TimerStateCallback(SendReadyMessage_Callback), 1153341); // The Lieutenants are vulnerable to your attacks. If you die during this battle, your possessed creature will fall. Furthermore, your ghost and your corpse will be teleported back to your home base.
        }
        public DespiseController()
            : base(3806)
        {
            Movable = false;
            Visible = false;

            m_Enabled = true;
            m_Instance = this;

            m_NextBossEncounter = DateTime.Now;
            m_Boss = null;

            if(m_Enabled)
                BeginTimer();

            CreateSpawners();
        }
Esempio n. 3
0
        private void EndSequence()
        {
            if (m_Boss != null && !m_Boss.Deleted)
            {
                m_Boss.Delete();
            }

            m_Boss = null;
            EndCleanupTimer();
            KickFromBossRegion(false);
            m_SequenceAlignment = Alignment.Neutral;

            m_DeadLine = DateTime.MinValue;
            m_ToTransport.Clear();

            Timer.DelayCall(TimeSpan.FromSeconds(10), () => ResetSpawners(true));

            m_NextBossEncounter = DateTime.UtcNow + EncounterCheckDuration;
        }
Esempio n. 4
0
        public DespiseController()
            : base(3806)
        {
            Movable = false;
            Visible = false;

            m_Enabled  = true;
            m_Instance = this;

            m_NextBossEncounter = DateTime.UtcNow;
            m_Boss = null;

            if (m_Enabled)
            {
                BeginTimer();
            }

            CreateSpawners();
        }
Esempio n. 5
0
        public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();

            m_EvilSpawners = new List<XmlSpawner>();
            m_GoodSpawners = new List<XmlSpawner>();

            m_Instance = this;
			m_Enabled = reader.ReadBool();
			m_NextBossEncounter = reader.ReadDateTime();
			m_Boss = reader.ReadMobile() as DespiseBoss;
			m_DeadLine = reader.ReadDateTime();
			m_SequenceAlignment = (Alignment)reader.ReadInt();

            int count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                    m_GoodSpawners.Add(spawner);
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                    m_EvilSpawners.Add(spawner);
            }

            //Conversion to new Point System
            if (version == 0)
            {
                count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    Mobile m = reader.ReadMobile();
                    int points = reader.ReadInt();

                    if (m != null && points > 0)
                        Server.Engines.Points.PointsSystem.DespiseCrystals.ConvertFromOldSystem((PlayerMobile)m, points);
                        //m_PointsTable[m] = points;
                }
            }

			if(!m_Enabled)
				return;
				
			BeginTimer();
			
			if(m_DeadLine > DateTime.Now)
			{
				if(m_Boss != null && m_Boss.Alive)
				{
					BeginSequenceTimer();
					return;
				}
			}
			else if (m_DeadLine != DateTime.MinValue)
			{
				BeginCleanupTimer();
				return;
			}
			
			EndSequence();

            if (m_GoodSpawners.Count == 0 && m_EvilSpawners.Count == 0)
                CreateSpawners();
		}
Esempio n. 6
0
        private void EndSequence()
        {
            if (m_Boss != null && !m_Boss.Deleted)
                m_Boss.Delete();

            m_Boss = null;
            EndCleanupTimer();
            KickFromBossRegion(false);
            m_SequenceAlignment = Alignment.Neutral;

            m_DeadLine = DateTime.MinValue;
            m_ToTransport.Clear();

            ResetSpawners(true);

            m_NextBossEncounter = DateTime.Now + EncounterCheckDuration;
        }
Esempio n. 7
0
        private void BeginSequence()
        {
            m_Sequencing = false;

            if (m_ToTransport.Count == 0)
            {
                m_NextBossEncounter = DateTime.Now + EncounterCheckDuration;
                m_SequenceAlignment = Alignment.Neutral;
                return;
            }

            if (m_SequenceAlignment == Alignment.Good)
                m_Boss = new AndrosTheDreadLord();
            else
                m_Boss = new AdrianTheGloriousLord();

            ResetSpawners(false);

            m_Boss.MoveToWorld(BossLocation, Map.Trammel);
            m_DeadLine = DateTime.Now + DeadLineDuration;
            //m_NextBossEncounter = DateTime.MinValue;

            BeginSequenceTimer();
            KickFromBossRegion(false);

            Timer.DelayCall(TimeSpan.FromSeconds(60), new TimerCallback(TransportPlayers));

            Timer.DelayCall(TimeSpan.FromSeconds(12), new TimerStateCallback(SendReadyMessage_Callback), 1153339); // You have been called to assist in a fight of good versus evil. Fight your way to the Lake, and defeat the enemy overlord and its lieutenants!
            Timer.DelayCall(TimeSpan.FromSeconds(24), new TimerStateCallback(SendReadyMessage_Callback), 1153340); // The Overlord is shielded from all attacks by players, but not by creatures possessed by Wisp Orbs. You must protect your controlled creature as it fights.
            Timer.DelayCall(TimeSpan.FromSeconds(36), new TimerStateCallback(SendReadyMessage_Callback), 1153341); // The Lieutenants are vulnerable to your attacks. If you die during this battle, your possessed creature will fall. Furthermore, your ghost and your corpse will be teleported back to your home base.
        }
Esempio n. 8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_EvilSpawners = new List <XmlSpawner>();
            m_GoodSpawners = new List <XmlSpawner>();

            m_Instance          = this;
            m_Enabled           = reader.ReadBool();
            m_NextBossEncounter = reader.ReadDateTime();
            m_Boss              = reader.ReadMobile() as DespiseBoss;
            m_DeadLine          = reader.ReadDateTime();
            m_SequenceAlignment = (Alignment)reader.ReadInt();

            if (version < 4)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(30), CheckSpawnersVersion3);
            }

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                {
                    m_GoodSpawners.Add(spawner);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                {
                    m_EvilSpawners.Add(spawner);
                }
            }

            //Conversion to new Point System
            if (version == 0)
            {
                count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    Mobile m      = reader.ReadMobile();
                    int    points = reader.ReadInt();

                    if (m != null && points > 0)
                    {
                        Server.Engines.Points.PointsSystem.DespiseCrystals.ConvertFromOldSystem((PlayerMobile)m, points);
                    }
                }
            }

            if (!m_Enabled)
            {
                return;
            }

            BeginTimer();

            if (m_DeadLine > DateTime.UtcNow)
            {
                if (m_Boss != null && m_Boss.Alive)
                {
                    BeginSequenceTimer();
                    return;
                }
            }
            else if (m_DeadLine != DateTime.MinValue)
            {
                BeginCleanupTimer();
                return;
            }

            EndSequence();

            if (m_GoodSpawners.Count == 0 && m_EvilSpawners.Count == 0)
            {
                CreateSpawners();
            }

            if (version < 2)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(30), RemoveAnkh);
            }
        }
Esempio n. 9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_EvilSpawners = new List <XmlSpawner>();
            m_GoodSpawners = new List <XmlSpawner>();

            m_Instance          = this;
            m_Enabled           = reader.ReadBool();
            m_NextBossEncounter = reader.ReadDateTime();
            m_Boss              = reader.ReadMobile() as DespiseBoss;
            m_DeadLine          = reader.ReadDateTime();
            m_SequenceAlignment = (Alignment)reader.ReadInt();

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                {
                    m_GoodSpawners.Add(spawner);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                XmlSpawner spawner = reader.ReadItem() as XmlSpawner;
                if (spawner != null)
                {
                    m_EvilSpawners.Add(spawner);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                Mobile m      = reader.ReadMobile();
                int    points = reader.ReadInt();

                if (m != null && points > 0)
                {
                    m_PointsTable[m] = points;
                }
            }

            if (!m_Enabled)
            {
                return;
            }

            BeginTimer();

            if (m_DeadLine > DateTime.Now)
            {
                if (m_Boss != null && m_Boss.Alive)
                {
                    BeginSequenceTimer();
                    return;
                }
            }
            else if (m_DeadLine != DateTime.MinValue)
            {
                BeginCleanupTimer();
                return;
            }

            EndSequence();
        }