상속: Item
예제 #1
0
		public Mobile SpawnAt( Spawner spawner, Mobile mob )
		{
			Map map = spawner.Map;

			if ( map == null || map == Map.Internal )
				return null;

			if ((mob is BaseCreature) == false)
				return null;

			try
			{
				BaseOverland bo = null;
				BaseCreature bc = mob as BaseCreature;
				// we will make it so this is passed in
				if (mob is BaseOverland)
					bo = mob as BaseOverland;

				// use the spawners homerange except when it is a special 'guard post' 
				//	spawner (HomeRange == 0)
				bc.RangeHome = spawner.HomeRange == 0? 10 : spawner.HomeRange;

				// could be useful ... but not today
				// c.CurrentWayPoint = spawner.WayPoint;
				// c.NavDestination = spawner.NavPoint;

				bc.Home = spawner.Location;
				bc.Spawner = spawner;
				
				//if we have a navdestination as soon as we spawn start on it
				if(bc.NavDestination != NavDestinations.None)
					bc.AIObject.Think();

				/////////////////////////////
				// move it to the world
				Point3D loc = spawner.GetSpawnPosition(bc);
				bc.MoveToWorld( loc, map );

				// Okay, indicate that this overland mob should be announced on the Town Crier
				// This must be after we are moved off the internal map because the accounce code
				//	supplies 'world location' information which would be wrong if we were still on the internal map
				if (bo != null)
					bo.Announce = true;

				return bc;
			}
			catch (Exception e) 
			{
				LogHelper.LogException(e);
				Console.WriteLine("Server.Engines.OverlandSpawner : Exception {0}", e);
			}

			return null;
		}
예제 #2
0
		public SpawnerGump( Spawner spawner ) : base( 50, 50 )
		{
			m_Spawner = spawner;

			m_SpawnBefore = new SpawnerMemory();
			m_SpawnAfter = new SpawnerMemory();

			AddPage( 0 );

			AddBackground( 0, 0, 260, 371, 5054 );

			AddLabel( 95, 1, 0, "Creatures List" );

			AddButton( 5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
			AddLabel( 38, 347, 0x384, "Cancel" );

			AddButton( 5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0 );
			AddLabel( 38, 325, 0x384, "Okay" );

			AddButton( 110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0 );
			AddLabel( 143, 325, 0x384, "Bring to Home" );

			AddButton( 110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0 );
			AddLabel( 143, 347, 0x384, "Total Respawn" );

			for ( int i = 0;  i < 13; i++ )
			{
				AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0 );
				AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0 );

				AddImageTiled( 71, ( 22 * i ) + 20, 159, 23, 0xA40 );
				AddImageTiled( 72, ( 22 * i ) + 21, 157, 21, 0xBBC );

				string str = "";

				if ( i < spawner.CreaturesName.Count )
				{
					str = (string)spawner.CreaturesName[i];
					int count = m_Spawner.CountCreatures( str );

					if(str!="")
						m_SpawnBefore.Add(str);

					AddLabel( 232, ( 22 * i ) + 20, 0, count.ToString() );
				}

				AddTextEntry( 75, ( 22 * i ) + 21, 154, 21, 0, i, str );
			}

		}
예제 #3
0
		public static void LoadEntry( Spawner spawner, XmlElement node )
		{
			string name = Utility.GetText( node["SpawnedName"], null );
			int prob = Utility.GetXMLInt32( Utility.GetText( node["SpawnedProbability"], "100" ), 100 );
			int count = Utility.GetXMLInt32( Utility.GetText( node["SpawnedMaxCount"], spawner.Count.ToString() ), spawner.Count );
			string parameters = Utility.GetText( node["Parameters"], null );
			string properties = Utility.GetText( node["Parameters"], null );

			SpawnerEntry entry = new SpawnerEntry( name, prob, count );
			entry.Parameters = parameters;
			entry.Properties = properties;

			spawner.Entries.Add( entry );
		}
		public SpawnerGump( Spawner spawner ) : base( 50, 50 )
		{
			m_Spawner = spawner;

			AddPage( 0 );

			AddBackground( 0, 0, 305, 371, 5054 );

			AddLabel( 95, 1, 0, "Creatures List" );

			AddButton( 5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
			AddLabel( 38, 347, 0x384, "Cancel" );

			AddButton( 5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0 );
			AddLabel( 38, 325, 0x384, "Okay" );

			AddButton( 110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0 );
			AddLabel( 143, 325, 0x384, "Bring to Home" );

			AddButton( 110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0 );
			AddLabel( 143, 347, 0x384, "Total Respawn" );

			for ( int i = 0;  i < 13; i++ )
			{
				AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0 );
				AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0 );

				AddImageTiled( 71, ( 22 * i ) + 20, 159, 23, 0xA40 ); //creature text box
				AddImageTiled( 72, ( 22 * i ) + 21, 157, 21, 0xBBC ); //creature text box

                AddImageTiled(235, (22 * i) + 20, 35, 23, 0xA40); //probability text box
                AddImageTiled(236, (22 * i) + 21, 33, 21, 0xBBC); //probability text box

                string name = "";
                string probability = "";

				if ( i < spawner.CreaturesName.Count )
				{
					name = (string)spawner.CreaturesName[i];
                    probability = spawner.CreaturesProbability[i].ToString();
					int count = m_Spawner.CountCreatures( name );

					AddLabel( 277, ( 22 * i ) + 20, 0, count.ToString() );
				}

				AddTextEntry( 75, ( 22 * i ) + 21, 154, 21, 0, i, name ); //creature

                AddTextEntry(239, (22 * i) + 21, 30, 21, 0, i + 20, probability); //probability
            }
		}
예제 #5
0
		/// <summary>
		/// Converts a BoxSpawn to an actual spawner object. This function is used to generate
		/// spawn groups created in Pandora's Box
		/// </summary>
		/// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
		/// <returns>A Spawner object - null if not valid</returns>
		public static Item CreateBoxSpawn( BoxSpawn spawn )
		{
			if ( spawn == null || spawn.Entries.Count == 0 )
				return null;

			Spawner spawner = new Spawner( spawn.Count, spawn.MinDelay, spawn.MaxDelay, spawn.Team, spawn.HomeRange, null );
			spawner.Running = false;

			spawner.Group = spawn.Group;

			foreach ( BoxSpawnEntry entry in spawn.Entries )
			{
				spawner.CreaturesName.Add( entry.Type );
			}

			return spawner;
		}
