当前位置: 首页>>代码示例>>C#>>正文


C# XmlSpawner.MoveToWorld方法代码示例

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


在下文中一共展示了XmlSpawner.MoveToWorld方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XmlLoadFromStream


//.........这里部分代码省略.........
									if( SpawnCentreZ == short.MinValue )
									{
										NewZ = SpawnMap.GetAverageZ( SpawnCentreX, SpawnCentreY );


										if( SpawnMap.CanFit( SpawnCentreX, SpawnCentreY, NewZ, SpawnFitSize ) == false )
										{
											for( int x = 1; x <= 39; x++ )
											{
												if( SpawnMap.CanFit( SpawnCentreX, SpawnCentreY, NewZ + x, SpawnFitSize ) )
												{
													NewZ += x;
													break;
												}
											}
										}
									}
									else
									{
										// This spawn point already has a defined Z location, so use it
										NewZ = SpawnCentreZ;
									}

								// if this is a container held spawner, drop it in the container
								if( found_container && (spawn_container != null) && !spawn_container.Deleted )
								{
									TheSpawn.Location = (new Point3D( ContainerX, ContainerY, ContainerZ ));
									spawn_container.AddItem( TheSpawn );
								}
								else
								{
									// disable the X_Y adjustments in OnLocationChange
									IgnoreLocationChange = true;
									TheSpawn.MoveToWorld( new Point3D( SpawnCentreX, SpawnCentreY, NewZ ), SpawnMap );
								}

								// reset the spawner
								TheSpawn.Reset();
								TheSpawn.Running = SpawnIsRunning;

								// update subgroup-specific next spawn times
								TheSpawn.NextSpawn = TimeSpan.Zero;
								TheSpawn.ResetNextSpawnTimes();


								// Send a message to the client that the spawner is created
								if( from != null && verbose )
									from.SendMessage( 188, "Created '{0}' in {1} at {2}", TheSpawn.Name, TheSpawn.Map.Name, TheSpawn.Location.ToString() );

								// Do a total respawn
								//TheSpawn.Respawn();

								// Increment the count
								TotalCount++;
							}
							bad_spawner = false;
							questionable_spawner = false;
						}
					}

				if( from != null )
					from.SendMessage( "Resolving spawner self references" );

				if( ds.Tables[SpawnTablePointName] != null && ds.Tables[SpawnTablePointName].Rows.Count > 0 )
					foreach( DataRow dr in ds.Tables[SpawnTablePointName].Rows )
					{
开发者ID:greeduomacro,项目名称:hubroot,代码行数:67,代码来源:XmlSpawner2.cs

示例2: ImportSpawner

		private static void ImportSpawner( XmlElement node, Mobile from )
		{
			int count = int.Parse( GetText( node["count"], "1" ) );
			int homeRange = int.Parse( GetText( node["homerange"], "4" ) );
			int walkingRange = int.Parse( GetText( node["walkingrange"], "-1" ) );
			// width of the spawning area
			int spawnwidth = homeRange * 2;
			if( walkingRange >= 0 ) spawnwidth = walkingRange * 2;

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

			// allow it to make an xmlspawner instead
			// first add all of the creatures on the list
			SpawnObject[] so = new SpawnObject[creaturesName.Count];

			bool hasvendor = false;

			for( int i = 0; i < creaturesName.Count; i++ )
			{
				so[i] = new SpawnObject( (string)creaturesName[i], count );
				// check the type to see if there are vendors on it
				Type type = SpawnerType.GetType( (string)creaturesName[i] );

				// if it has basevendors on it or invalid types, then skip it
				if( type != null && (type == typeof( BaseVendor ) || type.IsSubclassOf( typeof( BaseVendor ) )) )
				{
					hasvendor = true;
				}
			}

			// assign it a unique id
			Guid SpawnId = Guid.NewGuid();

			// Create the new xml spawner
			XmlSpawner spawner = new XmlSpawner( SpawnId, location.X, location.Y, spawnwidth, spawnwidth, name, count,
				minDelay, maxDelay, TimeSpan.FromMinutes( 0 ), -1, defaultTriggerSound, 1,
				team, homeRange, false, so, TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ),
				TimeSpan.FromMinutes( 0 ), null, null, null, null, null,
				null, null, null, null, 1, null, group, defTODMode, defKillReset, false, -1, null, false, false, false, null, defDespawnTime, null, false, null );

			if( hasvendor )
			{
				spawner.SpawnRange = 0;
			}
			else
			{
				spawner.SpawnRange = homeRange;
			}
			spawner.m_PlayerCreated = true;
			string fromname = null;
			if( from != null ) fromname = from.Name;
			spawner.LastModifiedBy = fromname;
			spawner.FirstModifiedBy = fromname;

			spawner.MoveToWorld( location, map );
			if( !IsValidMapLocation( location, spawner.Map ) )
			{
				spawner.Delete();
				throw new Exception( "Invalid spawner location." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:68,代码来源:XmlSpawner2.cs

示例3: ImportMegaSpawner


//.........这里部分代码省略.........
										{
											op.WriteLine( "MSFimport : individual spawnrange entry difference: {0} vs {1}",
												GetText( entrynode["SpawnRange"], "4" ), spawnRange );

										}
									}
									catch { }
								}
							}

							// these apply to individual entries
							int amount = int.Parse( GetText( entrynode["Amount"], "1" ) );
							string entryname = GetText( entrynode["EntryType"], "" );

							// keep track of the maxcount for the spawner by adding the individual amounts
							maxcount += amount;

							// add the creature entry
							so[entrycount] = new SpawnObject( entryname, amount );

							entrycount++;
							if( entrycount > nentries )
							{
								// log it
								try
								{
									using( StreamWriter op = new StreamWriter( "badimport.log", true ) )
									{
										op.WriteLine( "{0} MSFImport Error; inconsistent entry count {1} {2}", DateTime.Now, location, map );
										op.WriteLine();
									}
								}
								catch { }
								from.SendMessage( "Inconsistent entry count detected at {0} {1}.", location, map );
								break;
							}

						}
					}
					if( diff )
					{
						from.SendMessage( "Individual entry setting detected at {0} {1}.", location, map );
						// log it
						try
						{
							using( StreamWriter op = new StreamWriter( "badimport.log", true ) )
							{
								op.WriteLine( "{0} MSFImport: Individual entry setting differences listed above from spawner at {1} {2}", DateTime.Now, location, map );
								op.WriteLine();
							}
						}
						catch { }
					}
				}
			}

			// assign it a unique id
			Guid SpawnId = Guid.NewGuid();
			// Create the new xml spawner
			XmlSpawner spawner = new XmlSpawner( SpawnId, location.X, location.Y, 0, 0, name, maxcount,
				minDelay, maxDelay, TimeSpan.FromMinutes( 0 ), -1, defaultTriggerSound, 1,
				team, homeRange, false, so, TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ),
				TimeSpan.FromMinutes( 0 ), null, null, null, null, null,
				null, null, null, null, 1, null, group, defTODMode, defKillReset, false, -1, null, false, false, false, null, defDespawnTime, null, false, null );

			spawner.SpawnRange = spawnRange;
			spawner.m_PlayerCreated = true;
			string fromname = null;
			if( from != null ) fromname = from.Name;
			spawner.LastModifiedBy = fromname;
			spawner.FirstModifiedBy = fromname;

			// Try to find a valid Z height if required (Z == -999)

			if( location.Z == -999 )
			{
				int NewZ = map.GetAverageZ( location.X, location.Y );

				if( map.CanFit( location.X, location.Y, NewZ, SpawnFitSize ) == false )
				{
					for( int x = 1; x <= 39; x++ )
					{
						if( map.CanFit( location.X, location.Y, NewZ + x, SpawnFitSize ) )
						{
							NewZ += x;
							break;
						}
					}
				}
				location.Z = NewZ;
			}

			spawner.MoveToWorld( location, map );

			if( !IsValidMapLocation( location, spawner.Map ) )
			{
				spawner.Delete();
				throw new Exception( "Invalid spawner location." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:XmlSpawner2.cs

示例4: XmlImportMap


//.........这里部分代码省略.........
										}

									}

									// assign it a unique id
									Guid SpawnId = Guid.NewGuid();

									// and give it a name based on the spawner count and file
									string spawnername = String.Format("{0}#{1}", filename, spawnercount);

									// Create the new xml spawner
									XmlSpawner spawner = new XmlSpawner(SpawnId, x, y, 0, 0, spawnername, maxcount,
										TimeSpan.FromMinutes(mindelay), TimeSpan.FromMinutes(maxdelay), TimeSpan.FromMinutes(0), -1, defaultTriggerSound, 1,
										0, homerange, false, so, TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0),
										TimeSpan.FromMinutes(0), null, null, null, null, null,
										null, null, null, null, 1, null, false, defTODMode, defKillReset, false, -1, null, false, false, false, null,
										TimeSpan.FromHours(0), null, false, null);

									if (hasvendor)
									{
										// force vendor spawners to behave like the distro
										spawner.SpawnRange = 0;
									}
									else
									{
										spawner.SpawnRange = spawnrange;
									}

									spawner.m_PlayerCreated = true;
									string fromname = null;
									if (from != null) fromname = from.Name;
									spawner.LastModifiedBy = fromname;
									spawner.FirstModifiedBy = fromname;
									spawner.MoveToWorld(new Point3D(x, y, z), spawnmap);
									if (spawner.Map == Map.Internal)
									{
										badspawnercount++;
										spawner.Delete();
										from.SendMessage("Invalid map at line {0}", linenumber);
										from.SendMessage("Bad spawn at line {1}: {0}", line, linenumber);
										continue;
									}
									spawnercount++;
									// handle the special case of map 0 that also needs to do trammel
									if (map == 0)
									{
										spawnmap = Map.Trammel;
										// assign it a unique id
										SpawnId = Guid.NewGuid();
										// Create the new xml spawner
										spawner = new XmlSpawner(SpawnId, x, y, 0, 0, spawnername, maxcount,
											TimeSpan.FromMinutes(mindelay), TimeSpan.FromMinutes(maxdelay), TimeSpan.FromMinutes(0), -1, defaultTriggerSound, 1,
											0, homerange, false, so, TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0),
											TimeSpan.FromMinutes(0), null, null, null, null, null,
											null, null, null, null, 1, null, false, defTODMode, defKillReset, false, -1, null, false, false, false, null,
											TimeSpan.FromHours(0), null, false, null);

										spawner.SpawnRange = spawnrange;
										spawner.m_PlayerCreated = true;

										spawner.LastModifiedBy = fromname;
										spawner.FirstModifiedBy = fromname;
										spawner.MoveToWorld(new Point3D(x, y, z), spawnmap);
										if (spawner.Map == Map.Internal)
										{
											badspawnercount++;
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:67,代码来源:XmlSpawner2.cs

示例5: ParseOldMapFormat


//.........这里部分代码省略.........
									from.SendMessage( "Bad spawn at line {1}: {0}", line, linenumber );
									return;
								}

								// allow it to make an xmlspawner instead
								// first add all of the creatures on the list
								SpawnObject[] so = new SpawnObject[typenames.Length];

								bool hasvendor = true;
								for( int i = 0; i < typenames.Length; i++ )
								{
									so[i] = new SpawnObject( typenames[i], maxcount );

									// check the type to see if there are vendors on it
									Type type = SpawnerType.GetType( typenames[i] );

									// check for vendor-only spawners which get special spawnrange treatment
									if( type != null && (type != typeof( BaseVendor ) && !type.IsSubclassOf( typeof( BaseVendor ) )) )
									{
										hasvendor = false;
									}

								}

								// assign it a unique id
								Guid SpawnId = Guid.NewGuid();

								// and give it a name based on the spawner count and file
								string spawnername = String.Format( "{0}#{1}", Path.GetFileNameWithoutExtension( filename ), spawnercount );

								// Create the new xml spawner
								XmlSpawner spawner = new XmlSpawner( SpawnId, x, y, 0, 0, spawnername, maxcount,
									TimeSpan.FromMinutes( mindelay ), TimeSpan.FromMinutes( maxdelay ), TimeSpan.FromMinutes( 0 ), -1, defaultTriggerSound, 1,
									0, homerange, false, so, TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ),
									TimeSpan.FromMinutes( 0 ), null, null, null, null, null,
									null, null, null, null, 1, null, false, defTODMode, defKillReset, false, -1, null, false, false, false, null,
									TimeSpan.FromHours( 0 ), null, false, null );

								if( hasvendor )
								{
									// force vendor spawners to behave like the distro
									spawner.SpawnRange = 0;
								}
								else
								{
									spawner.SpawnRange = spawnrange;
								}

								spawner.m_PlayerCreated = true;
								string fromname = null;
								if( from != null ) fromname = from.Name;
								spawner.LastModifiedBy = fromname;
								spawner.FirstModifiedBy = fromname;
								spawner.MoveToWorld( new Point3D( x, y, z ), spawnmap );
								if( spawner.Map == Map.Internal )
								{
									badspawnercount++;
									spawner.Delete();
									from.SendMessage( "Invalid map at line {0}", linenumber );
									from.SendMessage( "Bad spawn at line {1}: {0}", line, linenumber );
									return;
								}
								spawnercount++;
								// handle the special case of map 0 that also needs to do trammel
								if( map == 0 )
								{
									spawnmap = Map.Trammel;
									// assign it a unique id
									SpawnId = Guid.NewGuid();
									// Create the new xml spawner
									spawner = new XmlSpawner( SpawnId, x, y, 0, 0, spawnername, maxcount,
										TimeSpan.FromMinutes( mindelay ), TimeSpan.FromMinutes( maxdelay ), TimeSpan.FromMinutes( 0 ), -1, defaultTriggerSound, 1,
										0, homerange, false, so, TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ), TimeSpan.FromMinutes( 0 ),
										TimeSpan.FromMinutes( 0 ), null, null, null, null, null,
										null, null, null, null, 1, null, false, defTODMode, defKillReset, false, -1, null, false, false, false, null,
										TimeSpan.FromHours( 0 ), null, false, null );

									spawner.SpawnRange = spawnrange;
									spawner.m_PlayerCreated = true;

									spawner.LastModifiedBy = fromname;
									spawner.FirstModifiedBy = fromname;
									spawner.MoveToWorld( new Point3D( x, y, z ), spawnmap );
									if( spawner.Map == Map.Internal )
									{
										badspawnercount++;
										spawner.Delete();
										from.SendMessage( "Bad spawn at line {1}: {0}", line, linenumber );
										return;
									}
									spawnercount++;
								}
							}
							else
							{
								badspawnercount++;
								from.SendMessage( "Bad spawn at line {1}: {0}", line, linenumber );
							}
						}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:XmlSpawner2.cs

示例6: Setup

        public static void Setup(CommandEventArgs e)
        {
            if (VoidPoolController.InstanceTram != null || VoidPoolController.InstanceFel != null)
                e.Mobile.SendMessage("This has already been setup!");
            else
            {
                var one = new VoidPoolController(Map.Trammel);
                WeakEntityCollection.Add("newcovetous", one);
                one.MoveToWorld(new Point3D(5605, 1998, 10), Map.Trammel);

                var two = new VoidPoolController(Map.Felucca);
                WeakEntityCollection.Add("newcovetous", two);
                two.MoveToWorld(new Point3D(5605, 1998, 10), Map.Felucca);

                int id = 0;
                int hue = 0;

                for (int x = 5497; x <= 5503; x++)
                {
                    for (int y = 1995; y <= 2001; y++)
                    {
                        if (x == 5497 && y == 1995) id = 1886;
                        else if (x == 5497 && y == 2001) id = 1887;
                        else if (x == 5503 && y == 1995) id = 1888;
                        else if (x == 5503 && y == 2001) id = 1885;
                        else if (x == 5497) id = 1874;
                        else if (x == 5503) id = 1876;
                        else if (y == 1995) id = 1873;
                        else if (y == 2001) id = 1875;
                        else
                        {
                            //id = 1168;
                            id = Utility.Random(8511, 6);
                        }

                        hue = id >= 8511 ? 0 : 1954;

                        var item = new Static(id);
                        item.Name = "Void Pool";
                        item.Hue = hue;
                        WeakEntityCollection.Add("newcovetous", item);
                        item.MoveToWorld(new Point3D(x, y, 5), Map.Trammel);

                        item = new Static(id);
                        item.Name = "Void Pool";
                        item.Hue = hue;
                        WeakEntityCollection.Add("newcovetous", item);
                        item.MoveToWorld(new Point3D(x, y, 5), Map.Felucca);
                    }
                }

                XmlSpawner spawner = new XmlSpawner("corathesorceress");
                spawner.MoveToWorld(new Point3D(5457, 1808, 0), Map.Trammel);
                spawner.SpawnRange = 5;
                spawner.MinDelay = TimeSpan.FromHours(1);
                spawner.MaxDelay = TimeSpan.FromHours(1.5);
                spawner.DoRespawn = true;

                spawner = new XmlSpawner("corathesorceress");
                spawner.MoveToWorld(new Point3D(5457, 1808, 0), Map.Felucca);
                spawner.SpawnRange = 5;
                spawner.MinDelay = TimeSpan.FromHours(1);
                spawner.MaxDelay = TimeSpan.FromHours(1.5);
                spawner.DoRespawn = true;

                spawner = new XmlSpawner("velathesorceress");
                spawner.MoveToWorld(new Point3D(2254, 1207, 0), Map.Trammel);
                spawner.SpawnRange = 0;
                spawner.DoRespawn = true;

                spawner = new XmlSpawner("velathesorceress");
                spawner.MoveToWorld(new Point3D(2254, 1207, 0), Map.Felucca);
                spawner.SpawnRange = 0;
                spawner.DoRespawn = true;

                AddWaypoints();
                ConvertSpawners();
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:79,代码来源:Generate.cs

示例7: GenerateDeco

        public static void GenerateDeco(CommandEventArgs e)
        {
            string name = "highseas";

            CharydbisSpawner.GenerateCharydbisSpawner();
            BountyQuestSpawner.GenerateShipSpawner();

            CorgulAltar altar;

            altar = new CorgulAltar();
            altar.MoveToWorld(new Point3D(2453, 865, 0), Map.Felucca);
            WeakEntityCollection.Add(name, altar);

            altar = new CorgulAltar();
            altar.MoveToWorld(new Point3D(2453, 865, 0), Map.Trammel);
            WeakEntityCollection.Add(name, altar);

            ProfessionalBountyBoard board;
            
            board = new ProfessionalBountyBoard();
            board.MoveToWorld(new Point3D(4544, 2298, -1), Map.Trammel);
            WeakEntityCollection.Add(name, board);

            board = new ProfessionalBountyBoard();
            board.MoveToWorld(new Point3D(4544, 2298, -1), Map.Felucca);
            WeakEntityCollection.Add(name, board);

            LocalizedSign sign;

            sign = new LocalizedSign(3025, 1152653); //The port of Zento Parking Area
            sign.MoveToWorld(new Point3D(713, 1359, 53), Map.Tokuno);
            WeakEntityCollection.Add(name, sign);

            sign = new LocalizedSign(3023, 1149821); //Winds Tavern
            sign.MoveToWorld(new Point3D(4548, 2300, -6), Map.Trammel);
            WeakEntityCollection.Add(name, sign);

            sign = new LocalizedSign(3023, 1149821); //Winds Tavern
            sign.MoveToWorld(new Point3D(4548, 2300, -6), Map.Felucca);
            WeakEntityCollection.Add(name, sign);

            sign = new LocalizedSign(3023, 1149820); //General Store
            sign.MoveToWorld(new Point3D(4543, 2317, -3), Map.Trammel);
            WeakEntityCollection.Add(name, sign);

            sign = new LocalizedSign(3023, 1149820); //General Store
            sign.MoveToWorld(new Point3D(4543, 2317, -3), Map.Felucca);
            WeakEntityCollection.Add(name, sign);

            XmlSpawner sp;
            string toSpawn = "FishMonger";

            //Britain
            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Trammel);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Felucca);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            //Moonglow
            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Trammel);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Felucca);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            //Trinsic
            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Trammel);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
            sp.HomeRange = 5;
            sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Felucca);
            sp.Respawn();
            WeakEntityCollection.Add(name, sp);

            //Vesper
            sp = new XmlSpawner(toSpawn);
            sp.SpawnRange = 1;
