GetTime() public static method

public static GetTime ( Server.Map map, int x, int &hours, int &minutes ) : void
map Server.Map
x int
hours int
minutes int
return void
Ejemplo n.º 1
0
		public override void OnDoubleClick( Mobile from )
		{
			from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "You peer into the heavens, seeking the moons..." ); // You peer into the heavens, seeking the moons...

            switch ((int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y))
            {
                case 0: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a new moon"); break;
                case 1: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a waxing crescent moon"); break;
                case 2: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: in the first quarter"); break;
                case 3: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: waxing gibbous"); break;
                case 4: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a full moon"); break;
                case 5: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: waning gibbous"); break;
                case 6: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: in its last quarter"); break;
                case 7: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a waning crescent"); break;
                case 8: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: big and round, a satellite, and made of cheese"); break;
            }
            switch ((int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y))
            {
                case 0: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a new moon"); break;
                case 1: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a waxing crescent moon"); break;
                case 2: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: in the first quarter"); break;
                case 3: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: waxing gibbous"); break;
                case 4: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a full moon"); break;
                case 5: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: waning gibbous"); break;
                case 6: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: in its last quarter"); break;
                case 7: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a waning crescent"); break;
                case 8: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: big and round, a satellite, and made of cheese"); break;
            }
			//from.Send( new MessageLocalizedAffix( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase( Map.Trammel, from.X, from.Y ), "", AffixType.Prepend, "Trammel : ", "" ) );
			//from.Send( new MessageLocalizedAffix( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase( Map.Felucca, from.X, from.Y ), "", AffixType.Prepend, "Felucca : ", "" ) );

			PlayerMobile player = from as PlayerMobile;

			if ( player != null )
			{
				QuestSystem qs = player.Quest;

				if ( qs is WitchApprenticeQuest )
				{
					FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;

					if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.StarChart )
					{
						int hours, minutes;
						Clock.GetTime( from.Map, from.X, from.Y, out hours, out minutes );

						if ( hours < 5 || hours > 17 )
						{
							player.SendLocalizedMessage( 1055040 ); // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.

							obj.Complete();
						}
						else
						{
							player.SendLocalizedMessage( 1055039 ); // You gaze up into the sky, but it is not dark enough to see any stars.
						}
					}
				}
			}
		}
Ejemplo n.º 2
0
        public override void OnDoubleClick(Mobile from)
        {
            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1008155);             // You peer into the heavens, seeking the moons...

            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ", ""));
            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y), "", AffixType.Prepend, "Felucca : ", ""));

            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is WitchApprenticeQuest)
                {
                    FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                    if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.StarChart)
                    {
                        Clock.GetTime(from.Map, from.X, from.Y, out int hours, out int minutes);

                        if (hours < 5 || hours > 17)
                        {
                            player.SendLocalizedMessage(1055040);                             // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.

                            obj.Complete();
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055039);                             // You gaze up into the sky, but it is not dark enough to see any stars.
                        }
                    }
                }
            }
        }
		public static void GetGateEntry(PublicMoongate gate, out PMEntry entry, out PMList list) // For Old Style Moongates
		{
			int hours;
			int minutes;
			int cycle;
			int steps = 0;

			int gateCount;
			int gateNum;
			int destNum;

			if (gate.Map == Map.Felucca)
				list = PMList.Felucca;
			else
				list = PMList.Trammel;

			gateCount = list.Entries.Length;
			gateNum = 0;

			for (int i = 0; i < gateCount; ++i)
			{
				entry = list.Entries[i];
				if (gate.Location == entry.Location)
				{
					gateNum = i;
					break;
				}
			}

			Clock.GetTime(gate.Map, gate.X, gate.Y, out hours, out minutes);

			cycle = (60 * hours + minutes) % 120;
			if (cycle > 7) ++steps;
			if (cycle > 27) ++steps;
			if (cycle > 37) ++steps;
			if (cycle > 57) ++steps;
			if (cycle > 67) ++steps;
			if (cycle > 87) ++steps;
			if (cycle > 97) ++steps;
			if (cycle > 117) steps = 0;

			destNum = (gateNum + steps) % gateCount;
			entry = list.Entries[destNum];


			//{
			//    /* Debugging */            
			//    int generalNum;
			//    string exactTime;
			//    Clock.GetTime(gate.Map, gate.X, gate.Y, out generalNum, out exactTime);
			//    Console.WriteLine("\ngateNum: {0}", gateNum);
			//    Console.WriteLine("steps: {0}", steps);
			//    Console.WriteLine("destNum: {0}", destNum);
			//    Console.WriteLine("destXYZ: {0}, {1}, {2}", entry.Location.X, entry.Location.Y, entry.Location.Z);
			//    Console.WriteLine("Time: " + exactTime);
			//}
		}
Ejemplo n.º 4
0
        public override void OnDoubleClick(Mobile from)
        {
            int    genericNumber;
            string exactTime;

            Clock.GetTime(from, out genericNumber, out exactTime);

            SendLocalizedMessageTo(from, genericNumber);
            SendLocalizedMessageTo(from, 1042958, exactTime); // ~1_TIME~ to be exact
        }
Ejemplo n.º 5
0
        public void OnTick()
        {
            // check time
            int hours, minutes;

            Clock.GetTime(Map.TerMur, 997, 3869, out hours, out minutes);               // Holy City

            m_Spawned = (hours >= SpawnHour && hours < DespawnHour) && !m_ForceDeactivate;

            foreach (CreatureSpawner spawner in m_Spawners)
            {
                if (spawner.Active != m_Spawned)
                {
                    spawner.Active = m_Spawned;
                }
            }
        }
Ejemplo n.º 6
0
        public void InvalidateID()
        {
            int hour, min;

            Clock.GetTime(this.Map, GetWorldLocation().X, GetWorldLocation().Y, out hour, out min);

            if (hour > 12)
            {
                hour -= 12;
            }

            int id = 0x9BBA + Math.Max(0, (hour - 1));

            if (id != ItemID)
            {
                ItemID = id;
            }
        }
Ejemplo n.º 7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Utility.InRange(Location, from.Location, 2))
            {
                Clock.GetTime(Map, X, Y, out int hours, out int _);

                if (hours < 4 || hours > 20)
                {
                    Effects.PlaySound(Location, Map, 0x569);
                }

                UpdateImage();
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
        }
Ejemplo n.º 8
0
        public int GetGateNumber(Point3D location, Map map)
        {
            int gateloc = 0;
            int hours, minutes, totalMinutes;

            int length = m_FeluccaList.Length;

            while (gateloc < length && Location != m_FeluccaList[gateloc++].Location)
            {
                ;                                                                       //Probably a better way to do this
            }
            gateloc %= length;

            Clock.GetTime(map, location.X, location.Y, out hours, out minutes, out totalMinutes);
            int period = totalMinutes % 120;

            return((gateloc + period / 30 * 2 + Math.Min(1, period % 30 / 10)) % length);
        }