예제 #6
0
        public SpawnerGump(Spawner spawner)
            : base(50, 50)
        {
            this.m_Spawner = spawner;

            this.AddPage(0);

            this.AddBackground(0, 0, 410, 371, 5054);

            this.AddLabel(160, 1, 0, "Creatures List");

            this.AddButton(5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            this.AddLabel(38, 347, 0x384, "Cancel");

            this.AddButton(5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            this.AddLabel(38, 325, 0x384, "Apply");

            this.AddButton(110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            this.AddLabel(143, 325, 0x384, "Bring to Home");

            this.AddButton(110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            this.AddLabel(143, 347, 0x384, "Total Respawn");

            for (int i = 0; i < 13; i++)
            {
                this.AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                this.AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                this.AddImageTiled(71, (22 * i) + 20, 309, 23, 0xA40);
                this.AddImageTiled(72, (22 * i) + 21, 307, 21, 0xBBC);

                string str = "";

                if (i < spawner.SpawnNames.Count)
                {
                    str = (string)spawner.SpawnNames[i];
                    int count = this.m_Spawner.CountCreatures(str);

                    this.AddLabel(382, (22 * i) + 20, 0, count.ToString());
                }

                this.AddTextEntry(75, (22 * i) + 21, 304, 21, 0, i, str);
            }
        }
예제 #7
0
		public static void LoadSpawner( XmlElement node )
		{
			Spawner spawner = new Spawner();

			spawner.Name = Utility.GetText( node["Name"], null );
			spawner.Team = Utility.GetXMLInt32( Utility.GetText( node["Team"], "0" ), 0 );
			spawner.HomeRange = Utility.GetXMLInt32( Utility.GetText( node["HomeRange"], "0" ), 0 );
			spawner.WalkingRange = Utility.GetXMLInt32( Utility.GetText( node["WalkingRange"], "-1" ), -1 );
			spawner.Count = Utility.GetXMLInt32( Utility.GetText( node["Count"], "1" ), 1 );
			spawner.MinDelay = Utility.GetXMLTimeSpan( Utility.GetText( node["MinDelay"], "00:15:00" ), TimeSpan.FromMinutes( 15.0 ) );
			spawner.MaxDelay = Utility.GetXMLTimeSpan( Utility.GetText( node["MaxDelay"], "00:15:00" ), TimeSpan.FromMinutes( 15.0 ) );
			spawner.Location = Point3D.Parse( Utility.GetText( node["Location"], "(0,0,0)" ) );
			spawner.Map = Map.Parse( Utility.GetText( node["Map"], "Felucca" ) );

			XmlElement entries = node["Entries"];

			foreach ( XmlElement entry in entries.GetElementsByTagName( "Entry" ) )
				LoadEntry( spawner, entry );
		}
		public void CreateArray( RelayInfo info, Mobile from, Spawner spawner )
		{
			spawner.CreaturesName = new ArrayList();
            spawner.CreaturesProbability = new ArrayList();

			for ( int i = 0;  i < 13; i++ )
			{
                //Creatures names
                TextRelay te = info.GetTextEntry(i);
				if ( te != null )
				{
					string str = te.Text;

					if ( str.Length > 0 )
					{
						str = str.Trim();

						Type type = SpawnerType.GetType( str );

                        if (type != null)
                        {
                            spawner.CreaturesName.Add(str);
                            //Creatures probabilities
                            te = info.GetTextEntry(20 + i);
                            try
                            {
                                if (te != null && te.Text.Length > 0 && Int32.Parse(te.Text) > 0)
                                    spawner.CreaturesProbability.Add(Int32.Parse(te.Text));
                                else
                                    spawner.CreaturesProbability.Add(DEFAULT_PROBABILTY);
                            }
                            catch { spawner.CreaturesProbability.Add(DEFAULT_PROBABILTY); }
                        }
                        else
                            from.SendMessage("{0} is not a valid type name.", str);
					}
                }
			}
            if (spawner.CreaturesName.Count > 0) spawner.Start();
		}
예제 #9
0
		//looks at the location provided for a spawner, and returns it if it exists, otherwise makes a new one
		public static Spawner MakeUniqueSpawner( Point3D location, Map map )
		{
			IPooledEnumerable ie = map.GetItemsInRange( location, 0 );
				
			Spawner spawner = null;
			
			foreach( Item item in ie )
			{
				if( item is Spawner )
				{
					spawner = (Spawner)item;
					break;
				}
			}
			
			if( spawner == null )
			{
				spawner = new Spawner();
				spawner.MoveToWorld( location, map );
			}
			
			return spawner;
		}
예제 #10
0
        public SpawnerGump(Spawner spawner, SpawnerEntry focusentry = null, int page = 0) : base(50, 50)
        {
            m_Spawner = spawner;
            m_Entry   = focusentry;
            m_Page    = page;

            AddPage(0);

            AddBackground(0, 0, 343, 371 + (m_Entry != null ? 44 : 0), 5054);

            AddHtml(95, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Creatures List</BASEFONT>");
            AddHtml(245, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>#</BASEFONT>");
            AddHtml(282, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Prb</BASEFONT>");

            //AddLabel( 95, 1, 0, "Creatures List" );

            int offset = 0;

            for (int i = 0; i < 13; i++)
            {
                int textindex  = i * 5;
                int entryindex = m_Page * 13 + i;

                SpawnerEntry entry = null;

                if (entryindex < spawner.Entries.Count)
                {
                    entry = m_Spawner.Entries[entryindex];
                }

                if (entry == null || m_Entry != entry)
                {
                    AddButton(5, 22 * i + 21 + offset, entry != null ? 0xFBA : 0xFA5, entry != null ? 0xFBC : 0xFA7,
                              GetButtonID(2, i * 2)); //Expand
                }
                else
                {
                    AddButton(5, 22 * i + 21 + offset, 0xFBB, 0xFBC,
                              GetButtonID(2, i * 2));                                         //Unexpand
                }
                AddButton(38, 22 * i + 21 + offset, 0xFA2, 0xFA4, GetButtonID(2, 1 + i * 2)); //Delete

                AddImageTiled(71, 22 * i + 20 + offset, 161, 23, 0xA40);                      //creature text box
                AddImageTiled(72, 22 * i + 21 + offset, 159, 21, 0xBBC);                      //creature text box

                AddImageTiled(235, 22 * i + 20 + offset, 35, 23, 0xA40);                      //maxcount text box
                AddImageTiled(236, 22 * i + 21 + offset, 33, 21, 0xBBC);                      //maxcount text box

                AddImageTiled(273, 22 * i + 20 + offset, 35, 23, 0xA40);                      //probability text box
                AddImageTiled(274, 22 * i + 21 + offset, 33, 21, 0xBBC);                      //probability text box

                string     name        = "";
                string     probability = "";
                string     maxcount    = "";
                EntryFlags flags       = EntryFlags.None;

                if (entry != null)
                {
                    name        = entry.SpawnedName;
                    probability = entry.SpawnedProbability.ToString();
                    maxcount    = entry.SpawnedMaxCount.ToString();
                    flags       = entry.Valid;

                    AddLabel(315, 22 * i + 20 + offset, 0, spawner.CountSpawns(entry).ToString());
                }

                AddTextEntry(75, 22 * i + 21 + offset, 156, 21, (flags & EntryFlags.InvalidType) != 0 ? 33 : 0, textindex,
                             name);                                                             //creature
                AddTextEntry(239, 22 * i + 21 + offset, 30, 21, 0, textindex + 1, maxcount);    //max count
                AddTextEntry(277, 22 * i + 21 + offset, 30, 21, 0, textindex + 2, probability); //probability

                if (entry != null && m_Entry == entry)
                {
                    AddLabel(5, 22 * i + 42, 0x384, "Params");
                    AddImageTiled(55, 22 * i + 42, 253, 23, 0xA40); //Parameters
                    AddImageTiled(56, 22 * i + 43, 251, 21, 0xBBC); //Parameters

                    AddLabel(5, 22 * i + 64, 0x384, "Props");
                    AddImageTiled(55, 22 * i + 64, 253, 23, 0xA40); //Properties
                    AddImageTiled(56, 22 * i + 65, 251, 21, 0xBBC); //Properties

                    AddTextEntry(59, 22 * i + 42, 248, 21, (flags & EntryFlags.InvalidParams) != 0 ? 33 : 0, textindex + 3,
                                 entry.Parameters); //parameters
                    AddTextEntry(59, 22 * i + 62, 248, 21, (flags & EntryFlags.InvalidProps) != 0 ? 33 : 0, textindex + 4,
                                 entry.Properties); //properties

                    offset += 44;
                }
            }

            AddButton(5, 347 + offset, 0xFB1, 0xFB3, 0);
            AddLabel(38, 347 + offset, 0x384, "Cancel");

            AddButton(5, 325 + offset, 0xFB7, 0xFB9, GetButtonID(1, 2));
            AddLabel(38, 325 + offset, 0x384, "Okay");

            AddButton(110, 325 + offset, 0xFB4, 0xFB6, GetButtonID(1, 3));
            AddLabel(143, 325 + offset, 0x384, "Bring to Home");

            AddButton(110, 347 + offset, 0xFA8, 0xFAA, GetButtonID(1, 4));
            AddLabel(143, 347 + offset, 0x384, "Total Respawn");

            AddButton(253, 325 + offset, 0xFB7, 0xFB9, GetButtonID(1, 5));
            AddLabel(286, 325 + offset, 0x384, "Apply");

            if (m_Page > 0)
            {
                AddButton(276, 308 + offset, 0x15E3, 0x15E7, GetButtonID(1, 0));
            }
            else
            {
                AddImage(276, 308 + offset, 0x25EA);
            }

            if ((m_Page + 1) * 13 <= m_Spawner.Entries.Count)
            {
                AddButton(293, 308 + offset, 0x15E1, 0x15E5, GetButtonID(1, 1));
            }
            else
            {
                AddImage(293, 308 + offset, 0x25E6);
            }
        }
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			switch ( info.ButtonID ) 
		{ 
		case 0:
		{ 
                                    from.CloseGump( typeof( StartStopMontorilsh ) ); 
		        from.SendGump( new CityInvasion( from ) );
                                    break;  
                             }  
		case 1:
		{
			Point3D loc = new Point3D( 568, 1311, 0 );
			WayPoint point = new WayPoint();
			WayPoint point1 = new WayPoint();
			WayPoint point2 = new WayPoint();
			//WayPoint point3 = new WayPoint();

			point.Name = "MontorInvasionIlshenar";
			point1.Name = "MontorInvasionIlshenar";
			point2.Name = "MontorInvasionIlshenar";

			Spawner spawner1 = new Spawner( 1, 1440, 1441, 0, 6, "OrcBrute" );
			spawner1.MoveToWorld( new Point3D(  950, 284, -90  ), Map.Malas );
			spawner1.WayPoint = point;
			point.MoveToWorld( new Point3D(  950, 265, -90  ), Map.Malas );
			point.NextPoint = point2;
			point2.MoveToWorld( new Point3D(  950, 275, -90  ), Map.Malas );
          			spawner1.Name = "MontorInvasionIlshenar";
			spawner1.Respawn();

			Spawner spawner2 = new Spawner( 1, 1440, 1441, 0, 6, "OrcBomber" );
			spawner2.MoveToWorld( new Point3D(  952, 284, -90  ), Map.Malas );
			spawner2.WayPoint = point1;
			point1.MoveToWorld( new Point3D(  952, 265, -90  ), Map.Malas );
			spawner2.Name = "MontorInvasionIlshenar";
			spawner2.Respawn();

			Spawner spawner3 = new Spawner( 1, 1440, 1441, 0, 6, "Savage" );
			spawner3.MoveToWorld( new Point3D(  950, 244, -90  ), Map.Malas );
			spawner3.WayPoint = point;
			spawner3.Name = "MontorInvasionIlshenar";
			spawner3.Respawn();

			Spawner spawner4 = new Spawner( 1, 1440, 1441, 0, 6, "SavageRider" );
			spawner4.MoveToWorld( new Point3D(  952, 244, -90  ), Map.Malas );
			spawner4.WayPoint = point1;
			spawner4.Name = "MontorInvasionIlshenar";
			spawner4.Respawn();

                                           World.Broadcast( 33, true, "Montor Ilshenar is under invasion." );
		               from.SendGump( new CityInvasion( from ) );
                                   	 break; 
                            }  
		case 2:
		{
			MontorInvasionStone monilsh = new MontorInvasionStone();
			monilsh.StopMontorIlshenar();
                                          World.Broadcast( 33, true, "Montor Ilshenar's invasion was successfully beaten back. No more invaders are left in the city." );
		              from.SendGump( new CityInvasion( from ) );
                                   	break; 
				}
			}
		}
예제 #12
0
        public SpawnerGump(Spawner spawner)
            : base(50, 50)
        {
            m_Spawner = spawner;

            AddPage(0);

            AddBackground(0, 0, 410, 381, 5054);

            AddLabel(75, 1, 0, "Spawn List");
            AddLabel(335, 1, 0, "Max");
            AddLabel(378, 1, 0, "Total");

            AddButton(5, 310, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddLabel(38, 310, 0x384, "Apply");

            AddButton(5, 333, 0xFA8, 0xFAB, 1025, GumpButtonType.Reply, 0);
            AddLabel(38, 333, 0x384, "Props");

            AddButton(5, 356, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 356, 0x384, "Cancel");

            AddButton(110, 310, 0xFA5, 0xFA7, 1500, GumpButtonType.Reply, 0);
            AddLabel(143, 310, 0x384, String.Format("Running: {0}", m_Spawner.Running ? "Yes" : "No"));

            AddButton(110, 333, 0xFA5, 0xFA7, 1000, GumpButtonType.Reply, 0);
            AddLabel(143, 333, 0x384, String.Format("Group: {0}", m_Spawner.Group ? "Yes" : "No"));

            AddButton(110, 356, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            AddLabel(143, 356, 0x384, "Bring to Home");

            AddButton(270, 333, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            AddLabel(303, 333, 0x384, "Total Respawn");

            AddButton(270, 356, 0xFA8, 0xFAA, 1750, GumpButtonType.Reply, 0);
            AddLabel(303, 356, 0x384, "Total Reset");

            AddImageTiled(350, 306, 30, 23, 0xA40);
            AddImageTiled(351, 307, 28, 21, 0xBBC);

            AddLabel(270, 306, 0x384, "Max Spawn:");
            AddTextEntry(353, 307, 28, 21, 0, 500, m_Spawner.MaxCount.ToString());

            AddLabel(382, 307, 0, m_Spawner.SpawnCount.ToString());

            for (int i = 0; i < MaxEntries; i++)
            {
                AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                AddImageTiled(71, (22 * i) + 20, 279, 23, 0xA40);
                AddImageTiled(72, (22 * i) + 21, 277, 21, 0xBBC);

                AddImageTiled(330, (22 * i) + 20, 50, 23, 0xA40);
                AddImageTiled(331, (22 * i) + 21, 48, 21, 0xBBC);

                string str = "";
                int    max = 0;

                if (i < spawner.SpawnObjects.Count)
                {
                    var so = spawner.SpawnObjects[i];

                    str = so.SpawnName;
                    max = so.MaxCount;

                    int count = m_Spawner.CountCreatures(so);
                    AddLabel(382, (22 * i) + 20, 0, count.ToString());
                }

                AddTextEntry(75, (22 * i) + 21, 304, 21, 0, i, str);
                AddTextEntry(332, (22 * i) + 21, 28, 21, 0, i + 20, max.ToString());
            }
        }
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			switch ( info.ButtonID ) 
		{ 
		case 0:
		{ 
                                    from.CloseGump( typeof( StartStopMaginciafel ) ); 
		        from.SendGump( new CityInvasion( from ) );
                                    break;  
                             }  
		case 1:
		{
			Point3D loc = new Point3D( 568, 1311, 0 );

			WayPoint point = new WayPoint();
			WayPoint point1 = new WayPoint();
			WayPoint point2 = new WayPoint();
			WayPoint point3 = new WayPoint();
			WayPoint point4 = new WayPoint();
			WayPoint point5 = new WayPoint();
			WayPoint point6 = new WayPoint();
			WayPoint point7 = new WayPoint();
			WayPoint point8 = new WayPoint();
			WayPoint point9 = new WayPoint();

			WayPoint point10 = new WayPoint();
			WayPoint point11 = new WayPoint();
			/*WayPoint point12 = new WayPoint();
			WayPoint point13 = new WayPoint();
			WayPoint point14 = new WayPoint();
			WayPoint point15 = new WayPoint();
			WayPoint point16 = new WayPoint();
			WayPoint point17 = new WayPoint();
			WayPoint point18 = new WayPoint();
			WayPoint point19 = new WayPoint();

			WayPoint point20 = new WayPoint();
			WayPoint point21 = new WayPoint();
			WayPoint point22 = new WayPoint();
			WayPoint point23 = new WayPoint();
			WayPoint point24 = new WayPoint();
			WayPoint point25 = new WayPoint();
			WayPoint point26 = new WayPoint();
			WayPoint point27 = new WayPoint();
			WayPoint point28 = new WayPoint();
			WayPoint point29 = new WayPoint();

			WayPoint point30 = new WayPoint();
			WayPoint point31 = new WayPoint();
			WayPoint point32 = new WayPoint();
			WayPoint point33 = new WayPoint();
			WayPoint point34 = new WayPoint();
			WayPoint point35 = new WayPoint();
			WayPoint point36 = new WayPoint();
			WayPoint point37 = new WayPoint();
			WayPoint point38 = new WayPoint();
			WayPoint point39 = new WayPoint();

			WayPoint point40 = new WayPoint();
			WayPoint point41 = new WayPoint();
			WayPoint point42 = new WayPoint();
			WayPoint point43 = new WayPoint();
			WayPoint point44 = new WayPoint();
			WayPoint point45 = new WayPoint();
			WayPoint point46 = new WayPoint();
			WayPoint point47 = new WayPoint();
			WayPoint point48 = new WayPoint();
			WayPoint point49 = new WayPoint();

			WayPoint point50 = new WayPoint();
			WayPoint point51 = new WayPoint();
			WayPoint point52 = new WayPoint();
			WayPoint point53 = new WayPoint();
			WayPoint point54 = new WayPoint();
			WayPoint point55 = new WayPoint();
			WayPoint point56 = new WayPoint();
			WayPoint point57 = new WayPoint();
			WayPoint point58 = new WayPoint();
			WayPoint point59 = new WayPoint();

			WayPoint point60 = new WayPoint();
			WayPoint point61 = new WayPoint();
			WayPoint point62 = new WayPoint();
			WayPoint point63 = new WayPoint();
			WayPoint point64 = new WayPoint();
			WayPoint point65 = new WayPoint();
			WayPoint point66 = new WayPoint();
			WayPoint point67 = new WayPoint();
			WayPoint point68 = new WayPoint();
			WayPoint point69 = new WayPoint();

			WayPoint point70 = new WayPoint();
			WayPoint point71 = new WayPoint();
			WayPoint point72 = new WayPoint();
			WayPoint point73 = new WayPoint();
			WayPoint point74 = new WayPoint();
			WayPoint point75 = new WayPoint();
			WayPoint point76 = new WayPoint();
			WayPoint point77 = new WayPoint();
			WayPoint point78 = new WayPoint();
			WayPoint point79 = new WayPoint();
			WayPoint point80 = new WayPoint();
			WayPoint point81 = new WayPoint();

			WayPoint point82 = new WayPoint();
			WayPoint point83 = new WayPoint();
			WayPoint point84 = new WayPoint();
			WayPoint point85 = new WayPoint();
			WayPoint point86 = new WayPoint();
			WayPoint point87 = new WayPoint();
			WayPoint point88 = new WayPoint();
			WayPoint point89 = new WayPoint();
			WayPoint point90 = new WayPoint();
			WayPoint point91 = new WayPoint();
			WayPoint point92 = new WayPoint();
			WayPoint point93 = new WayPoint();

			WayPoint point94 = new WayPoint();
			WayPoint point95 = new WayPoint();
			WayPoint point96 = new WayPoint();
			WayPoint point97 = new WayPoint();
			WayPoint point98 = new WayPoint();
			WayPoint point99 = new WayPoint();
			WayPoint point100 = new WayPoint();
			WayPoint point101 = new WayPoint();
			WayPoint point102 = new WayPoint();
			WayPoint point103 = new WayPoint();
			WayPoint point104 = new WayPoint();
			WayPoint point105 = new WayPoint();

			WayPoint point106 = new WayPoint();
			WayPoint point107 = new WayPoint();
			WayPoint point108 = new WayPoint();
			WayPoint point109 = new WayPoint();
			WayPoint point110 = new WayPoint();
			WayPoint point111 = new WayPoint();
			WayPoint point112 = new WayPoint();
			WayPoint point113 = new WayPoint();
			WayPoint point114 = new WayPoint();
			WayPoint point115 = new WayPoint();
			WayPoint point116 = new WayPoint();
			WayPoint point117 = new WayPoint();
			WayPoint point118 = new WayPoint();
			WayPoint point119 = new WayPoint();
			WayPoint point120 = new WayPoint();*/

			point.Name = "MaginciaInvasionFelucca";
			point1.Name = "MaginciaInvasionFelucca";
			point2.Name = "MaginciaInvasionFelucca";
			point3.Name = "MaginciaInvasionFelucca";
			point4.Name = "MaginciaInvasionFelucca";
			point5.Name = "MaginciaInvasionFelucca";
			point6.Name = "MaginciaInvasionFelucca";
			point7.Name = "MaginciaInvasionFelucca";
			point8.Name = "MaginciaInvasionFelucca";
			point9.Name = "MaginciaInvasionFelucca";

			point10.Name = "MaginciaInvasionFelucca";
			point11.Name = "MaginciaInvasionFelucca";
			/*point12.Name = "MaginciaInvasionFelucca";
			point13.Name = "MaginciaInvasionFelucca";
			point14.Name = "MaginciaInvasionFelucca";
			point15.Name = "MaginciaInvasionFelucca";
			point16.Name = "MaginciaInvasionFelucca";
			point17.Name = "MaginciaInvasionFelucca";
			point18.Name = "MaginciaInvasionFelucca";
			point19.Name = "MaginciaInvasionFelucca";

			point20.Name = "MaginciaInvasionFelucca";
			point21.Name = "MaginciaInvasionFelucca";
			point22.Name = "MaginciaInvasionFelucca";
			point23.Name = "MaginciaInvasionFelucca";
			point24.Name = "MaginciaInvasionFelucca";
			point25.Name = "MaginciaInvasionFelucca";
			point26.Name = "MaginciaInvasionFelucca";
			point27.Name = "MaginciaInvasionFelucca";
			point28.Name = "MaginciaInvasionFelucca";
			point29.Name = "MaginciaInvasionFelucca";

			point30.Name = "MaginciaInvasionFelucca";
			point31.Name = "MaginciaInvasionFelucca";
			point32.Name = "MaginciaInvasionFelucca";
			point33.Name = "MaginciaInvasionFelucca";
			point34.Name = "MaginciaInvasionFelucca";
			point35.Name = "MaginciaInvasionFelucca";
			point36.Name = "MaginciaInvasionFelucca";
			point37.Name = "MaginciaInvasionFelucca";
			point38.Name = "MaginciaInvasionFelucca";
			point39.Name = "MaginciaInvasionFelucca";

			point40.Name = "MaginciaInvasionFelucca";
			point41.Name = "MaginciaInvasionFelucca";
			point42.Name = "MaginciaInvasionFelucca";
			point43.Name = "MaginciaInvasionFelucca";
			point44.Name = "MaginciaInvasionFelucca";
			point45.Name = "MaginciaInvasionFelucca";
			point46.Name = "MaginciaInvasionFelucca";
			point47.Name = "MaginciaInvasionFelucca";
			point48.Name = "MaginciaInvasionFelucca";
			point49.Name = "MaginciaInvasionFelucca";

			point50.Name = "MaginciaInvasionFelucca";
			point51.Name = "MaginciaInvasionFelucca";
			point52.Name = "MaginciaInvasionFelucca";
			point53.Name = "MaginciaInvasionFelucca";
			point54.Name = "MaginciaInvasionFelucca";
			point55.Name = "MaginciaInvasionFelucca";
			point56.Name = "MaginciaInvasionFelucca";
			point57.Name = "MaginciaInvasionFelucca";
			point58.Name = "MaginciaInvasionFelucca";
			point59.Name = "MaginciaInvasionFelucca";

			point60.Name = "MaginciaInvasionFelucca";
			point61.Name = "MaginciaInvasionFelucca";
			point62.Name = "MaginciaInvasionFelucca";
			point63.Name = "MaginciaInvasionFelucca";
			point64.Name = "MaginciaInvasionFelucca";
			point65.Name = "MaginciaInvasionFelucca";
			point66.Name = "MaginciaInvasionFelucca";
			point67.Name = "MaginciaInvasionFelucca";
			point68.Name = "MaginciaInvasionFelucca";
			point69.Name = "MaginciaInvasionFelucca";

			point70.Name = "MaginciaInvasionFelucca";
			point71.Name = "MaginciaInvasionFelucca";
			point72.Name = "MaginciaInvasionFelucca";
			point73.Name = "MaginciaInvasionFelucca";
			point74.Name = "MaginciaInvasionFelucca";
			point75.Name = "MaginciaInvasionFelucca";
			point76.Name = "MaginciaInvasionFelucca";
			point77.Name = "MaginciaInvasionFelucca";
			point78.Name = "MaginciaInvasionFelucca";
			point79.Name = "MaginciaInvasionFelucca";
			point80.Name = "MaginciaInvasionFelucca";
			point81.Name = "MaginciaInvasionFelucca";

			point82.Name = "MaginciaInvasionFelucca";
			point83.Name = "MaginciaInvasionFelucca";
			point84.Name = "MaginciaInvasionFelucca";
			point85.Name = "MaginciaInvasionFelucca";
			point86.Name = "MaginciaInvasionFelucca";
			point87.Name = "MaginciaInvasionFelucca";
			point88.Name = "MaginciaInvasionFelucca";
			point89.Name = "MaginciaInvasionFelucca";
			point90.Name = "MaginciaInvasionFelucca";
			point91.Name = "MaginciaInvasionFelucca";
			point92.Name = "MaginciaInvasionFelucca";
			point93.Name = "MaginciaInvasionFelucca";

			point94.Name = "MaginciaInvasionFelucca";
			point95.Name = "MaginciaInvasionFelucca";
			point96.Name = "MaginciaInvasionFelucca";
			point97.Name = "MaginciaInvasionFelucca";
			point98.Name = "MaginciaInvasionFelucca";
			point99.Name = "MaginciaInvasionFelucca";
			point100.Name = "MaginciaInvasionFelucca";
			point101.Name = "MaginciaInvasionFelucca";
			point102.Name = "MaginciaInvasionFelucca";
			point103.Name = "MaginciaInvasionFelucca";
			point104.Name = "MaginciaInvasionFelucca";
			point105.Name = "MaginciaInvasionFelucca";

			point106.Name = "MaginciaInvasionFelucca";
			point107.Name = "MaginciaInvasionFelucca";
			point108.Name = "MaginciaInvasionFelucca";
			point109.Name = "MaginciaInvasionFelucca";
			point110.Name = "MaginciaInvasionFelucca";
			point111.Name = "MaginciaInvasionFelucca";
			point112.Name = "MaginciaInvasionFelucca";
			point113.Name = "MaginciaInvasionFelucca";
			point114.Name = "MaginciaInvasionFelucca";
			point115.Name = "MaginciaInvasionFelucca";
			point116.Name = "MaginciaInvasionFelucca";
			point117.Name = "MaginciaInvasionFelucca";
			point118.Name = "MaginciaInvasionFelucca";
			point119.Name = "MaginciaInvasionFelucca";
			point120.Name = "MaginciaInvasionFelucca";*/

			GuardedRegion reg = from.Region as GuardedRegion;

			if ( reg == null )
			{
				from.SendMessage( 33, "You are not in the guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards off." );
			}
			 else if ( reg.Disabled )
                                           {
				from.SendMessage( 3, "The guards in this region have not changed." );
                                           }
			else if ( !reg.Disabled )
                                           {
				reg.Disabled = !reg.Disabled;
			              from.SendMessage( 3, "The guards in this region have been disabled." );
                                           }
                                           if ( DummyMessage  && reg != null )
                                          {
				from.SendMessage( 33, "If you are not in the guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards off." );
                                          }
			Spawner spawner1 = new Spawner( 4, 5, 15, 0, 10, "OrcBomber" );
			spawner1.MoveToWorld( new Point3D(  3654, 2070, 20  ), Map.Felucca );
			spawner1.WayPoint = point;
			point.MoveToWorld( new Point3D(  3708, 2090, 5  ), Map.Felucca );
			point.NextPoint = point1;
			point1.MoveToWorld( new Point3D(  3707, 2180, 20  ), Map.Felucca );
			point1.NextPoint = point2;
			point2.MoveToWorld( new Point3D(  3675, 2180, 20  ), Map.Felucca );
			point2.NextPoint = point3;
			point3.MoveToWorld( new Point3D(  3675, 2235, 20  ), Map.Felucca );
			point3.NextPoint = point4;
			point4.MoveToWorld( new Point3D(  3741, 2235, 20  ), Map.Felucca );
			point4.NextPoint = point5;
			point5.MoveToWorld( new Point3D(  3741, 2188, 20  ), Map.Felucca );
			point5.NextPoint = point6;
			point6.MoveToWorld( new Point3D(  3707, 2188, 20  ), Map.Felucca );
			point6.NextPoint = point7;
			point7.MoveToWorld( new Point3D(  3707, 2180, 20  ), Map.Felucca );
			point7.NextPoint = point8;
			point8.MoveToWorld( new Point3D(  3675, 2180, 20  ), Map.Felucca );
			point8.NextPoint = point9;
			point9.MoveToWorld( new Point3D(  3675, 2115, 20  ), Map.Felucca );
			point9.NextPoint = point10;
			point10.MoveToWorld( new Point3D(  3754, 2115, 20  ), Map.Felucca );
			point10.NextPoint = point11;
			point11.MoveToWorld( new Point3D(  3708, 2115, 20  ), Map.Felucca );
			point11.NextPoint = point;
          	spawner1.Name = "MaginciaInvasionFelucca";
			spawner1.Respawn();

            Spawner spawner2 = new Spawner(4, 5, 15, 0, 8, "OrcishLord");
            spawner2.MoveToWorld(new Point3D(3797, 2263, 40), Map.Felucca);
            spawner2.Name = "MaginciaInvasionFelucca";
            spawner2.Respawn();

            Spawner spawner3 = new Spawner(4, 5, 15, 0, 8, "OrcCaptain");
            spawner3.MoveToWorld(new Point3D(3796, 2262, 40), Map.Felucca);
            spawner3.Name = "MaginciaInvasionFelucca";
            spawner3.Respawn();

            Spawner spawner4 = new Spawner(4, 5, 15, 0, 8, "OrcSoldier");
            spawner4.MoveToWorld(new Point3D(3797, 2262, 40), Map.Felucca);
            spawner4.Name = "MaginciaInvasionFelucca";
            spawner4.Respawn();

            Spawner spawner5 = new Spawner(4, 5, 15, 0, 8, "OrcishMage");
            spawner5.MoveToWorld(new Point3D(3798, 2262, 40), Map.Felucca);
            spawner5.Name = "MaginciaInvasionFelucca";
            spawner5.Respawn();

            Spawner spawner6 = new Spawner(1, 2, 2, 0, 2, "OrcKing");
            spawner6.MoveToWorld(new Point3D(3799, 2262, 40), Map.Felucca);
            spawner6.Name = "MaginciaInvasionFelucca";
            spawner6.Respawn();

            Spawner spawner7 = new Spawner(10, 5, 15, 0, 8, "Orc");
            spawner7.MoveToWorld(new Point3D(3798, 2262, 40), Map.Felucca);
            spawner7.Name = "MaginciaInvasionFelucca";
            spawner7.Respawn();

            Spawner spawner8 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner8.MoveToWorld(new Point3D(3739, 2255, 20), Map.Felucca);
            spawner8.Name = "MaginciaInvasionFelucca";
            spawner8.Respawn();

            Spawner spawner41 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner41.MoveToWorld(new Point3D(3752, 2237, 20), Map.Felucca);
            spawner41.Name = "MaginciaInvasionFelucca";
            spawner41.Respawn();

            Spawner spawner9 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner9.MoveToWorld(new Point3D(3744, 2237, 20), Map.Felucca);
            spawner9.Name = "MaginciaInvasionFelucca";
            spawner9.Respawn();

            Spawner spawner10 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner10.MoveToWorld(new Point3D(3739, 2251, 20), Map.Felucca);
            spawner10.Name = "MaginciaInvasionFelucca";
            spawner10.Respawn();

            Spawner spawner11 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner11.MoveToWorld(new Point3D(3727, 2224, 20), Map.Felucca);
            spawner11.Name = "MaginciaInvasionFelucca";
            spawner11.Respawn();

            Spawner spawner12 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner12.MoveToWorld(new Point3D(3727, 2224, 20), Map.Felucca);
            spawner12.Name = "MaginciaInvasionFelucca";
            spawner12.Respawn();

            Spawner spawner13 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner13.MoveToWorld(new Point3D(3727, 2220, 20), Map.Felucca);
            spawner13.Name = "MaginciaInvasionFelucca";
            spawner13.Respawn();

            Spawner spawner14 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner14.MoveToWorld(new Point3D(3727, 2220, 20), Map.Felucca);
            spawner14.Name = "MaginciaInvasionFelucca";
            spawner14.Respawn();

            Spawner spawner15 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner15.MoveToWorld(new Point3D(3764, 2237, 30), Map.Felucca);
            spawner15.Name = "MaginciaInvasionFelucca";
            spawner15.Respawn();

            Spawner spawner16 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner16.MoveToWorld(new Point3D(3752, 2260, 30), Map.Felucca);
            spawner16.Name = "MaginciaInvasionFelucca";
            spawner16.Respawn();

            Spawner spawner17 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner17.MoveToWorld(new Point3D(3700, 2250, 20), Map.Felucca);
            spawner17.Name = "MaginciaInvasionFelucca";
            spawner17.Respawn();

            Spawner spawner18 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner18.MoveToWorld(new Point3D(3700, 2250, 20), Map.Felucca);
            spawner18.Name = "MaginciaInvasionFelucca";
            spawner18.Respawn();

            Spawner spawner19 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner19.MoveToWorld(new Point3D(3715, 2235, 20), Map.Felucca);
            spawner19.Name = "MaginciaInvasionFelucca";
            spawner19.Respawn();

            Spawner spawner20 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner20.MoveToWorld(new Point3D(3700, 2221, 41), Map.Felucca);
            spawner20.Name = "MaginciaInvasionFelucca";
            spawner20.Respawn();

            Spawner spawner21 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner21.MoveToWorld(new Point3D(3700, 2221, 41), Map.Felucca);
            spawner21.Name = "MaginciaInvasionFelucca";
            spawner21.Respawn();

            Spawner spawner22 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner22.MoveToWorld(new Point3D(3700, 2221, 20), Map.Felucca);
            spawner22.Name = "MaginciaInvasionFelucca";
            spawner22.Respawn();

            Spawner spawner23 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner23.MoveToWorld(new Point3D(3700, 2221, 20), Map.Felucca);
            spawner23.Name = "MaginciaInvasionFelucca";
            spawner23.Respawn();

            Spawner spawner24 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner24.MoveToWorld(new Point3D(3690, 2226, 20), Map.Felucca);
            spawner24.Name = "MaginciaInvasionFelucca";
            spawner24.Respawn();

            Spawner spawner25 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner25.MoveToWorld(new Point3D(3690, 2226, 20), Map.Felucca);
            spawner25.Name = "MaginciaInvasionFelucca";
            spawner25.Respawn();

            Spawner spawner26 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner26.MoveToWorld(new Point3D(3666, 2234, 20), Map.Felucca);
            spawner26.Name = "MaginciaInvasionFelucca";
            spawner26.Respawn();

            Spawner spawner27 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner27.MoveToWorld(new Point3D(3666, 2234, 20), Map.Felucca);
            spawner27.Name = "MaginciaInvasionFelucca";
            spawner27.Respawn();

            Spawner spawner28 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner28.MoveToWorld(new Point3D(3676, 2238, 20), Map.Felucca);
            spawner28.Name = "MaginciaInvasionFelucca";
            spawner28.Respawn();

            Spawner spawner29 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner29.MoveToWorld(new Point3D(3667, 2254, 20), Map.Felucca);
            spawner29.Name = "MaginciaInvasionFelucca";
            spawner29.Respawn();

            Spawner spawner30 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner30.MoveToWorld(new Point3D(3667, 2254, 20), Map.Felucca);
            spawner30.Name = "MaginciaInvasionFelucca";
            spawner30.Respawn();

            Spawner spawner31 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner31.MoveToWorld(new Point3D(3676, 2238, 20), Map.Felucca);
            spawner31.Name = "MaginciaInvasionFelucca";
            spawner31.Respawn();

            Spawner spawner32 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner32.MoveToWorld(new Point3D(3715, 2235, 20), Map.Felucca);
            spawner32.Name = "MaginciaInvasionFelucca";
            spawner32.Respawn();

            Spawner spawner33 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner33.MoveToWorld(new Point3D(3684, 2252, 20), Map.Felucca);
            spawner33.Name = "MaginciaInvasionFelucca";
            spawner33.Respawn();

            Spawner spawner34 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner34.MoveToWorld(new Point3D(3684, 2252, 20), Map.Felucca);
            spawner34.Name = "MaginciaInvasionFelucca";
            spawner34.Respawn();

            Spawner spawner35 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner35.MoveToWorld(new Point3D(3674, 2286, -2), Map.Felucca);
            spawner35.Name = "MaginciaInvasionFelucca";
            spawner35.Respawn();

            Spawner spawner36 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner36.MoveToWorld(new Point3D(3674, 2286, -2), Map.Felucca);
            spawner36.Name = "MaginciaInvasionFelucca";
            spawner36.Respawn();

            Spawner spawner37 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner37.MoveToWorld(new Point3D(3660, 2188, 20), Map.Felucca);
            spawner37.Name = "MaginciaInvasionFelucca";
            spawner37.Respawn();

            Spawner spawner38 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner38.MoveToWorld(new Point3D(3660, 2188, 20), Map.Felucca);
            spawner38.Name = "MaginciaInvasionFelucca";
            spawner38.Respawn();

            Spawner spawner39 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner39.MoveToWorld(new Point3D(3694, 2163, 20), Map.Felucca);
            spawner39.Name = "MaginciaInvasionFelucca";
            spawner39.Respawn();

            Spawner spawner40 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner40.MoveToWorld(new Point3D(3694, 2163, 20), Map.Felucca);
            spawner40.Name = "MaginciaInvasionFelucca";
            spawner40.Respawn();

            Spawner spawner42 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner42.MoveToWorld(new Point3D(3731, 2149, 20), Map.Felucca);
            spawner42.Name = "MaginciaInvasionFelucca";
            spawner42.Respawn();

            Spawner spawner43 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner43.MoveToWorld(new Point3D(3731, 2149, 20), Map.Felucca);
            spawner43.Name = "MaginciaInvasionFelucca";
            spawner43.Respawn();

            Spawner spawner44 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner44.MoveToWorld(new Point3D(3710, 2162, 20), Map.Felucca);
            spawner44.Name = "MaginciaInvasionFelucca";
            spawner44.Respawn();

            Spawner spawner45 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner45.MoveToWorld(new Point3D(3715, 2147, 20), Map.Felucca);
            spawner45.Name = "MaginciaInvasionFelucca";
            spawner45.Respawn();

            Spawner spawner46 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner46.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner46.Name = "MaginciaInvasionFelucca";
            spawner46.Respawn();

            Spawner spawner47 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner47.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner47.Name = "MaginciaInvasionFelucca";
            spawner47.Respawn();

            Spawner spawner48 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner48.MoveToWorld(new Point3D(3698, 2108, 20), Map.Felucca);
            spawner48.Name = "MaginciaInvasionFelucca";
            spawner48.Respawn();

            Spawner spawner49 = new Spawner(3, 5, 15, 0, 10, "OrcCamp");
            spawner49.MoveToWorld(new Point3D(3667, 2107, 20), Map.Felucca);
            spawner49.Name = "MaginciaInvasionFelucca";
            spawner49.Respawn();

            /*Spawner spawner50 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner50.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner50.Name = "MaginciaInvasionFelucca";
            spawner50.Respawn();

            Spawner spawner51 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner51.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner51.Name = "MaginciaInvasionFelucca";
            spawner51.Respawn();

			/*Spawner spawner2 = new Spawner( 4, 5, 15, 0, 15, "Orc" );
			spawner2.MoveToWorld( new Point3D(  2694, 466, 18  ), Map.Felucca );
			spawner2.WayPoint = point12;
			point12.MoveToWorld( new Point3D(  2662, 469, 15  ), Map.Felucca );
			point12.NextPoint = point13;
			point13.MoveToWorld( new Point3D(  2625, 469, 15  ), Map.Felucca );
			point13.NextPoint = point14;
			point14.MoveToWorld( new Point3D(  2613, 507, 15  ), Map.Felucca );
			point14.NextPoint = point15;
			point15.MoveToWorld( new Point3D(  2558, 513, 15  ), Map.Felucca );
			point15.NextPoint = point16;
			point16.MoveToWorld( new Point3D(  2558, 496, 0  ), Map.Felucca );
			point16.NextPoint = point17;
			point17.MoveToWorld( new Point3D(  2576, 479, 0  ), Map.Felucca );
			point17.NextPoint = point18;
			point18.MoveToWorld( new Point3D(  2558, 496, 0  ), Map.Felucca );
			point18.NextPoint = point19;
			point19.MoveToWorld( new Point3D(  2558, 528, 15  ), Map.Felucca );
			point19.NextPoint = point20;
			point20.MoveToWorld( new Point3D(  2569, 537, 15  ), Map.Felucca );
			point20.NextPoint = point21;
			point21.MoveToWorld( new Point3D(  2599, 531, 15  ), Map.Felucca );
			point21.NextPoint = point22;
			point22.MoveToWorld( new Point3D(  2599, 504, 0  ), Map.Felucca );
			point22.NextPoint = point23;
			point23.MoveToWorld( new Point3D(  2606, 502, 0  ), Map.Felucca );
			point23.NextPoint = point24;
			point24.MoveToWorld( new Point3D(  2604, 496, 20  ), Map.Felucca );
			point24.NextPoint = point25;
			point25.MoveToWorld( new Point3D(  2578, 500, 22  ), Map.Felucca );
			point25.NextPoint = point26;
			point26.MoveToWorld( new Point3D(  2582, 493, 40  ), Map.Felucca );
			point26.NextPoint = point27;
			point27.MoveToWorld( new Point3D(  2609, 469, 40  ), Map.Felucca );
			point27.NextPoint = point28;
			point28.MoveToWorld( new Point3D(  2602, 466, 60  ), Map.Felucca );
			point28.NextPoint = point29;
			point29.MoveToWorld( new Point3D(  2604, 453, 60  ), Map.Felucca );
			point29.NextPoint = point30;
			point30.MoveToWorld( new Point3D(  2591, 457, 60  ), Map.Felucca );
			point30.NextPoint = point31;
			point31.MoveToWorld( new Point3D(  2604, 453, 60  ), Map.Felucca );
			point31.NextPoint = point32;
			point32.MoveToWorld( new Point3D(  2602, 466, 60  ), Map.Felucca );
			point32.NextPoint = point33;
			point33.MoveToWorld( new Point3D(  2609, 469, 40  ), Map.Felucca );
			point33.NextPoint = point34;
			point34.MoveToWorld( new Point3D(  2582, 493, 40   ), Map.Felucca );
			point34.NextPoint = point35;
			point35.MoveToWorld( new Point3D(  2578, 500, 22  ), Map.Felucca );
			point35.NextPoint = point36;
			point36.MoveToWorld( new Point3D(  2604, 496, 20  ), Map.Felucca );
			point36.NextPoint = point37;
			point37.MoveToWorld( new Point3D(  2606, 502, 0  ), Map.Felucca );
			point37.NextPoint = point14;
			spawner2.Name = "MaginciaInvasionFelucca";
			spawner2.Respawn();

			Spawner spawner3 = new Spawner( 6, 5, 15, 0, 10, "Orc" );
			spawner3.MoveToWorld( new Point3D(  2555, 370, 15  ), Map.Felucca );
			spawner3.WayPoint = point38;
			point38.MoveToWorld( new Point3D(  2532, 389, 15  ), Map.Felucca );
			point38.NextPoint = point39;
			point39.MoveToWorld( new Point3D(  2510, 386, 15  ), Map.Felucca );
			point39.NextPoint = point40;
			point40.MoveToWorld( new Point3D(  2500, 419, 15  ), Map.Felucca );
			point40.NextPoint = point41;
			point41.MoveToWorld( new Point3D(  2445, 419, 15  ), Map.Felucca );
			point41.NextPoint = point42;
			point42.MoveToWorld( new Point3D(  2445, 447, 15  ), Map.Felucca );
			point42.NextPoint = point43;
			point43.MoveToWorld( new Point3D(  2501, 444, 15  ), Map.Felucca );
			point43.NextPoint = point44;
			point44.MoveToWorld( new Point3D(  2501, 485, 15  ), Map.Felucca );
			point44.NextPoint = point45;
			point45.MoveToWorld( new Point3D(  2469, 483, 15  ), Map.Felucca );
			point45.NextPoint = point46;
			point46.MoveToWorld( new Point3D(  2469, 461, 15  ), Map.Felucca );
			point46.NextPoint = point47;
			point47.MoveToWorld( new Point3D(  2476, 461, 15  ), Map.Felucca );
			point47.NextPoint = point48;
			point48.MoveToWorld( new Point3D(  2476, 435, 15  ), Map.Felucca );
			point48.NextPoint = point49;
			point49.MoveToWorld( new Point3D(  2467, 435, 15  ), Map.Felucca );
			point49.NextPoint = point50;
			point50.MoveToWorld( new Point3D(  2467, 418, 15  ), Map.Felucca );
			point50.NextPoint = point51;
			point51.MoveToWorld( new Point3D(  2500, 419, 15  ), Map.Felucca );
			point51.NextPoint = point39;
			spawner3.Name = "MaginciaInvasionFelucca";
			spawner3.Respawn();

			Spawner spawner4 = new Spawner( 4, 5, 15, 0, 50, "Orc" );
			spawner4.MoveToWorld( new Point3D(  2598, 747, 0  ), Map.Felucca );
			spawner4.WayPoint = point52;
			point52.MoveToWorld( new Point3D(  2579, 690, 0  ), Map.Felucca );
			point52.NextPoint = point53;
			point53.MoveToWorld( new Point3D(  2561, 623, 0  ), Map.Felucca );
			point53.NextPoint = point54;
			point54.MoveToWorld( new Point3D(  2513, 620, 0  ), Map.Felucca );
			point54.NextPoint = point55;
			point55.MoveToWorld( new Point3D(  2517, 562, 0  ), Map.Felucca );
			point55.NextPoint = point56;
			point56.MoveToWorld( new Point3D(  2486, 564, 5  ), Map.Felucca );
			point56.NextPoint = point57;
			point57.MoveToWorld( new Point3D(  2486, 544, 0  ), Map.Felucca );
			point57.NextPoint = point58;
			point58.MoveToWorld( new Point3D(  2465, 543, 0  ), Map.Felucca );
			point58.NextPoint = point59;
			point59.MoveToWorld( new Point3D(  2465, 528, 15  ), Map.Felucca );
			point59.NextPoint = point60;
			point60.MoveToWorld( new Point3D(  2455, 528, 15  ), Map.Felucca );
			point60.NextPoint = point61;
			point61.MoveToWorld( new Point3D(  2455, 513, 15  ), Map.Felucca );
			point61.NextPoint = point62;
			point62.MoveToWorld( new Point3D(  2475, 513, 15  ), Map.Felucca );
			point62.NextPoint = point63;
			point63.MoveToWorld( new Point3D(  2475, 528, 15  ), Map.Felucca );
			point63.NextPoint = point60;
			spawner4.Name = "MaginciaInvasionFelucca";
			spawner4.Respawn();

			Spawner spawner5 = new Spawner( 6, 5, 15, 0, 4, "Orc" );
			spawner5.MoveToWorld( new Point3D(  2579, 376, 5  ), Map.Felucca );
			spawner5.WayPoint = point65;
			point64.MoveToWorld( new Point3D(  2579, 398, 15  ), Map.Felucca );
			point64.NextPoint = point65;
			point65.MoveToWorld( new Point3D(  2623, 437, 15  ), Map.Felucca );
			point65.NextPoint = point66;
			point66.MoveToWorld( new Point3D(  2617, 506, 15  ), Map.Felucca );
			point66.NextPoint = point67;
			point67.MoveToWorld( new Point3D(  2562, 513, 15  ), Map.Felucca );
			point67.NextPoint = point68;
			point68.MoveToWorld( new Point3D(  2551, 501, 15  ), Map.Felucca );
			point68.NextPoint = point69;
			point69.MoveToWorld( new Point3D(  2525, 501, 15  ), Map.Felucca );
			point69.NextPoint = point70;
			point70.MoveToWorld( new Point3D(  2525, 516, 0  ), Map.Felucca );
			point70.NextPoint = point71;
			point71.MoveToWorld( new Point3D(  2489, 516, 0  ), Map.Felucca );
			point71.NextPoint = point72;
			point72.MoveToWorld( new Point3D(  2489, 482, 15  ), Map.Felucca );
			point72.NextPoint = point73;
			point73.MoveToWorld( new Point3D(  2500, 484, 15  ), Map.Felucca );
			point73.NextPoint = point74;
			point74.MoveToWorld( new Point3D(  2500, 442, 15  ), Map.Felucca );
			point74.NextPoint = point75;
			point75.MoveToWorld( new Point3D(  2514, 442, 15  ), Map.Felucca );
			point75.NextPoint = point76;
			point76.MoveToWorld( new Point3D(  2514, 419, 15  ), Map.Felucca );
			point76.NextPoint = point77;
			point77.MoveToWorld( new Point3D(  2445, 419, 15  ), Map.Felucca );
			point77.NextPoint = point78;
			point78.MoveToWorld( new Point3D(  2444, 444, 15  ), Map.Felucca );
			point78.NextPoint = point79;
			point79.MoveToWorld( new Point3D(  2531, 444, 15  ), Map.Felucca );
			point79.NextPoint = point69;
			spawner5.Name = "MaginciaInvasionFelucca";
			spawner5.Respawn();

			Spawner spawner6 = new Spawner( 1, 5, 15, 0, 0, "OrcishLord" );
			spawner6.MoveToWorld( new Point3D(  2420, 420, 15  ), Map.Felucca );
			spawner6.WayPoint = point80;
			point80.MoveToWorld( new Point3D(  2489, 419, 15  ), Map.Felucca );
			point80.NextPoint = point81;
			point81.MoveToWorld( new Point3D(  2491, 442, 15  ), Map.Felucca );
			point81.NextPoint = point82;
			point82.MoveToWorld( new Point3D(  2476, 442, 15  ), Map.Felucca );
			point82.NextPoint = point83;
			point83.MoveToWorld( new Point3D(  2475, 460, 15  ), Map.Felucca );
			point83.NextPoint = point84;
			point84.MoveToWorld( new Point3D(  2467, 460, 15  ), Map.Felucca );
			point84.NextPoint = point85;
			point85.MoveToWorld( new Point3D(  2469, 481, 15  ), Map.Felucca );
			point85.NextPoint = point86;
			point86.MoveToWorld( new Point3D(  2491, 481, 15  ), Map.Felucca );
			point86.NextPoint = point87;
			point87.MoveToWorld( new Point3D(  2488, 564, 5  ), Map.Felucca );
			point87.NextPoint = point88;
			point88.MoveToWorld( new Point3D(  2514, 561, 0  ), Map.Felucca );
			point88.NextPoint = point89;
			point89.MoveToWorld( new Point3D(  2516, 529, 0  ), Map.Felucca );
			point89.NextPoint = point90;
			point90.MoveToWorld( new Point3D(  2489, 529, 0  ), Map.Felucca );
			point90.NextPoint = point91;
			point91.MoveToWorld( new Point3D(  2489, 493, 15  ), Map.Felucca );
			point91.NextPoint = point92;
			point92.MoveToWorld( new Point3D(  2504, 482, 15  ), Map.Felucca );
			point92.NextPoint = point80;
			spawner6.Name = "MaginciaInvasionFelucca";
			spawner6.Respawn();

			Spawner spawner7 = new Spawner( 1, 5, 15, 0, 0, "OrcCaptain" );
			spawner7.MoveToWorld( new Point3D(  1351, 1757, 17  ), Map.Felucca );
			spawner7.WayPoint = point93;
			point93.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point93.NextPoint = point94;
			point94.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point94.NextPoint = point95;
			point95.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point95.NextPoint = point96;
			point96.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point96.NextPoint = point97;
			point97.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point97.NextPoint = point98;
			point98.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point98.NextPoint = point99;
			point99.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point99.NextPoint = point100;
			point100.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point100.NextPoint = point101;
			point101.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point101.NextPoint = point102;
			point102.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point102.NextPoint = point103;
			spawner7.Name = "MaginciaInvasionFelucca";
			spawner7.Respawn();

			Spawner spawner8 = new Spawner( 1, 10, 20, 0, 10, "OrcBrute" );
			spawner8.MoveToWorld( new Point3D(  1370, 1749, 3  ), Map.Felucca );
			spawner8.WayPoint = point103;
			point103.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point103.NextPoint = point104;
			point104.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point104.NextPoint = point105;
			point105.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point105.NextPoint = point106;
			point106.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point106.NextPoint = point107;
			point107.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point107.NextPoint = point108;
			point108.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point108.NextPoint = point109;
			point109.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point109.NextPoint = point110;
			point110.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point110.NextPoint = point111;
			point111.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point111.NextPoint = point112;
			point112.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point112.NextPoint = point113;
			point113.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point113.NextPoint = point114;
			point114.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point114.NextPoint = point115;
			point115.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point125.NextPoint = point116;
			point116.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point116.NextPoint = point117;
			point117.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point117.NextPoint = point118;
			point118.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point118.NextPoint = point119;
			point119.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point119.NextPoint = point120;
			point120.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point120.NextPoint = point103;
			spawner8.Name = "MaginciaInvasionFelucca";
			spawner8.Respawn();*/

                                           World.Broadcast( 33, true, "Magincia Felucca is under invasion." );
		               from.SendGump( new CityInvasion( from ) );
                                   	 break; 
                            }  
		case 2:
		{
			GuardedRegion reg = from.Region as GuardedRegion;

			if ( reg == null )
			{
				from.SendMessage( 33, "You are not in a The guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards on." );
			}
                                           else if ( !reg.Disabled )
                                           {
				from.SendMessage( 3, "The guards in THIS region have not changed." );
                                           }

                                           else if ( reg.Disabled )
                                           {
			              reg.Disabled = !reg.Disabled;
			              from.SendMessage( 3, "The guards in THIS region have been enabled." );
                                           }
                                           if ( DummyMessage && reg != null  )
                                          {
				from.SendMessage( 33, "If you are not in a The guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards on." );
                                           }
			              MaginciaInvasionStone maginciafel = new MaginciaInvasionStone();
			              maginciafel.StopMaginciaFelucca();
                                                        World.Broadcast( 33, true, "Magincia Felucca's invasion was successfully beaten back. No more invaders are left in the city." );
		                            from.SendGump( new CityInvasion( from ) );
                                   	              break; 
				}
			}
		}
예제 #14
0
        public void Defrag( Spawner parent )
        {
            for ( int i = 0; i < m_Creatures.Count; ++i )
            {
                IEntity e = m_Creatures[i];
                bool remove = false;

                if ( e is Item )
                {
                    Item item = (Item)e;

                    if ( item.Deleted || item.RootParent is Mobile || item.IsLockedDown || item.IsSecure || item.Spawner == null )
                        remove = true;
                }
                else if ( e is Mobile )
                {
                    Mobile m = (Mobile)e;

                    if ( m.Deleted )
                        remove = true;
                    else if ( m is BaseCreature )
                    {
                        BaseCreature c = (BaseCreature)m;

                        if ( c.Controlled || c.IsStabled )
                            remove = true;
            /*
                        else if ( c.Combatant == null && ( c.GetDistanceToSqrt( Location ) > (c.RangeHome * 4) ) )
                        {
                            //m_Creatures[i].Delete();
                            m_Creatures.RemoveAt( i );
                            --i;
                            c.Delete();
                            remove = true;
                        }
            */
                    }
                    else if ( m.Spawner == null )
                        remove = true;
                }
                else
                    remove = true;

                if ( remove )
                {
                    m_Creatures.RemoveAt( i-- );
                    if ( parent.Creatures.ContainsKey( e ) )
                        parent.Creatures.Remove( e );
                }
            }
        }
예제 #15
0
        private static void MakeSpawner( string[] types, int x, int y, Map map )
        {
            if ( types.Length == 0 )
                return;

            int z = GetSpawnerZ( x, y, map );

            ClearSpawners( x, y, z, map );

            for ( int i = 0; i < types.Length; ++i )
            {
                bool isGuildmaster = ( types[i].EndsWith( "Guildmaster" ) );

                Spawner sp = new Spawner( types[i] );

                if ( isGuildmaster )
                    sp.Count = 1;
                else
                    sp.Count = NPCCount;

                sp.MinDelay = MinTime;
                sp.MaxDelay = MaxTime;
                sp.Team = Team;
                sp.HomeRange = HomeRange;

                sp.MoveToWorld( new Point3D( x, y, z ), map );

                if ( TotalRespawn )
                {
                    sp.Respawn();
                    sp.BringToHome();
                }

                ++m_Count;
            }
        }
예제 #16
0
        private static void ImportSpawner(XmlElement node)
        {
            int count = int.Parse(GetText(node["count"], "1"));
            int homeRange = int.Parse(GetText(node["homerange"], "4"));

            int walkingRange = int.Parse(GetText(node["walkingrange"], "-1"));

            int team = int.Parse(GetText(node["team"], "0"));
			
            bool group = bool.Parse(GetText(node["group"], "False"));
            TimeSpan maxDelay = TimeSpan.Parse(GetText(node["maxdelay"], "10:00"));
            TimeSpan minDelay = TimeSpan.Parse(GetText(node["mindelay"], "05:00"));
            List<string> creaturesName = LoadCreaturesName(node["creaturesname"]);
		
            string name = GetText(node["name"], "Spawner");
            Point3D location = Point3D.Parse(GetText(node["location"], "Error"));
            Map map = Map.Parse(GetText(node["map"], "Error"));
			
            Spawner spawner = new Spawner(count, minDelay, maxDelay, team, homeRange, creaturesName);
            if (walkingRange >= 0)
                spawner.WalkingRange = walkingRange;

            spawner.Name = name;
            spawner.MoveToWorld(location, map);
            if (spawner.Map == Map.Internal)
            {
                spawner.Delete();
                throw new Exception("Spawner created on Internal map.");
            }
            spawner.Respawn();
        }
        public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;
            switch ( info.ButtonID )
            {
            case 0:
            {

                                    from.CloseGump( typeof( StartStopCovetram ) );
                from.SendGump( new CityInvasion( from ) );
                                    break;
                             }
            case 1:
            {
            Point3D loc = new Point3D( 568, 1311, 0 );

            WayPoint point = new WayPoint();
            WayPoint point1 = new WayPoint();
            WayPoint point2 = new WayPoint();
            WayPoint point3 = new WayPoint();
            WayPoint point4 = new WayPoint();
            WayPoint point5 = new WayPoint();
            WayPoint point6 = new WayPoint();
            WayPoint point7 = new WayPoint();
            WayPoint point8 = new WayPoint();
            WayPoint point9 = new WayPoint();

            WayPoint point10 = new WayPoint();
            WayPoint point11 = new WayPoint();
            WayPoint point12 = new WayPoint();
            WayPoint point13 = new WayPoint();
            WayPoint point14 = new WayPoint();
            WayPoint point15 = new WayPoint();
            WayPoint point16 = new WayPoint();
            WayPoint point17 = new WayPoint();
            WayPoint point18 = new WayPoint();
            WayPoint point19 = new WayPoint();

            WayPoint point20 = new WayPoint();
            WayPoint point21 = new WayPoint();
            WayPoint point22 = new WayPoint();
            WayPoint point23 = new WayPoint();
            WayPoint point24 = new WayPoint();
            WayPoint point25 = new WayPoint();
            WayPoint point26 = new WayPoint();
            WayPoint point27 = new WayPoint();
            WayPoint point28 = new WayPoint();
            WayPoint point29 = new WayPoint();

            WayPoint point30 = new WayPoint();
            WayPoint point31 = new WayPoint();
            WayPoint point32 = new WayPoint();
            WayPoint point33 = new WayPoint();
            WayPoint point34 = new WayPoint();
            WayPoint point35 = new WayPoint();
            WayPoint point36 = new WayPoint();
            WayPoint point37 = new WayPoint();

            point.Name = "CoveInvasionTrammel";
            point1.Name = "CoveInvasionTrammel";
            point2.Name = "CoveInvasionTrammel";
            point3.Name = "CoveInvasionTrammel";
            point4.Name = "CoveInvasionTrammel";
            point5.Name = "CoveInvasionTrammel";
            point6.Name = "CoveInvasionTrammel";
            point7.Name = "CoveInvasionTrammel";
            point8.Name = "CoveInvasionTrammel";
            point9.Name = "CoveInvasionTrammel";

            point10.Name = "CoveInvasionTrammel";
            point11.Name = "CoveInvasionTrammel";
            point12.Name = "CoveInvasionTrammel";
            point13.Name = "CoveInvasionTrammel";
            point14.Name = "CoveInvasionTrammel";
            point15.Name = "CoveInvasionTrammel";
            point16.Name = "CoveInvasionTrammel";
            point17.Name = "CoveInvasionTrammel";
            point18.Name = "CoveInvasionTrammel";
            point19.Name = "CoveInvasionTrammel";

            point20.Name = "CoveInvasionTrammel";
            point21.Name = "CoveInvasionTrammel";
            point22.Name = "CoveInvasionTrammel";
            point23.Name = "CoveInvasionTrammel";
            point24.Name = "CoveInvasionTrammel";
            point25.Name = "CoveInvasionTrammel";
            point26.Name = "CoveInvasionTrammel";
            point27.Name = "CoveInvasionTrammel";
            point28.Name = "CoveInvasionTrammel";
            point29.Name = "CoveInvasionTrammel";

            point30.Name = "CoveInvasionTrammel";
            point31.Name = "CoveInvasionTrammel";
            point32.Name = "CoveInvasionTrammel";
            point33.Name = "CoveInvasionTrammel";
            point34.Name = "CoveInvasionTrammel";
            point35.Name = "CoveInvasionTrammel";
            point36.Name = "CoveInvasionTrammel";
            point37.Name = "CoveInvasionTrammel";

            Spawner spawner1 = new Spawner( 4, 5, 15, 0, 4, "OrcBomber" );
            spawner1.MoveToWorld( new Point3D( 2322, 1127, 0 ), Map.Trammel );
            spawner1.WayPoint = point;
            point.MoveToWorld( new Point3D( 2313, 1169, 0 ), Map.Trammel );
            point.NextPoint = point1;
            point1.MoveToWorld( new Point3D( 2285, 1210, 0 ), Map.Trammel );
            point1.NextPoint = point2;
            point2.MoveToWorld( new Point3D( 2253, 1210, 0 ), Map.Trammel );
            point2.NextPoint = point3;
            point3.MoveToWorld( new Point3D( 2236, 1216, 0 ), Map.Trammel );
            point3.NextPoint = point4;
            point4.MoveToWorld( new Point3D( 2236, 1196, 0 ), Map.Trammel );
            point4.NextPoint = point5;
            point5.MoveToWorld( new Point3D( 2243, 1196, 0 ), Map.Trammel );
            point5.NextPoint = point6;
            point6.MoveToWorld( new Point3D( 2243, 1182, 0 ), Map.Trammel );
            point6.NextPoint = point7;
            point7.MoveToWorld( new Point3D( 2227, 1166, 0 ), Map.Trammel );
            point7.NextPoint = point8;
            point8.MoveToWorld( new Point3D( 2221, 1205, 0 ), Map.Trammel );
            point8.NextPoint = point9;
            point9.MoveToWorld( new Point3D( 2237, 1210, 0 ), Map.Trammel );
            point9.NextPoint = point2;
              			spawner1.Name = "CoveInvasionTrammel";
            spawner1.Respawn();

            Spawner spawner2 = new Spawner( 4, 5, 15, 0, 10, "Orc" );
            spawner2.MoveToWorld( new Point3D(  2348, 1214, 0  ), Map.Trammel );
            spawner2.WayPoint = point10;
            point10.MoveToWorld( new Point3D(  2285, 1210, 0  ), Map.Trammel );
            point10.NextPoint = point11;
            point11.MoveToWorld( new Point3D(  2268, 1210, 0  ), Map.Trammel );
            point11.NextPoint = point12;
            point12.MoveToWorld( new Point3D(  2268, 1231, 0  ), Map.Trammel );
            point12.NextPoint = point13;
            point13.MoveToWorld( new Point3D(  2251, 1231, 0  ), Map.Trammel );
            point13.NextPoint = point14;
            point14.MoveToWorld( new Point3D(  2251, 1214, 0  ), Map.Trammel );
            point14.NextPoint = point15;
            point15.MoveToWorld( new Point3D( 2234, 1211, 0 ), Map.Trammel );
            point15.NextPoint = point16;
            point16.MoveToWorld( new Point3D( 2210, 1200, 0 ), Map.Trammel );
            point16.NextPoint = point17;
            point17.MoveToWorld( new Point3D( 2210, 1177, 0 ), Map.Trammel );
            point17.NextPoint = point18;
            point18.MoveToWorld( new Point3D( 2240, 1177, 0 ), Map.Trammel );
            point18.NextPoint = point19;
            point19.MoveToWorld( new Point3D( 2276, 1211, 0 ), Map.Trammel );
            point19.NextPoint = point11;
            spawner2.Name = "CoveInvasionTrammel";
            spawner2.Respawn();

            Spawner spawner3 = new Spawner( 6, 5, 15, 0, 0, "Orc" );
            spawner3.MoveToWorld( new Point3D( 2210, 1274, 0 ), Map.Trammel );
            spawner3.WayPoint = point20;
            point20.MoveToWorld( new Point3D( 2284, 1268, 0 ), Map.Trammel );
            point20.NextPoint = point21;
            point21.MoveToWorld( new Point3D( 2294, 1207, 0 ), Map.Trammel );
            point21.NextPoint = point22;
            point22.MoveToWorld( new Point3D( 2286, 1186, 0 ), Map.Trammel );
            point22.NextPoint = point23;
            point23.MoveToWorld( new Point3D( 2286, 1218, 0 ), Map.Trammel );
            point23.NextPoint = point22;
            spawner3.Name = "CoveInvasionTrammel";
            spawner3.Respawn();

            Spawner spawner4 = new Spawner( 4, 5, 15, 0, 20, "Orc" );
            spawner4.MoveToWorld( new Point3D( 2364, 1205, 5 ), Map.Trammel );
            spawner4.WayPoint = point24;
            point24.MoveToWorld( new Point3D( 2285, 1210, 0 ), Map.Trammel );
            point24.NextPoint = point25;
            point25.MoveToWorld( new Point3D( 2275, 1209, 0 ), Map.Trammel );
            point25.NextPoint = point26;
            point26.MoveToWorld( new Point3D( 2275, 1203, 0 ), Map.Trammel );
            point26.NextPoint = point27;
            point27.MoveToWorld( new Point3D( 2272, 1200, 2 ), Map.Trammel );
            point27.NextPoint = point28;
            point28.MoveToWorld( new Point3D( 2272, 1196, 20 ), Map.Trammel );
            point28.NextPoint = point29;
            point29.MoveToWorld( new Point3D( 2282, 1200, 20 ), Map.Trammel );
            point29.NextPoint = point30;
            point30.MoveToWorld( new Point3D( 2282, 1187, 20 ), Map.Trammel );
            point30.NextPoint = point31;
            point31.MoveToWorld( new Point3D( 2282, 1222, 20 ), Map.Trammel );
            point31.NextPoint = point32;
            point32.MoveToWorld( new Point3D( 2290, 1222, 20 ), Map.Trammel );
            point32.NextPoint = point33;
            point33.MoveToWorld( new Point3D( 2287, 1228, 20 ), Map.Trammel );
            point33.NextPoint = point34;
            point34.MoveToWorld( new Point3D( 2280, 1224, 20 ), Map.Trammel );
            point34.NextPoint = point35;
            point35.MoveToWorld( new Point3D( 2280, 1227, 7 ), Map.Trammel );
            point35.NextPoint = point36;
            point36.MoveToWorld( new Point3D( 2283, 1233, 0 ), Map.Trammel );
            point36.NextPoint = point37;
            point37.MoveToWorld( new Point3D( 2273, 1233, 0 ), Map.Trammel );
            point37.NextPoint = point26;
            spawner4.Name = "CoveInvasionTrammel";
            spawner4.Respawn();

            Spawner spawner5 = new Spawner( 4, 5, 15, 0, 8, "OrcishLord" );
            spawner5.MoveToWorld( new Point3D( 2219, 1117, 17 ), Map.Trammel );
                        spawner5.Name = "CoveInvasionTrammel";
            spawner5.Respawn();

                        Spawner spawner6 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner6.MoveToWorld( new Point3D( 2322, 1127, 0 ), Map.Trammel );
                        spawner6.Name = "CoveInvasionTrammel";
            spawner6.Respawn();

                        Spawner spawner7 = new Spawner( 3, 5, 15, 0, 8, "OrcishLord" );
            spawner7.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner7.Name = "CoveInvasionTrammel";
            spawner7.Respawn();

                        Spawner spawner8 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner8.MoveToWorld( new Point3D( 2210, 1274, 0 ), Map.Trammel );
                        spawner8.Name = "CoveInvasionTrammel";
            spawner8.Respawn();

                        Spawner spawner9 = new Spawner( 3, 5, 15, 0, 8, "OrcishLord" );
            spawner9.MoveToWorld( new Point3D( 2364, 1205, 5 ), Map.Trammel );
                        spawner9.Name = "CoveInvasionTrammel";
            spawner9.Respawn();

                        Spawner spawner10 = new Spawner( 3, 5, 15, 0, 20, "OrcScout" );
            spawner10.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner10.Name = "CoveInvasionTrammel";
            spawner10.Respawn();

                        Spawner spawner11 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner11.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner11.Name = "CoveInvasionTrammel";
            spawner11.Respawn();

                        Spawner spawner12 = new Spawner( 2, 5, 15, 0, 8, "OrcishLord" );
            spawner12.MoveToWorld( new Point3D( 2225, 1168, 0 ), Map.Trammel );
                        spawner12.Name = "CoveInvasionTrammel";
            spawner12.Respawn();

                        Spawner spawner13 = new Spawner( 2, 5, 15, 0, 8, "OrcishMage" );
            spawner13.MoveToWorld( new Point3D( 2216, 1190, 0 ), Map.Trammel );
                        spawner13.Name = "CoveInvasionTrammel";
            spawner13.Respawn();

                        Spawner spawner14 = new Spawner( 2, 5, 15, 0, 8, "OrcishLord" );
            spawner14.MoveToWorld( new Point3D( 2234, 1210, 0 ), Map.Trammel );
                        spawner14.Name = "CoveInvasionTrammel";
            spawner14.Respawn();

                        Spawner spawner15 = new Spawner( 2, 5, 15, 0, 8, "OrcishMage" );
            spawner15.MoveToWorld( new Point3D( 2277, 1200, 20 ), Map.Trammel );
                        spawner15.Name = "CoveInvasionTrammel";
            spawner15.Respawn();

                        Spawner spawner16 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner16.MoveToWorld( new Point3D( 2295, 1203, 0 ), Map.Trammel );
                        spawner16.Name = "CoveInvasionTrammel";
            spawner16.Respawn();

                        Spawner spawner17 = new Spawner( 10, 5, 15, 0, 25, "Orc" );
            spawner17.MoveToWorld( new Point3D( 2295, 1203, 0 ), Map.Trammel );
                        spawner17.Name = "CoveInvasionTrammel";
            spawner17.Respawn();

                        Spawner spawner18 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner18.MoveToWorld( new Point3D( 2301, 1229, 0 ), Map.Trammel );
                        spawner18.Name = "CoveInvasionTrammel";
            spawner18.Respawn();

                        Spawner spawner19 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner19.MoveToWorld( new Point3D( 2223, 1151, 0 ), Map.Trammel );
                        spawner19.Name = "CoveInvasionTrammel";
            spawner19.Respawn();

                        Spawner spawner20 = new Spawner( 10, 5, 15, 0, 15, "Orc" );
            spawner20.MoveToWorld( new Point3D( 2224, 1181, 0 ), Map.Trammel );
                        spawner20.Name = "CoveInvasionTrammel";
            spawner20.Respawn();

                        Spawner spawner21 = new Spawner( 10, 5, 15, 0, 15, "Orc" );
            spawner21.MoveToWorld( new Point3D( 2247, 1219, 0 ), Map.Trammel );
                        spawner21.Name = "CoveInvasionTrammel";
            spawner21.Respawn();

                        Spawner spawner22 = new Spawner( 5, 5, 15, 0, 15, "Orc" );
            spawner22.MoveToWorld( new Point3D( 2224, 1181, 0 ), Map.Trammel );
                        spawner22.Name = "CoveInvasionTrammel";
            spawner22.Respawn();

                        Spawner spawner23 = new Spawner( 3, 5, 15, 0, 10, "OrcScout" );
            spawner23.MoveToWorld( new Point3D( 2299, 1252, 0 ), Map.Trammel );
                        spawner23.Name = "CoveInvasionTrammel";
            spawner23.Respawn();

                        Spawner spawner24 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner24.MoveToWorld( new Point3D( 2257, 1204, 0 ), Map.Trammel );
                        spawner24.Name = "CoveInvasionTrammel";
            spawner24.Respawn();

                        Spawner spawner25 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner25.MoveToWorld( new Point3D( 2222, 1129, 0 ), Map.Trammel );
                        spawner25.Name = "CoveInvasionTrammel";
            spawner25.Respawn();

                        Spawner spawner26 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner26.MoveToWorld( new Point3D( 2271, 1218, 0 ), Map.Trammel );
                        spawner26.Name = "CoveInvasionTrammel";
            spawner26.Respawn();

                        Spawner spawner27 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner27.MoveToWorld( new Point3D( 2233, 1240, 0 ), Map.Trammel );
                        spawner27.Name = "CoveInvasionTrammel";
            spawner27.Respawn();

                        Spawner spawner28 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner28.MoveToWorld( new Point3D( 2289, 1222, 20 ), Map.Trammel );
                        spawner28.Name = "CoveInvasionTrammel";
            spawner28.Respawn();

                        Spawner spawner29 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner29.MoveToWorld( new Point3D( 2281, 1192, 20 ), Map.Trammel );
                        spawner29.Name = "CoveInvasionTrammel";
            spawner29.Respawn();

                        Spawner spawner30 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner30.MoveToWorld( new Point3D( 2303, 1131, 0 ), Map.Trammel );
                        spawner30.Name = "CoveInvasionTrammel";
            spawner30.Respawn();

                        Spawner spawner31 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner31.MoveToWorld( new Point3D( 2292, 1110, 0 ), Map.Trammel );
                        spawner31.Name = "CoveInvasionTrammel";
            spawner31.Respawn();

                        Spawner spawner32 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner32.MoveToWorld( new Point3D( 2347, 1151, 5 ), Map.Trammel );
                        spawner32.Name = "CoveInvasionTrammel";
            spawner32.Respawn();

                        Spawner spawner33 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner32.MoveToWorld( new Point3D( 2361, 1183, 10 ), Map.Trammel );
                        spawner33.Name = "CoveInvasionTrammel";
            spawner33.Respawn();

                        Spawner spawner34 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner34.MoveToWorld( new Point3D( 2351, 1245, 10 ), Map.Trammel );
                        spawner34.Name = "CoveInvasionTrammel";
            spawner34.Respawn();

                        Spawner spawner35 = new Spawner( 1, 2, 2, 0, 2, "LordOrcalis" );
            spawner35.MoveToWorld( new Point3D( 2213, 1115, 40 ), Map.Trammel );
                        spawner35.Name = "CoveInvasionTrammel";
            spawner35.Respawn();

                        Spawner spawner36 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner36.MoveToWorld( new Point3D( 2270, 1127, 40 ), Map.Trammel );
                        spawner36.Name = "CoveInvasionTrammel";
            spawner36.Respawn();

                        Spawner spawner37 = new Spawner( 3, 5, 15, 0, 10, "OrcScout" );
            spawner37.MoveToWorld( new Point3D( 2270, 1127, 40 ), Map.Trammel );
                        spawner37.Name = "CoveInvasionTrammel";
            spawner37.Respawn();

                        Spawner spawner38 = new Spawner( 10, 20, 20, 0, 20, "OrcBomber" );
            spawner38.MoveToWorld( new Point3D( 2253, 1193, -2 ), Map.Trammel );
                        spawner38.Name = "CoveInvasionTrammel";
            spawner38.Respawn();

                        Spawner spawner39 = new Spawner( 10, 20, 20, 0, 20, "OrcBomber" );
            spawner39.MoveToWorld( new Point3D( 2225, 1141, 0 ), Map.Trammel );
                        spawner39.Name = "CoveInvasionTrammel";
            spawner39.Respawn();

                                           World.Broadcast( 33, true, "Cove Trammel is under invasion." );
                       from.SendGump( new CityInvasion( from ) );
                                   	 break;
                            }
            case 2:
            {
            CoveInvasionStone covetram = new CoveInvasionStone();
            covetram.StopCoveTrammel();
                                          World.Broadcast( 33, true, "Cove Trammel's invasion was successfully beaten back. No more invaders are left in the city." );
                      from.SendGump( new CityInvasion( from ) );
                                   	break;
                }
            }
        }
예제 #18
0
 public InternalTimer(Spawner spawner, TimeSpan delay) : base(delay)
 {
     m_Spawner = spawner;
 }
예제 #19
0
        public void Defrag(Spawner parent)
        {
            for (int i = 0; i < m_Spawned.Count; ++i)
            {
                ISpawnable e      = m_Spawned[i];
                bool       remove = false;

                if (e is Item)
                {
                    Item item = (Item)e;

                    if (item.Deleted || item.RootParent is Mobile || item.IsLockedDown || item.IsSecure || item.Spawner == null)
                    {
                        remove = true;
                    }
                }
                else if (e is Mobile)
                {
                    Mobile m = (Mobile)e;

                    if (m.Deleted)
                    {
                        remove = true;
                    }
                    else if (m is BaseCreature)
                    {
                        BaseCreature c = (BaseCreature)m;

                        if (c.Controlled || c.IsStabled)
                        {
                            remove = true;
                        }

/*
 *                                              else if ( c.Combatant == null && ( c.GetDistanceToSqrt( Location ) > (c.RangeHome * 4) ) )
 *                                              {
 *                                                      //m_Spawned[i].Delete();
 *                                                      m_Spawned.RemoveAt( i );
 *                                                      --i;
 *                                                      c.Delete();
 *                                                      remove = true;
 *                                              }
 */
                    }
                    else if (m.Spawner == null)
                    {
                        remove = true;
                    }
                }
                else
                {
                    remove = true;
                }

                if (remove)
                {
                    m_Spawned.RemoveAt(i--);
                    if (parent.Spawned.ContainsKey(e))
                    {
                        parent.Spawned.Remove(e);
                    }
                }
            }
        }
예제 #20
0
		public SpawnerGump( Spawner spawner, SpawnerEntry focusentry, int page ) : base( 50, 50 )
		{
			m_Spawner = spawner;
			m_Entry = focusentry;
			m_Page = page;

			AddPage( 0 );

			AddBackground( 0, 0, 343, 371 + ( m_Entry != null ? 44 : 0 ), 5054 );

			AddHtml( 95, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Creatures List</BASEFONT>", false, false );
			AddHtml( 245, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>#</BASEFONT>", false, false );
			AddHtml( 282, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Prb</BASEFONT>", false, false );

			//AddLabel( 95, 1, 0, "Creatures List" );

			int offset = 0;

			for ( int i = 0; i < 13; i++ )
			{
				int textindex = i * 5;
				int entryindex = ( m_Page * 13 ) + i;

				SpawnerEntry entry = null;

				if ( entryindex < spawner.Entries.Count )
					entry = m_Spawner.Entries[entryindex];

				if ( entry == null || m_Entry != entry )
					AddButton( 5, ( 22 * i ) + 21 + offset, entry != null ? 0xFBA : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Expand
				else
					AddButton( 5, ( 22 * i ) + 21 + offset, entry != null ? 0xFBB : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Unexpand

				AddButton( 38, ( 22 * i ) + 21 + offset, 0xFA2, 0xFA4, GetButtonID( 2, 1 + (i * 2) ), GumpButtonType.Reply, 0 ); //Delete

				AddImageTiled( 71, (22 * i) + 20 + offset, 161, 23, 0xA40 ); //creature text box
				AddImageTiled( 72, (22 * i) + 21 + offset, 159, 21, 0xBBC ); //creature text box

				AddImageTiled( 235, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //maxcount text box
				AddImageTiled( 236, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //maxcount text box

				AddImageTiled( 273, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //probability text box
				AddImageTiled( 274, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //probability text box

				string name = "";
				string probability = "";
				string maxcount = "";
				EntryFlags flags = EntryFlags.None;

				if ( entry != null )
				{
					name = (string)entry.SpawnedName;
					probability = entry.SpawnedProbability.ToString();
					maxcount = entry.SpawnedMaxCount.ToString();
					flags = entry.Valid;

					AddLabel( 315, (22 * i) + 20 + offset, 0, spawner.CountSpawns( entry ).ToString() );
				}

				AddTextEntry( 75, (22 * i) + 21 + offset, 156, 21, ( ( flags & EntryFlags.InvalidType ) != 0 ) ? 33 : 0, textindex, name ); //creature
				AddTextEntry( 239, (22 * i) + 21 + offset, 30, 21, 0, textindex + 1, maxcount); //max count
				AddTextEntry( 277, (22 * i) + 21 + offset, 30, 21, 0, textindex + 2, probability); //probability

				if ( entry != null && m_Entry == entry )
				{
					AddLabel( 5, (22 * i) + 42, 0x384, "Params" );
					AddImageTiled( 55, (22 * i) + 42, 253, 23, 0xA40 ); //Parameters
					AddImageTiled( 56, (22 * i) + 43, 251, 21, 0xBBC ); //Parameters

					AddLabel( 5, (22 * i) + 64, 0x384, "Props" );
					AddImageTiled( 55, (22 * i) + 64, 253, 23, 0xA40 ); //Properties
					AddImageTiled( 56, (22 * i) + 65, 251, 21, 0xBBC ); //Properties

					AddTextEntry( 59, (22 * i) + 42, 248, 21, ( ( flags & EntryFlags.InvalidParams ) != 0 ) ? 33 : 0, textindex + 3, entry.Parameters ); //parameters
					AddTextEntry( 59, (22 * i) + 62, 248, 21, ( ( flags & EntryFlags.InvalidProps ) != 0 ) ? 33 : 0, textindex + 4, entry.Properties ); //properties

					offset += 44;
				}
			}

			AddButton( 5, 347 + offset, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
			AddLabel( 38, 347 + offset, 0x384, "Cancel" );

			AddButton( 5, 325 + offset, 0xFB7, 0xFB9, GetButtonID( 1, 2 ), GumpButtonType.Reply, 0 );
			AddLabel( 38, 325 + offset, 0x384, "Okay" );

			AddButton( 110, 325 + offset, 0xFB4, 0xFB6, GetButtonID( 1, 3 ), GumpButtonType.Reply, 0 );
			AddLabel( 143, 325 + offset, 0x384, "Bring to Home" );

			AddButton( 110, 347 + offset, 0xFA8, 0xFAA, GetButtonID( 1, 4 ), GumpButtonType.Reply, 0 );
			AddLabel( 143, 347 + offset, 0x384, "Total Respawn" );

			AddButton( 253, 325 + offset, 0xFB7, 0xFB9, GetButtonID( 1, 5 ), GumpButtonType.Reply, 0 );
			AddLabel( 286, 325 + offset, 0x384, "Apply" );

			if ( m_Page > 0 )
				AddButton( 276, 308 + offset, 0x15E3, 0x15E7, GetButtonID( 1, 0 ), GumpButtonType.Reply, 0 );
			else
				AddImage( 276, 308 + offset, 0x25EA );

			if ( (m_Page + 1) * 13 <= m_Spawner.Entries.Count )
				AddButton( 293, 308 + offset, 0x15E1, 0x15E5, GetButtonID( 1, 1 ), GumpButtonType.Reply, 0 );
			else
				AddImage( 293, 308 + offset, 0x25E6 );
		}
예제 #21
0
		public SpawnerGump( Spawner spawner, int page ) : this( spawner, null, page )
		{
		}
예제 #22
0
 public SpawnerGump(Mobile m, Spawner spawner)
     : base(m as PlayerMobile, 50, 50)
 {
     Spawner = spawner;
 }
예제 #23
0
        public void CreateArray(RelayInfo info, Mobile from, Spawner spawner)
        {
            int ocount = spawner.Entries.Count;

            List <SpawnerEntry> rementries = new List <SpawnerEntry>();

            for (int i = 0; i < 13; i++)
            {
                int index      = i * 5;
                int entryindex = m_Page * 13 + i;

                TextRelay cte    = info.GetTextEntry(index);
                TextRelay mte    = info.GetTextEntry(index + 1);
                TextRelay poste  = info.GetTextEntry(index + 2);
                TextRelay parmte = info.GetTextEntry(index + 3);
                TextRelay propte = info.GetTextEntry(index + 4);

                if (cte == null)
                {
                    continue;
                }

                string str = cte.Text.Trim().ToLower();

                if (str.Length > 0)
                {
                    Type type = SpawnerType.GetType(str);

                    if (type != null)
                    {
                        SpawnerEntry entry;

                        if (entryindex < ocount)
                        {
                            entry             = spawner.Entries[entryindex];
                            entry.SpawnedName = str;

                            if (mte != null)
                            {
                                entry.SpawnedMaxCount = Utility.ToInt32(mte.Text.Trim());
                            }

                            if (poste != null)
                            {
                                entry.SpawnedProbability = Utility.ToInt32(poste.Text.Trim());
                            }
                        }
                        else
                        {
                            int maxcount  = 1;
                            int probcount = 100;

                            if (mte != null)
                            {
                                maxcount = Utility.ToInt32(mte.Text.Trim());
                            }

                            if (poste != null)
                            {
                                probcount = Utility.ToInt32(poste.Text.Trim());
                            }

                            entry = spawner.AddEntry(str, probcount, maxcount);
                        }

                        if (parmte != null)
                        {
                            entry.Parameters = parmte.Text.Trim();
                        }

                        if (propte != null)
                        {
                            entry.Properties = propte.Text.Trim();
                        }
                    }
                    else
                    {
                        from.SendMessage("{0} is not a valid type name for entry #{1}.", str, i);
                    }
                }
                else if (entryindex < ocount && spawner.Entries[entryindex] != null)
                {
                    rementries.Add(spawner.Entries[entryindex]);
                }
            }

            for (int i = 0; i < rementries.Count; i++)
            {
                spawner.RemoveEntry(rementries[i]);
            }

            if (ocount == 0 && spawner.Entries.Count > 0)
            {
                spawner.Start();
            }
        }
예제 #24
0
		public static void SaveSpawners_OnCommand(CommandEventArgs e)
		{

			if (e.Arguments.Length == 5)
			{
				int count = 0;
				int x1, y1, x2, y2;
				string FileName = e.Arguments[0].ToString();
				try
				{
					x1 = Int32.Parse(e.Arguments[1]);
					y1 = Int32.Parse(e.Arguments[2]);
					x2 = Int32.Parse(e.Arguments[3]);
					y2 = Int32.Parse(e.Arguments[4]);
				}
				catch
				{
					Usage(e.Mobile);
					return;
				}
				//adjust rect				
				if (x1 > x2)
				{
					int x3 = x1;
					x1 = x2;
					x2 = x3;
				}
				if (y1 > y2)
				{
					int y3 = y1;
					y1 = y2;
					y2 = y3;
				}
				string itemIdxPath = Path.Combine("Saves/Spawners/", FileName + ".idx");
				string itemBinPath = Path.Combine("Saves/Spawners/", FileName + ".bin");

				try
				{
					ArrayList list = new ArrayList();
					foreach (Item item in Server.World.Items.Values)
					{
						if (item is Spawner)
						{
							if (item.X >= x1 && item.Y >= y1 && item.X < x2 && item.Y < y2 && item.Map == e.Mobile.Map)
								list.Add(item);
						}
					}

					if (list.Count > 0)
					{
						try
						{
							string folder = Path.GetDirectoryName(itemIdxPath);

							if (!Directory.Exists(folder))
							{
								Directory.CreateDirectory(folder);
							}

						}
						catch
						{
							e.Mobile.SendMessage("An error occured while trying to create Spawner folder.");
						}

						count = list.Count;
						GenericWriter idx;
						GenericWriter bin;

						idx = new BinaryFileWriter(itemIdxPath, false);
						bin = new BinaryFileWriter(itemBinPath, true);

						idx.Write((int)list.Count);

						for (int i = 0; i < list.Count; ++i)
						{
							long start = bin.Position;
							Spawner temp = new Spawner();
							CopyProperties(temp, (Spawner)list[i]);

							idx.Write((long)start);
							//dont save template data as we cant load it back properly
							temp.TemplateItem = null;
							temp.TemplateMobile = null;
							temp.CreaturesName = ((Spawner)list[i]).CreaturesName;
							temp.Serialize(bin);

							idx.Write((int)(bin.Position - start));
							temp.Delete();
						}
						idx.Close();
						bin.Close();
					}
				}
				catch (Exception ex)
				{
					LogHelper.LogException(ex);
					System.Console.WriteLine("Exception Caught in SaveSpawner code: " + ex.Message);
					System.Console.WriteLine(ex.StackTrace);
				}

				e.Mobile.SendMessage("{0} Spawners Saved.", count);
			}
			else
			{
				Usage(e.Mobile);
			}
		}
예제 #25
0
            private void ExportSpawner(Spawner spawner, XmlTextWriter xml)
            {
                xml.WriteStartElement("spawner");
	
                xml.WriteStartElement("count");
                xml.WriteString(spawner.Count.ToString());		
                xml.WriteEndElement();
				
                xml.WriteStartElement("group");
                xml.WriteString(spawner.Group.ToString());
                xml.WriteEndElement();
				
                xml.WriteStartElement("homerange");
                xml.WriteString(spawner.HomeRange.ToString());
                xml.WriteEndElement();

                xml.WriteStartElement("walkingrange");
                xml.WriteString(spawner.WalkingRange.ToString());
                xml.WriteEndElement();

                xml.WriteStartElement("maxdelay");
                xml.WriteString(spawner.MaxDelay.ToString());
                xml.WriteEndElement();
				
                xml.WriteStartElement("mindelay");
                xml.WriteString(spawner.MinDelay.ToString());
                xml.WriteEndElement();
				
                xml.WriteStartElement("team");
                xml.WriteString(spawner.Team.ToString());
                xml.WriteEndElement();
				
                xml.WriteStartElement("creaturesname");
                foreach (string creatureName in spawner.SpawnNames)
                {
                    xml.WriteStartElement("creaturename");
                    xml.WriteString(creatureName);
                    xml.WriteEndElement();
                }
                xml.WriteEndElement();
				
                // Item properties
				
                xml.WriteStartElement("name");
                xml.WriteString(spawner.Name);
                xml.WriteEndElement();
				
                xml.WriteStartElement("location");
                xml.WriteString(spawner.Location.ToString());
                xml.WriteEndElement();
				
                xml.WriteStartElement("map");
                xml.WriteString(spawner.Map.ToString());
                xml.WriteEndElement();
	
                xml.WriteEndElement();
            }
예제 #26
0
        public void UpdateSpawnObjects(RelayInfo info, Mobile from)
        {
            TextRelay tr = info.GetTextEntry(500);

            if (tr != null && tr.Text.Length > 0)
            {
                m_Spawner.MaxCount = Math.Max(0, Utility.ToInt32(tr.Text));
            }

            for (int i = 0; i < MaxEntries; i++)
            {
                TextRelay te  = info.GetTextEntry(i);
                TextRelay te2 = info.GetTextEntry(i + 20);

                SpawnObject so = i < m_Spawner.SpawnObjects.Count ? m_Spawner.SpawnObjects[i] : null;

                if (te != null)
                {
                    string name     = te.Text;
                    string maxCount = te2 != null ? te2.Text : null;
                    int    max      = 0;

                    if (name.Length > 0)
                    {
                        name = name.Trim();

                        if (!String.IsNullOrEmpty(maxCount))
                        {
                            max = Utility.ToInt32(maxCount);
                        }

                        max = Math.Max(0, max);

                        string t    = Spawner.ParseType(name);
                        Type   type = ScriptCompiler.FindTypeByName(t);

                        if (type == null)
                        {
                            from.SendMessage("{0} is not a valid type name.", t);
                            continue;
                        }

                        if (so != null)
                        {
                            if (so.SpawnName != name)
                            {
                                so.SpawnName = name;
                            }

                            if (so.MaxCount != max)
                            {
                                so.MaxCount = max;
                            }
                        }
                        else
                        {
                            m_Spawner.AddSpawnObject(new SpawnObject(name, max));
                        }
                    }
                }
            }
        }
예제 #27
0
		private static void ImportPremSpawners_OnCommand( CommandEventArgs e )
		{
			if ( !Directory.Exists( "Export/Spawners" ) )
				Directory.CreateDirectory( "Export/Spawners" );

			string file = e.ArgString.Trim().ToLower();

			string filePath = Path.Combine( "Export/Spawners", file );

			if ( File.Exists( filePath ) )
			{
				//overrides
				int mapo = -1;
				double mino = -1;
				double maxo = -1;

				using ( StreamReader ip = new StreamReader( filePath ) )
				{
					string line;

					while ( (line = ip.ReadLine()) != null )
					{
						string[] split = line.Split( '|' );
						string[] splitA = line.Split( ' ' );

						if ( splitA.Length == 2 )
						{
							if ( splitA[0].ToLower() == "overridemap" )
								mapo = Utility.ToInt32( splitA[1] );
							if ( splitA[0].ToLower() == "overridemintime" )
								mino = Utility.ToDouble( splitA[1] );
							if ( splitA[0].ToLower() == "overridemaxtime" )
								maxo = Utility.ToDouble( splitA[1] );

							if ( mino > maxo )
							{
								double temp = mino;
								mino = maxo;
								maxo = mino;
							}
						}

						switch( split[0].ToLower() ) 
						{
							case "##":
								break;
							case "*":
							{
								for ( int i = 1; i < 7; i++ )
								{
									if ( !String.IsNullOrEmpty( split[i] ) )
									{
										Spawner spawner = new Spawner();
										spawner.Entries.AddRange( GetEntries( Utility.ToInt32(split[15+i]), split[i].Split(':') ) );

										spawner.Location = new Point3D( Utility.ToInt32( split[7] ), Utility.ToInt32( split[8] ), Utility.ToInt32( split[9] ) );

										switch( mapo > -1 ? mapo : Utility.ToInt32( split[10] ) )
										{
											case 1: spawner.Map = Map.Felucca; break;
											case 2: spawner.Map = Map.Trammel; break;
											case 3: spawner.Map = Map.Ilshenar; break;
											case 4: spawner.Map = Map.Malas; break;
											case 5: spawner.Map = Map.Tokuno; break;
										}

										double min = mino > -1 ? mino : Utility.ToDouble( split[11] );
										double max = maxo > -1 ? maxo : Utility.ToDouble( split[12] );

										if ( min > max )
										{
											double temp = min;
											min = max;
											max = temp;
										}

										spawner.Count = Utility.ToInt32(split[15+i]);

										spawner.MinDelay = TimeSpan.FromMinutes( min );
										spawner.MaxDelay = TimeSpan.FromMinutes( max );

										spawner.HomeRange = Utility.ToInt32( split[13] );
										spawner.WalkingRange = Utility.ToInt32( split[14] );
									}
								}

								break;
							}
						}
					}
				}
			}
			else
				e.Mobile.SendMessage( String.Format( "The file Export/Spawners/{0} doesn't exist", file ) );
		}
예제 #28
0
        public static Spawner LoadMobile(Item item)
        {
            Type t = GetType(item.Z - Offset);

            if (t == null)
            {
                return null;
            }

            var spawner = new Spawner();
            spawner.SpawnNames.Add(t.ToString());
            spawner.Running = true;
            spawner.HomeRange = 0;
            spawner.WalkingRange = 4;
            //spawner.Respawn();
            return spawner;
        }
예제 #29
0
        public SpawnerEntry( Spawner parent, GenericReader reader )
        {
            int version = reader.ReadInt();

            m_CreaturesName = reader.ReadString();
            m_CreaturesProbability = reader.ReadInt();
            m_CreaturesMaxCount = reader.ReadInt();

            m_Properties = reader.ReadString();
            m_Parameters = reader.ReadString();

            int count = reader.ReadInt();

            m_Creatures = new List<IEntity>( count );

            for ( int i = 0; i < count; ++i )
            {
                //IEntity e = World.FindEntity( reader.ReadInt() );
                IEntity e = reader.ReadEntity();

                if ( e != null )
                {
                    if ( e is Item )
                        ((Item)e).Spawner = parent;
                    else if ( e is Mobile )
                    {
                        ((Mobile)e).Spawner = parent;
                        if ( e is BaseCreature )
                            ((BaseCreature)e).RemoveIfUntamed = true;
                    }

                    m_Creatures.Add( e );
                    if ( !parent.Creatures.ContainsKey( e ) )
                        parent.Creatures.Add( e, this );
                }
            }
        }
예제 #30
0
        public override void OnResponse(RelayInfo info)
        {
            if (Spawner.Deleted || User.AccessLevel < AccessLevel.GameMaster)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:     // Closed
            {
                return;
            }

            case 1:     // Apply
            {
                UpdateSpawnObjects(info, User);

                break;
            }

            case 2:     // Bring to Home
            {
                Spawner.BringToHome();

                break;
            }

            case 3:     // Total Respawn
            {
                Spawner.Respawn();

                break;
            }

            case 1000:
            {
                if (Spawner.Group)
                {
                    Spawner.Group = false;
                }
                else
                {
                    Spawner.Group = true;
                }
                break;
            }

            case 1025:
            {
                User.SendGump(new PropertiesGump(User, Spawner));
                break;
            }

            case 1500:
            {
                if (Spawner.Running)
                {
                    Spawner.Running = false;
                }
                else
                {
                    Spawner.Running = true;
                }
                break;
            }

            case 1750:
            {
                Spawner.RemoveSpawned();
                break;
            }

            default:
            {
                int buttonID = info.ButtonID - 4;
                int index    = buttonID / 2;
                int type     = buttonID % 2;

                TextRelay entry = info.GetTextEntry(index);

                if (entry != null && entry.Text.Length > 0)
                {
                    UpdateSpawnObjects(info, User);

                    if (type == 0)         // Spawn creature
                    {
                        Spawner.Spawn(index);
                    }
                    else         // Remove creatures
                    {
                        Spawner.RemoveSpawned(index);
                    }
                }

                break;
            }
            }

            Refresh();
        }
예제 #31
0
			private static void MakeSpawner( string types, int x, int y, int z, Map map, bool start )
			{
				ClearSpawners( x, y, z, map );

				Spawner sp = new Spawner( types );

				sp.Count = 1;

				sp.Running = true;
				sp.HomeRange = 1;
				sp.MinDelay = MinTime;
				sp.MaxDelay = MaxTime;

				sp.MoveToWorld( new Point3D( x, y, z ), map );

			}
예제 #32
0
 public InternalTimer( Spawner spawner, TimeSpan delay )
     : base(delay)
 {
     m_Spawner = spawner;
 }
예제 #33
0
			// Instance the SpawnerMemory, generating start creature
			// list

			public SpawnerMemory()
			{
				m_Spawner = LinkedSpawner;

				m_Names = new string[13];
				m_Counts = new int[13];
				m_IsChecked = new bool[13];
			}
예제 #34
0
            public InternalTimer( Spawner spawner, TimeSpan delay )
                : base(delay)
            {
                if ( spawner.IsFull )
                {
                }
                else
                {
                }

                m_Spawner = spawner;
            }
예제 #35
0
파일: Spawner.cs 프로젝트: Leodinas/uolite
			public InternalTimer( Spawner spawner, TimeSpan delay ) : base( delay )
			{
				if ( spawner.IsFull )
					Priority = TimerPriority.FiveSeconds;
				else
					Priority = TimerPriority.OneSecond;

				m_Spawner = spawner;
			}
예제 #36
0
		public static void LoadSpawners_OnCommand(CommandEventArgs e)
		{
			int count = 0;
			int itemCount = 0;
			Hashtable m_Items;
			if (e.Arguments.Length == 1)
			{
				string FileName = e.Arguments[0].ToString();
				string itemIdxPath = Path.Combine("Saves/Spawners/", FileName + ".idx");
				string itemBinPath = Path.Combine("Saves/Spawners/", FileName + ".bin");

				try
				{
					ArrayList items = new ArrayList();
					if (File.Exists(itemIdxPath))
					{
						using (FileStream idx = new FileStream(itemIdxPath, FileMode.Open, FileAccess.Read, FileShare.Read))
						{
							BinaryReader idxReader = new BinaryReader(idx);

							itemCount = idxReader.ReadInt32();
							count = itemCount;

							m_Items = new Hashtable(itemCount);

							for (int i = 0; i < itemCount; ++i)
							{
								long pos = idxReader.ReadInt64();
								int length = idxReader.ReadInt32();

								Item item = null;

								try
								{
									item = new Spawner();
								}
								catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }

								if (item != null)
								{
									items.Add(new ItemEntry(item, pos, length));
									World.AddItem(item);

								}
							}

							idxReader.Close();
						}


					}
					else
					{
						e.Mobile.SendMessage("File Not Found {0}.idx", FileName);
					}

					if (File.Exists(itemBinPath))
					{
						using (FileStream bin = new FileStream(itemBinPath, FileMode.Open, FileAccess.Read, FileShare.Read))
						{
							BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin));

							for (int i = 0; i < items.Count; ++i)
							{
								ItemEntry entry = (ItemEntry)items[i];
								Item item = (Item)entry.Object;

								if (item != null)
								{
									reader.Seek(entry.Position, SeekOrigin.Begin);

									try
									{
										item.Deserialize(reader);

										if (reader.Position != (entry.Position + entry.Length))
											throw new Exception(String.Format("***** Bad serialize on {0} *****", item.GetType()));

										item.MoveToWorld(item.Location, item.Map);
									}
									catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
								}
							}

							reader.Close();
						}

					}
					else
					{
						e.Mobile.SendMessage("File Not Found {0}.bin", FileName);
					}

				}
				catch (Exception ex)
				{
					LogHelper.LogException(ex);
					System.Console.WriteLine("Exception Caught in LoadSpawner code: " + ex.Message);
					System.Console.WriteLine(ex.StackTrace);
				}

				e.Mobile.SendMessage("{0} Spawners Loaded.", count);
			}
			else
			{
				e.Mobile.SendMessage("[Usage <FileName>");
			}
		}
예제 #37
0
		public static void XmlMake_OnCommand( CommandEventArgs e )
		{

				if( e.Arguments.Length > 0 ){
				int count = 0;
				try{
				count = Convert.ToInt32( e.Arguments[0],10);
				} catch{}

			for(int i=0;i<count;i++)
			{
				if( e.Arguments.Length > 2)
				{
				   Spawner x = new Spawner(10,1,1,0,2,e.Arguments[1]);
				   x.Location = new Point3D(5400+Utility.Random(700),1090+Utility.Random(180),0);
				   x.Map = Map.Trammel;
				} else
				if( e.Arguments.Length > 1)
				{
				  XmlSpawner x = new XmlSpawner(10,1,1,0,2,e.Arguments[1]);
				  x.Location = new Point3D(5400+Utility.Random(700),1090+Utility.Random(180),0);
				  x.Map = Map.Trammel;
				  //x.MinDelay = TimeSpan.FromSeconds(1);
				  //x.MaxDelay = TimeSpan.FromSeconds(1);
					//x.ProximityRange = 0;
				}
			}
			if( e.Arguments.Length > 2)
			{
				   e.Mobile.SendMessage( "Created {0} Spawner objects.", count );
			} else {
					e.Mobile.SendMessage( "Created {0} XmlSpawner objects.", count );
			}


		   }
		}
예제 #38
0
        public static Spawner GetRandomSpawner(SpawnerType type)
        {
            // if still empty, fail
            if (m_Spawners.Count == 0)
            {
                return(null);
            }

            Spawner spawner = null;

            Utility.TimeCheck tc = new Utility.TimeCheck();
            tc.Start();
            //try to find an appropriate spawner
            for (int count = 0; count < m_Spawners.Count * 2; ++count)
            {
                // pick one at random..
                Spawner random = m_Spawners[Utility.Random(m_Spawners.Count)] as Spawner;
                Region  region = Server.Region.Find(random.Location, Map.Felucca);

                // test if this spawner satisfies type required
                switch (type)
                {
                case SpawnerType.Overland:
                {
                    // Must be running
                    if (!random.Running)
                    {
                        continue;
                    }

                    if (region != null)
                    {                                           // No Towns
                        if (IsTown(region.Name))
                        {
                            continue;
                        }

                        // no green acres, inside houses, etc..
                        if (IsValidRegion(random.Location, region) == false)
                        {
                            continue;
                        }
                    }

                    break;
                }

                default:
                {
                    if (region != null)
                    {
                        // no green acres, inside houses, etc..
                        if (IsValidRegion(random.Location, region) == false)
                        {
                            continue;
                        }
                    }

                    break;
                }
                }

                //this is a good candidate!
                spawner = random;
                break;
            }
            tc.End();
            if (tc.Elapsed() > 30)
            {
                LogHelper logger = new LogHelper("SpawnerCache");
                logger.Log("Warning:  Spawner overland search took " + tc.Elapsed().ToString() + "ms");
            }

            return(spawner);
        }
예제 #39
0
        public static void ReplaceBankers_OnCommand( CommandEventArgs e )
        {
            List<Mobile> list = new List<Mobile>();

            foreach ( Mobile m in World.Mobiles.Values )
                if ( (m is Banker) && !(m is BaseCreature) )
                    list.Add( m );

            foreach ( Mobile m in list )
            {
                Map map = m.Map;

                if ( map != null )
                {
                    bool hasBankerSpawner = false;

                    foreach ( Item item in m.GetItemsInRange( 0 ) )
                    {
                        if ( item is Spawner )
                        {
                            Spawner spawner = (Spawner)item;

                            for ( int i = 0; !hasBankerSpawner && i < spawner.CreaturesName.Count; ++i )
                                hasBankerSpawner = Insensitive.Equals( (string)spawner.CreaturesName[i], "banker" );

                            if ( hasBankerSpawner )
                                break;
                        }
                    }

                    if ( !hasBankerSpawner )
                    {
                        Spawner spawner = new Spawner( 1, 1, 5, 0, 4, "banker" );

                        spawner.MoveToWorld( m.Location, map );
                    }
                }
            }
        }
예제 #40
0
 public SpawnerGump(IEntity m, Spawner spawner)
     : base(m as PlayerMobile)
 {
     Spawner = spawner;
 }