//.........这里部分代码省略.........
开发者ID:Crome696,项目名称:ServUO,代码行数:101,代码来源:Generate.cs

示例8: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				if(from == null) return;

				// assign it a unique id
				Guid SpawnId = Guid.NewGuid();
				// count the number of entries to be added for maxcount
				int maxcount = 0;
				for(int i = 0; i<MaxEntries;i++)
				{
					if(defs.SelectionList != null && i < defs.SelectionList.Length && defs.SelectionList[i] &&
						defs.NameList != null && i < defs.NameList.Length && defs.NameList[i] != null && defs.NameList[i].Length > 0)
					{
						maxcount++;
					}
				}
                
				// if autonumbering is enabled, name the spawner with the name+number
				string sname = defs.SpawnerName;
				if(defs.AutoNumber)
				{
					sname = String.Format("{0}#{1}",defs.SpawnerName, defs.AutoNumberValue);
				}

				XmlSpawner spawner = new XmlSpawner( SpawnId, from.Location.X, from.Location.Y, 0, 0, sname, maxcount,
					defs.MinDelay, defs.MaxDelay, defs.Duration, defs.ProximityRange, defs.ProximitySound, 1,
					defs.Team, defs.HomeRange, defs.HomeRangeIsRelative, new XmlSpawner.SpawnObject[0], defs.RefractMin, defs.RefractMax,
					defs.TODStart, defs.TODEnd, null, defs.TriggerObjectProp, defs.ProximityMsg, defs.TriggerOnCarried, defs.NoTriggerOnCarried,
					defs.SpeechTrigger, null, null, defs.PlayerTriggerProp, defs.TriggerProbability , null, defs.Group, defs.TODMode, defs.KillReset, defs.ExternalTriggering,
					defs.SequentialSpawn, null, defs.AllowGhostTrig, defs.AllowNPCTrig, defs.SpawnOnTrigger, null, defs.DespawnTime, defs.SkillTrigger, defs.SmartSpawning, null);

				spawner.PlayerCreated = true;

				// if the object is a container, then place it in the container
				if(targeted is Container)
				{
					((Container)targeted).DropItem(spawner);
				} 
				else
				{
					// place the spawner at the targeted location
					IPoint3D p = targeted as IPoint3D;
					if(p == null)
					{
						spawner.Delete();
						return;
					}
					if ( p is Item )
						p = ((Item)p).GetWorldTop();

					spawner.MoveToWorld( new Point3D(p), from.Map );

				}

				spawner.SpawnRange = defs.SpawnRange;
				// add entries from the name list
				for(int i = 0; i<MaxEntries;i++)
				{
					if(defs.SelectionList != null && i < defs.SelectionList.Length && defs.SelectionList[i] &&
						defs.NameList != null && i < defs.NameList.Length && defs.NameList[i] != null && defs.NameList[i].Length > 0)
					{
						spawner.AddSpawn = defs.NameList[i];
					}
				}

				defs.LastSpawner = spawner;
           
				if(defs.AutoNumber)
					// bump the autonumber
					defs.AutoNumberValue++;

				//from.CloseGump(typeof(XmlAddGump));
				XmlAddGump.Refresh(m_state.Mobile, true);

				// open the spawner gump 
				DoShowGump(from, spawner);

			}