Ejemplo n.º 9
0
        private int GetID()
        {
            int id = 0x9BC6;

            if (!Movable && this.Map != Map.Internal)
            {
                int hour, min;

                Clock.GetTime(this.Map, GetWorldLocation().X, GetWorldLocation().Y, out hour, out min);

                if (hour > 12)
                {
                    hour -= 12;
                }

                id = 0x9BBA + Math.Max(0, (hour - 1));
            }

            return(id);
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (Utility.InRange(this.Location, from.Location, 2))
            {
                int hours;
                int minutes;

                Clock.GetTime(this.Map, this.X, this.Y, out hours, out minutes);

                if (hours < 4 || hours > 20)
                {
                    Effects.PlaySound(this.Location, this.Map, 0x569);
                }

                this.UpdateImage();
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
        }
Ejemplo n.º 11
0
        public void OnTick()
        {
            // check time
            int hours, minutes;

            Clock.GetTime(Map.TerMur, 997, 3869, out hours, out minutes); // Holy City

            m_Spawned = (hours >= SpawnHour && hours < DespawnHour) && !m_ForceDeactivate;

            foreach (XmlSpawner spawner in m_Spawners)
            {
                if (!m_Spawned)
                {
                    spawner.Reset();
                }
                else
                {
                    if (!spawner.Running)
                    {
                        spawner.Respawn();
                    }
                }
            }
        }
        private void UpdateImage()
        {
            int hours;
            int minutes;

            Clock.GetTime(Map, X, Y, out hours, out minutes);

            if (FacingSouth)
            {
                if (hours < 4)
                {
                    ItemID = 0x2A60;
                }
                else if (hours < 6)
                {
                    ItemID = 0x2A5F;
                }
                else if (hours < 8)
                {
                    ItemID = 0x2A5E;
                }
                else if (hours < 16)
                {
                    ItemID = 0x2A5D;
                }
                else if (hours < 18)
                {
                    ItemID = 0x2A5E;
                }
                else if (hours < 20)
                {
                    ItemID = 0x2A5F;
                }
                else
                {
                    ItemID = 0x2A60;
                }
            }
            else
            {
                if (hours < 4)
                {
                    ItemID = 0x2A64;
                }
                else if (hours < 6)
                {
                    ItemID = 0x2A63;
                }
                else if (hours < 8)
                {
                    ItemID = 0x2A62;
                }
                else if (hours < 16)
                {
                    ItemID = 0x2A61;
                }
                else if (hours < 18)
                {
                    ItemID = 0x2A62;
                }
                else if (hours < 20)
                {
                    ItemID = 0x2A63;
                }
                else
                {
                    ItemID = 0x2A64;
                }
            }
        }
Ejemplo n.º 13
0
        public override void OnDoubleClick(Mobile from)
        {
            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1008155);               // You peer into the heavens, seeking the moons...

            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ", ""));

            // Scriptiz : on ne joue pas sur felucca
            //from.Send( new MessageLocalizedAffix( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase( Map.Felucca, from.X, from.Y ), "", AffixType.Prepend, "Felucca : ", "" ) );

            PlayerMobile player = from as PlayerMobile;

            /* Scriptiz : Code pour repérer les autres bateaux (source : Alambik) */
            // Get the maximum range the player can see
            // A cartograph master with a tracking master experience lead to see to 125 tiles: A true captain!
            int MinimumRange      = 25; //Regular 800x600 screen + "normal" extra
            int MaximumExtraRange = 100;
            int ExtraRange        = MaximumExtraRange *
                                    ((int)(from.Skills[SkillName.Cartography].Value) +
                                     (int)(from.Skills[SkillName.Tracking].Value)) / 200;
            int range = MinimumRange + ExtraRange;

            foreach (Item item in from.GetItemsInRange(range))
            {
                if (item is BaseBoat)
                {
                    // Player can see the boat
                    BaseBoat baseboat = (BaseBoat)item;
                    if (!(baseboat.Contains(from))) // On va éviter de répeter qu'on voit son propre bateau
                    {
                        /* Scriptiz : implémentation du tracking */
                        // If the player is good at tracking, let him track a mobile on the boat
                        if (from.Skills[SkillName.Tracking].Value * 2 >= from.GetDistanceToSqrt(baseboat.Location))
                        {
                            foreach (Mobile m in baseboat.GetMobilesInRange(15))
                            {
                                if (m == null)
                                {
                                    continue;
                                }
                                if (baseboat.Contains(m))
                                {
                                    from.QuestArrow = new TrackArrow(from, m, range);
                                    break;
                                }
                            }
                        }

                        // Get the name if not too far
                        string name = "un navire";
                        if (from.InRange(item.Location, MinimumRange + MaximumExtraRange / 5))
                        {
                            if (baseboat.ShipName != null)
                            {
                                name = "le" + baseboat.ShipName;
                            }
                        }

                        // Is it far?
                        string distance = "à l'horizon";
                        if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 1 / 5))
                        {
                            distance = "à côté";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 2 / 5))
                        {
                            distance = "proche";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 3 / 5))
                        {
                            distance = "loin";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 4 / 5))
                        {
                            distance = "très loin";
                        }

                        // Get the relative direction of the seen boat
                        string direction;
                        // north/south
                        if (from.Y < baseboat.Y)
                        {
                            direction = "Sud";
                        }
                        else
                        {
                            direction = "Nord";
                        }
                        // east/west (Scriptiz : correction est <> ouest)
                        if (from.X < baseboat.X)
                        {
                            direction = direction + " Est";
                        }
                        else
                        {
                            direction = direction + " Ouest";
                        }

                        //Does the boat is moving?
                        string mobility = "est immobile";
                        if (baseboat.IsMoving)
                        {
                            mobility = "bouge vers ";
                            switch (baseboat.Moving)
                            {
                            case Direction.North: mobility += "le nord"; break;

                            case Direction.South: mobility += "le sud"; break;

                            case Direction.East: mobility += "l'est"; break;

                            case Direction.West: mobility += "l'ouest"; break;

                            case Direction.Up: mobility += "le nord-ouest"; break;

                            case Direction.Down: mobility += "le sud-est"; break;

                            case Direction.Left: mobility += "le sud-ouest"; break;

                            case Direction.Right: mobility += "le nord-est"; break;

                            default: break;
                            }
                        }
                        from.SendMessage("Vous voyez {0} au {1}. Il est {2} et {3}.", name, direction, distance, mobility);
                    }
                }
            }
            /* Scriptiz : fin du code de Alambik */

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is WitchApprenticeQuest)
                {
                    FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                    if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.StarChart)
                    {
                        int hours, minutes;
                        Clock.GetTime(from.Map, from.X, from.Y, out hours, out minutes);

                        if (hours < 5 || hours > 17)
                        {
                            player.SendLocalizedMessage(1055040);                               // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.

                            obj.Complete();
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055039);                               // You gaze up into the sky, but it is not dark enough to see any stars.
                        }
                    }
                }
            }
        }
