Exemplo n.º 1
0
            protected override void OnTick()
            {
                if (m_Chest != null)
                {
                    m_Chest.Delete();
                }

                int x      = Utility.Random(m_Rect.X, m_Rect.Width);
                int y      = Utility.Random(m_Rect.Y, m_Rect.Height);
                int itemID = Utility.RandomList(m_Chest.ItemIDs);

                GuardianTreasureChest chest = new GuardianTreasureChest(itemID);

                chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas);
            }
Exemplo n.º 2
0
        public void Setup()
        {
            m_Door = new GuardianDoor(DoorFacing.SouthCW);

            m_Door.MoveToWorld(new Point3D(355, 15, -1), Map.Malas);

            m_CanActive = true;

            for (int i = 0; i < 3; i++)
            {
                int x = Utility.Random(Rect.X, Rect.Width);
                int y = Utility.Random(Rect.Y, Rect.Height);

                GuardianTreasureChest chest = new GuardianTreasureChest(0xE41);

                int itemID = Utility.RandomList(chest.ItemIDs);

                chest.ItemID = itemID;

                chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas);
            }
        }
Exemplo n.º 3
0
 public InternalTimer(GuardianTreasureChest chest)
     : base(TimeSpan.FromMinutes(1.0))
 {
     m_Chest = chest;
 }
Exemplo n.º 4
0
            protected override void OnTick()
            {
                if ( m_Chest != null )
                    m_Chest.Delete();

                int x = Utility.Random( m_Rect.X, m_Rect.Width );
                int y = Utility.Random( m_Rect.Y, m_Rect.Height );
                int itemID = Utility.RandomList( m_Chest.ItemIDs );

                GuardianTreasureChest chest = new GuardianTreasureChest( itemID );
                chest.MoveToWorld( new Point3D( x, y, -1 ), Map.Malas );
            }
Exemplo n.º 5
0
 public InternalTimer( GuardianTreasureChest chest )
     : base(TimeSpan.FromMinutes( 1.0 ))
 {
     m_Chest = chest;
 }
Exemplo n.º 6
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (!Rect.Contains(m.Location) || m is BaseCreature)
            {
                return;
            }

            if (m != null && m_Door != null && !m_Door.Locked && !m_Door.Open && m_Door.Link != null && !m_Door.Link.Locked && !m_Door.Link.Open && m.IsPlayer && m.Alive && m_CanActive)
            {
                m_CanActive = false;                 //Carrabas: Moved this here so it will not execute the OnMovement more than once while executing the loops

                int guardianCount = 0;

                foreach (var mobile in Map.GetMobilesInBounds(Rect).ToArray())
                {
                    if (!(mobile is DarkGuardian))
                    {
                        if (mobile.IsPlayer)
                        {
                            mobile.SendLocalizedMessage(1050000, null, 0x41);                               // The locks on the door click loudly and you begin to hear a faint hissing near the walls.
                        }
                        guardianCount += 2;
                    }
                }

                if (guardianCount > 12)
                {
                    guardianCount = 12;
                }

                for (int j = 0; j < guardianCount; j++)
                {
                    DarkGuardian guard = new DarkGuardian();

                    guard.Map      = Map.Malas;
                    guard.Location = guard.Map.GetSpawnPosition(new Point3D(365, 15, -1), 8);
                }

                for (int i = 0; i < 5; i++)
                {
                    int x = Utility.Random(Rect.X, Rect.Width);
                    int y = Utility.Random(Rect.Y, Rect.Height);

                    GuardianTreasureChest chest = new GuardianTreasureChest(0xE41);

                    int itemID = Utility.RandomList(chest.ItemIDs);

                    chest.ItemID = itemID;
                    chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas);
                }

                m_Door.Locked      = true;
                m_Door.Link.Locked = true;

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

                m_Timer = new PoisonTimer(this);
                m_Timer.Start();
            }
        }
Exemplo n.º 7
0
 public InternalTimer(GuardianTreasureChest chest) : base(TimeSpan.FromMinutes(Utility.Random(1, 2)))
 {
     m_Chest = chest;
 }