开发者ID:Crome696,项目名称:ServUO,代码行数:78,代码来源:XmlAdd.cs

示例9: Generate

        public static void Generate()
        {
            ExperimentalRoomController controller = new ExperimentalRoomController();
            controller.MoveToWorld(new Point3D(980, 1117, -42), Map.TerMur);

            //Room 0 to 1
            ExperimentalRoomDoor door = new ExperimentalRoomDoor(Room.RoomZero, DoorFacing.WestCCW);
            ExperimentalRoomBlocker blocker = new ExperimentalRoomBlocker(Room.RoomZero);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(984, 1116, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(984, 1116, -42), Map.TerMur);

            door = new ExperimentalRoomDoor(Room.RoomZero, DoorFacing.EastCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomZero);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(985, 1116, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(985, 1116, -42), Map.TerMur);

            //Room 1 to 2
            door = new ExperimentalRoomDoor(Room.RoomOne, DoorFacing.WestCCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomOne);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(984, 1102, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(984, 1102, -42), Map.TerMur);

            door = new ExperimentalRoomDoor(Room.RoomOne, DoorFacing.EastCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomOne);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(985, 1102, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(985, 1102, -42), Map.TerMur);

            //Room 2 to 3
            door = new ExperimentalRoomDoor(Room.RoomTwo, DoorFacing.WestCCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomTwo);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(984, 1090, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(984, 1090, -42), Map.TerMur);

            door = new ExperimentalRoomDoor(Room.RoomTwo, DoorFacing.EastCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomTwo);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(985, 1090, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(985, 1090, -42), Map.TerMur);

            //Room 3 to 4
            door = new ExperimentalRoomDoor(Room.RoomTwo, DoorFacing.WestCCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomThree);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(984, 1072, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(984, 1072, -42), Map.TerMur);

            door = new ExperimentalRoomDoor(Room.RoomTwo, DoorFacing.EastCW);
            blocker = new ExperimentalRoomBlocker(Room.RoomThree);
            door.Hue = 1109;
            door.MoveToWorld(new Point3D(985, 1072, -42), Map.TerMur);
            blocker.MoveToWorld(new Point3D(985, 1072, -42), Map.TerMur);

            ExperimentalRoomChest chest = new ExperimentalRoomChest();
            chest.MoveToWorld(new Point3D(984, 1064, -37), Map.TerMur);

            ExperimentalBook instr = new ExperimentalBook();
            instr.Movable = false;
            instr.MoveToWorld(new Point3D(995, 1114, -36), Map.TerMur);

            SecretDungeonDoor dd = new SecretDungeonDoor(DoorFacing.NorthCCW);
            dd.ClosedID = 87;
            dd.OpenedID = 88;
            dd.MoveToWorld(new Point3D(1007, 1119, -42), Map.TerMur);

            LocalizedSign sign = new LocalizedSign(3026, 1113407);  // Experimental Room Access
            sign.Movable = false;
            sign.MoveToWorld(new Point3D(980, 1119, -37), Map.TerMur);

            //Puzze Room
            PuzzleBox box = new PuzzleBox(PuzzleType.WestBox);
            box.MoveToWorld(new Point3D(1090, 1171, 11), Map.TerMur);

            box = new PuzzleBox(PuzzleType.EastBox);
            box.MoveToWorld(new Point3D(1104, 1171, 11), Map.TerMur);

            box = new PuzzleBox(PuzzleType.NorthBox);
            box.MoveToWorld(new Point3D(1097, 1163, 11), Map.TerMur);

            XmlSpawner spawner = new XmlSpawner("MagicKey");
            spawner.MoveToWorld(new Point3D(1109, 1150, -12), Map.TerMur);
            spawner.SpawnRange = 0;
            spawner.MinDelay = TimeSpan.FromSeconds(30);
            spawner.MaxDelay = TimeSpan.FromSeconds(45);
            spawner.DoRespawn = true;

            PuzzleBook book = new PuzzleBook();
            book.Movable = false;
            book.MoveToWorld(new Point3D(1109, 1153, -17), Map.TerMur);

            PuzzleRoomTeleporter tele = new PuzzleRoomTeleporter();
            tele.PointDest = new Point3D(1097, 1173, 1);
            tele.MapDest = Map.TerMur;
            tele.MoveToWorld(new Point3D(1097, 1175, 0), Map.TerMur);

            tele = new PuzzleRoomTeleporter();
//.........这里部分代码省略.........
开发者ID:g4idrijs,项目名称:ServUO,代码行数:101,代码来源:Generate.cs

示例10: Setup

        private void Setup()
        {
            Static s;

            for (int i = 0; i < 9; i++)
            {
                s = new Static(2931);
                s.MoveToWorld(new Point3D(748 + i, 2136, 0), Map.Trammel);

                s = new Static(2928);
                s.MoveToWorld(new Point3D(748 + i, 2137, 0), Map.Trammel);

                s = new Static(2931);
                s.MoveToWorld(new Point3D(748 + i, 2136, 0), Map.Felucca);

                s = new Static(2928);
                s.MoveToWorld(new Point3D(748 + i, 2137, 0), Map.Felucca);
            }

            HuntingDisplayTrophy trophy = new HuntingDisplayTrophy(HuntType.GrizzlyBear);
            trophy.MoveToWorld(new Point3D(748, 2137, 6), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.GrizzlyBear);
            trophy.MoveToWorld(new Point3D(748, 2137, 6), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.GrayWolf);
            trophy.MoveToWorld(new Point3D(751, 2137, 6), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.GrayWolf);
            trophy.MoveToWorld(new Point3D(751, 2137, 6), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Cougar);
            trophy.MoveToWorld(new Point3D(753, 2137, 6), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Cougar);
            trophy.MoveToWorld(new Point3D(753, 2137, 6), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Turkey);
            trophy.MoveToWorld(new Point3D(756, 2137, 6), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Turkey);
            trophy.MoveToWorld(new Point3D(756, 2137, 6), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Bull);
            trophy.MoveToWorld(new Point3D(748, 2136, 2), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Bull);
            trophy.MoveToWorld(new Point3D(748, 2136, 2), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Boar);
            trophy.MoveToWorld(new Point3D(750, 2136, 2), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Boar);
            trophy.MoveToWorld(new Point3D(750, 2136, 2), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Walrus);
            trophy.MoveToWorld(new Point3D(752, 2136, 2), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Walrus);
            trophy.MoveToWorld(new Point3D(752, 2136, 2), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Alligator);
            trophy.MoveToWorld(new Point3D(754, 2136, 2), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Alligator);
            trophy.MoveToWorld(new Point3D(754, 2136, 2), Map.Trammel);

            trophy = new HuntingDisplayTrophy(HuntType.Eagle);
            trophy.MoveToWorld(new Point3D(756, 2136, 3), Map.Felucca);

            trophy = new HuntingDisplayTrophy(HuntType.Eagle);
            trophy.MoveToWorld(new Point3D(756, 2136, 3), Map.Trammel);

            XmlSpawner spawner = new XmlSpawner("HuntMaster");
            spawner.MoveToWorld(new Point3D(747, 2148, 0), Map.Felucca);
            spawner.DoRespawn = true;

            spawner = new XmlSpawner("HuntMaster");
            spawner.MoveToWorld(new Point3D(747, 2148, 0), Map.Trammel);
            spawner.DoRespawn = true;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:81,代码来源:HuntingSystem.cs


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