Ejemplo n.º 14
0
        public override void OnSingleClick(Mobile from)
        {
            string dest = "";
            int    hours;
            int    minutes;
            int    cycle;
            int    steps = 0;

            int gateCount;
            int gateNum;
            int destNum = 0;

            PMList  list;
            PMEntry entry;

            if (Map == Map.Felucca || Map == Map.Trammel)
            {
                if (Map == Map.Felucca)
                {
                    list = PMList.Felucca;
                }
                else
                {
                    list = PMList.Trammel;
                }

                gateCount = list.Entries.Length;
                gateNum   = 0;

                for (int i = 0; i < gateCount; ++i)
                {
                    entry = list.Entries[i];
                    if (this.Location == entry.Location)
                    {
                        gateNum = i;
                        break;
                    }
                }

                Clock.GetTime(Map, X, Y, out hours, out minutes);

                cycle = (60 * hours + minutes) % 120;
                if (cycle > 7)
                {
                    ++steps;
                }
                if (cycle > 27)
                {
                    ++steps;
                }
                if (cycle > 37)
                {
                    ++steps;
                }
                if (cycle > 57)
                {
                    ++steps;
                }
                if (cycle > 67)
                {
                    ++steps;
                }
                if (cycle > 87)
                {
                    ++steps;
                }
                if (cycle > 97)
                {
                    ++steps;
                }
                if (cycle > 117)
                {
                    steps = 0;
                }

                destNum = (gateNum + steps) % gateCount;
                entry   = list.Entries[destNum];
            }

            if (destNum == 0)
            {
                dest = "see a road to the east and mountains in the distance to the west.";
            }
            else if (destNum == 1)
            {
                dest = "see a small escarpment to the south and a large city to the North.";
            }
            else if (destNum == 2)
            {
                dest = "see what appears to be a small peninsula covered in lush foliage.";
            }
            else if (destNum == 3)
            {
                dest = "see a small city to the south, while a vast ocean lies in all other directions.";
            }
            else if (destNum == 4)
            {
                dest = "see a large sandstone city standing on a far bank of the river to the north.";
            }
            else if (destNum == 5)
            {
                dest = "can just make out a road to the southwest and a river to the north.";
            }
            else if (destNum == 6)
            {
                dest = "see deep forest on all sides.";
            }
            else if (destNum == 7)
            {
                dest = "see a vast body of water to the east while to the west a city can be seen nearby.";
            }

            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("Through the moongate you {0}", dest)));
        }
