• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mobiles.Spawner类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Mobiles.Spawner的典型用法代码示例。如果您正苦于以下问题:C# Spawner类的具体用法?C# Spawner怎么用?C# Spawner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Spawner类属于Server.Mobiles命名空间,在下文中一共展示了Spawner类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SpawnAt

		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;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:54,代码来源:OverlandSpawner.cs


示例2: SpawnerGump

		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
            }
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:50,代码来源:SpawnerGump.cs


示例3: SpawnerGump

		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 );
			}

		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:50,代码来源:SpawnerGump.cs


示例4: LoadEntry

		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 );
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:14,代码来源:ImportSpawners.cs


示例5: CreateBoxSpawn

		/// <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;
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:23,代码来源:SpawnerHelper.cs


示例6: SpawnerGump

        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);
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:44,代码来源:SpawnerGump.cs


示例7: LoadSpawner

		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 );
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:19,代码来源:ImportSpawners.cs


示例8: CreateArray

		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();
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:40,代码来源:SpawnerGump.cs


示例9: MakeUniqueSpawner

		//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;
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:24,代码来源:SpawnHelper.cs


示例10: SpawnerEntry

        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 );
                }
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:37,代码来源:Spawner.cs


示例11: MakeSpawner

        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;
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:36,代码来源:uoamVendors.cs


示例12: SpawnerGump

		public SpawnerGump( Spawner spawner, int page ) : this( spawner, null, page )
		{
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:3,代码来源:SpawnerGump.cs


示例13: ImportSpawner

        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();
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:31,代码来源:SpawnerExporter.cs


示例14: OnResponse

		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; 
				}
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:65,代码来源:StartstopMontorIlshenar.cs


示例15: LoadMobile

        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;
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:17,代码来源:MobileSaver.cs


示例16: OnResponse


//.........这里部分代码省略.........
			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";
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:67,代码来源:StartstopMaginciaFelucca.cs


示例17: Defrag

        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 );
                }
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:51,代码来源:Spawner.cs


示例18: OnResponse


//.........这里部分代码省略.........
            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;
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:67,代码来源:StartstopCoveTrammel.cs


示例19: ImportPremSpawners_OnCommand

		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 ) );
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:95,代码来源:ImportPremSpawners.cs


示例20: MakeSpawner

			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 );

			}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:16,代码来源:GenerateOFQ.cs



注:本文中的Server.Mobiles.Spawner类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Mobiles.XmlSpawner类代码示例发布时间:2022-05-26
下一篇:
C# Mobiles.RentedVendor类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap