Exemplo n.º 1
0
        public void Activate(Mobile m)
        {
            CheckDoors();

            DoorOne.Open   = false;
            DoorTwo.Open   = false;
            DoorOne.Locked = true;
            DoorTwo.Locked = true;

            Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241);
            Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241);

            if (Guardians == null)
            {
                Guardians = new List <DarkGuardian>();
            }

            int count = 0;

            foreach (var mob in this.GetEnumeratedMobiles().Where(mob => mob is PlayerMobile || (mob is BaseCreature && ((BaseCreature)mob).GetMaster() != null && !mob.IsDeadBondedPet)))
            {
                if (mob.NetState != null)
                {
                    mob.SendLocalizedMessage(1050000, "", 365); // The locks on the door click loudly and you begin to hear a faint hissing near the walls.
                }
                if (mob.Alive)
                {
                    count++;
                }
            }

            count = Math.Max(1, count * 2);

            for (int i = 0; i < count; i++)
            {
                DarkGuardian guardian = new DarkGuardian();

                int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width);
                int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height);
                int z = Map.Malas.GetAverageZ(x, y);

                guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas);
                Guardians.Add(guardian);

                guardian.Combatant = m;
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
        }
Exemplo n.º 2
0
        public void SpawnGuardians(int amount)
        {
            for (int i = 0; i < amount; ++i)
            {
                DarkGuardian guardian = new DarkGuardian();

                switch (Utility.Random(4))
                {
                case 0: guardian.MoveToWorld(new Point3D(364, 15, -1), Map.Malas); break;

                case 1: guardian.MoveToWorld(new Point3D(366, 15, -1), Map.Malas); break;

                case 2: guardian.MoveToWorld(new Point3D(365, 14, -1), Map.Malas); break;

                case 3: guardian.MoveToWorld(new Point3D(365, 16, -1), Map.Malas); break;
                }

                m_Guardians.Add(guardian);
            }
        }
Exemplo n.º 3
0
        public void Activate(Mobile m)
        {
            CheckDoors();

            DoorOne.Open   = false;
            DoorTwo.Open   = false;
            DoorOne.Locked = true;
            DoorTwo.Locked = true;

            Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241);
            Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241);

            if (Guardians == null)
            {
                Guardians = new List <DarkGuardian>();
            }

            int count = MobileCount() * 2;

            for (int i = 0; i < count; i++)
            {
                DarkGuardian guardian = new DarkGuardian();

                int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width);
                int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height);
                int z = Map.Malas.GetAverageZ(x, y);

                guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas);
                Guardians.Add(guardian);

                guardian.Combatant = m;
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
        }