Ejemplo n.º 15
0
        public bool UseGate(Mobile m)
        {
            // ****************************************** //
            // **** Modified for Old Style Moongates **** //
            // ****************************************** //

            int hours;
            int minutes;
            int cycle;
            int steps = 0;

            int gateCount;
            int gateNum;
            int destNum;

            //int generalNum; // debugging only
            //string exactTime; // debugging only

            PMList  list;
            PMEntry entry;

            /*if (m.Criminal)
             * {
             *  m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
             *  return true;
             * }
             * else if (Server.Spells.SpellHelper.CheckCombat(m))
             * {
             *  m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
             *  return true;
             * }
             * else if (m.Spell != null)
             * {
             *  m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
             *  return true;
             * }
             * else*/if (Map == Map.Felucca || Map == Map.Trammel)
            {
                if (Map == Map.Felucca)
                {
                    list = PMList.Felucca;
                }
                else
                {
                    list = PMList.Trammel;
                }

                gateCount = list.Entries.Length;
                gateNum   = 0;

                for (int i = 0; i < gateCount; ++i)
                {
                    entry = list.Entries[i];
                    if (this.Location == entry.Location)
                    {
                        gateNum = i;
                        break;
                    }
                }

                Clock.GetTime(Map, X, Y, out hours, out minutes);

                cycle = (60 * hours + minutes) % 120;
                if (cycle > 7)
                {
                    ++steps;
                }
                if (cycle > 27)
                {
                    ++steps;
                }
                if (cycle > 37)
                {
                    ++steps;
                }
                if (cycle > 57)
                {
                    ++steps;
                }
                if (cycle > 67)
                {
                    ++steps;
                }
                if (cycle > 87)
                {
                    ++steps;
                }
                if (cycle > 97)
                {
                    ++steps;
                }
                if (cycle > 117)
                {
                    steps = 0;
                }

                destNum = (gateNum + steps) % gateCount;
                entry   = list.Entries[destNum];

                //// Debugging
                //Clock.GetTime(Map, X, Y, out generalNum, out exactTime);
                //Console.WriteLine("\ngateNum: {0}", gateNum);
                //Console.WriteLine("steps: {0}", steps);
                //Console.WriteLine("destNum: {0}", destNum);
                //Console.WriteLine("destXYZ: {0}, {1}, {2}", entry.Location.X, entry.Location.Y, entry.Location.Z );
                //Console.WriteLine("Time: " + exactTime);

                /*if (m.AccessLevel > AccessLevel.Player)
                 * {
                 *  m.SendMessage("You arrive safely in");
                 *  m.SendLocalizedMessage(entry.Number);
                 * }*/

                BaseCreature.TeleportPets(m, entry.Location, list.Map);

                //m.Combatant = null;
                //m.Warmode = false;
                //m.Hidden = true;

                m.MoveToWorld(entry.Location, list.Map);

                Effects.PlaySound(entry.Location, list.Map, 0x1FE);

                //Effects.PlaySound(m.Location, m.Map, 0x20E);
                return(false);
            }
            else
            {
                m.CloseGump(typeof(MoongateGump));
                m.SendGump(new MoongateGump(m, this));

                if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
                {
                    Effects.PlaySound(m.Location, m.Map, 0x20E);
                }

                return(false);
            }
        }
Ejemplo n.º 16
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                int hours, minutes;
                Clock.GetTime(Map, Location.X, Location.Y, out hours, out minutes);

                if (hours <= 19)
                {
                    #region Spawn Random Ambush

                    switch (Utility.Random(3))
                    {
                    case 0:
                    {
                        from.SendMessage("*As your gaze scans the horizon, you notice a group of brigands closing in*");

                        #region Define Mobiles To Spawn
                        // I've reserved spawn01-spawn09; however, you can add as many variables as you like as long as they are unique

                        Mobile spawn01 = new Brigand();
                        Mobile spawn02 = new Brigand();
                        Mobile spawn03 = new Brigand();
                        Mobile spawn04 = new Brigand();
                        Mobile spawn05 = new Brigand();
                        Mobile spawn06 = new Brigand();

                        #endregion

                        switch (Utility.Random(2))
                        {
                        case 1:
                        {
                            /// <summary>
                            /// Don't forget to plug in the spawn variables you add above below:
                            /// </summary>
                            spawn01.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn02.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn03.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                            spawn04.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                            spawn05.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            spawn06.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            break;
                        }

                        case 0:
                        {
                            switch (Utility.Random(4))
                            {
                            case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;

                            case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                            // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                            case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                Mobile subspawn01 = new Rat();
                                subspawn01.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                            case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                            }
                            break;
                        }
                        }
                        break;
                    }

                    case 1:
                    {
                        from.SendMessage("*As your gaze scans the horizon, you notice an Ettin patrol nearby*");

                        #region Define Mobiles To Spawn
                        // I've reserved spawn11-spawn19; however, you can add as many variables as you like as long as they are unique

                        Mobile spawn11 = new Ettin();
                        Mobile spawn12 = new Ettin();
                        Mobile spawn13 = new Ettin();
                        Mobile spawn14 = new Ettin();
                        Mobile spawn15 = new Ettin();
                        Mobile spawn16 = new Ettin();

                        #endregion

                        switch (Utility.Random(2))
                        {
                        case 1:
                        {
                            /// <summary>
                            /// Don't forget to plug in the spawn variables you add above below:
                            /// </summary>
                            spawn11.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn12.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn13.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                            spawn14.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                            spawn15.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            spawn16.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            break;
                        }

                        case 0:
                        {
                            switch (Utility.Random(2, 4))
                            {
                            case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;

                            case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                            // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                            case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                Mobile subspawn11 = new Rat();
                                subspawn11.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                            case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                            }
                            break;
                        }
                        }
                        break;
                    }

                    case 2:     // This case makes the Scout Spyglass act like a normal Spyglass
                    {
                        if (hours < 5 || hours > 17)
                        {
                            from.SendLocalizedMessage(1055040);         // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1055039);         // You gaze up into the sky, but it is not dark enough to see any stars.
                        }
                        break;
                    }
                    }

                    #endregion
                }
                else
                {
                    #region Spawn Random Ambush

                    switch (Utility.Random(3))
                    {
                    case 0:
                    {
                        from.SendMessage("*As your gaze scans the horizon, you notice a group of black bears closing in*");

                        #region Define Mobiles To Spawn
                        // I've reserved spawn21-spawn29; however, you can add as many variables as you like as long as they are unique

                        Mobile spawn21 = new BlackBear();
                        Mobile spawn22 = new BlackBear();
                        Mobile spawn23 = new BlackBear();
                        Mobile spawn24 = new BlackBear();
                        Mobile spawn25 = new BlackBear();
                        Mobile spawn26 = new BlackBear();

                        #endregion

                        switch (Utility.Random(2))
                        {
                        case 1:
                        {
                            /// <summary>
                            /// Don't forget to plug in the spawn variables you add above below:
                            /// </summary>
                            spawn21.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn22.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                            spawn23.MoveToWorld(new Point3D(from.X + 20, from.Y, from.Z), from.Map);
                            spawn24.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                            spawn25.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            spawn26.MoveToWorld(new Point3D(from.X, from.Y + 20, from.Z), from.Map);
                            break;
                        }

                        case 0:
                        {
                            switch (Utility.Random(4))
                            {
                            case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;

                            case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                            // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                            case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                Mobile subspawn21 = new Rat();
                                subspawn21.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                            case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                            }
                            break;
                        }
                        }
                        break;
                    }

                    case 1:
                    {
                        from.SendMessage("*As your gaze scans the horizon, you notice an Fire Gargoyle patrol nearby*");

                        #region Define Mobiles To Spawn
                        // I've reserved spawn31-spawn39; however, you can add as many variables as you like as long as they are unique

                        Mobile spawn31 = new FireGargoyle();
                        Mobile spawn32 = new FireSteed();
                        Mobile spawn33 = new FireGargoyle();
                        Mobile spawn34 = new FireSteed();
                        Mobile spawn35 = new FireGargoyle();
                        Mobile spawn36 = new FireBeetle();

                        #endregion

                        switch (Utility.Random(2))
                        {
                        case 1:
                        {
                            /// <summary>
                            /// Don't forget to plug in the spawn variables you add above below:
                            /// </summary>
                            spawn31.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                            spawn32.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                            spawn33.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                            spawn34.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                            spawn35.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                            spawn36.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                            break;
                        }

                        case 0:
                        {
                            switch (Utility.Random(4))
                            {
                            case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;

                            case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                            // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                            case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                Mobile subspawn31 = new Rat();
                                subspawn31.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                            case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                            }
                            break;
                        }
                        }
                        break;
                    }

                    case 2:     // This case makes the Scout Spyglass act like a normal Spyglass
                    {
                        if (hours < 5 || hours > 17)
                        {
                            from.SendLocalizedMessage(1055040);         // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1055039);         // You gaze up into the sky, but it is not dark enough to see any stars.
                        }
                        break;
                    }
                    }

                    #endregion
                }

                --this.UsesRemaining;

                if (this.UsesRemaining == 0)
                {
                    this.Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }