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


C# ChampionSpawn.MoveToWorld方法代码示例

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


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

示例1: CreateAltar

        private ChampionSpawn CreateAltar( SpawnRecord r, Map m, bool restartdisable )
        {
            ChampionSpawn cs = new ChampionSpawn();

            Point3D loc = new Point3D( r.x, r.y, r.z );

            if ( r.type == 0xff )
            {
                cs.RandomizeType = true;

                switch ( Utility.Random( 5 ) )
                {
                    case 0: cs.Type = ChampionSpawnType.VerminHorde; break;
                    case 1: cs.Type = ChampionSpawnType.UnholyTerror; break;
                    case 2: cs.Type = ChampionSpawnType.ColdBlood; break;
                    case 3: cs.Type = ChampionSpawnType.Abyss; break;
                    case 4: cs.Type = ChampionSpawnType.Arachnid; break;
                }
            }
            else
            {
                cs.RandomizeType = false;
                cs.Type = (ChampionSpawnType)r.type;
            }

            // Prevent autorestart of felucca & t2a the spawns

            if ( restartdisable )
                cs.RestartDelay = TimeSpan.FromDays( 9999 );

            cs.MoveToWorld( loc, m );

            return cs;
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:34,代码来源:ChampionSpawnController.cs

示例2: Initialize

		public static void Initialize()
		{
			CommandSystem.Register("ChampionInfo", AccessLevel.GameMaster, new CommandEventHandler(ChampionInfo_OnCommand));

			if (!m_Enabled)
			{
				foreach (ChampionSpawn s in m_AllSpawns)
				{
					s.Delete();
				}
				m_Initialized = false;
				return;
			}

			m_Timer = new InternalTimer();

			if (m_Initialized)
				return;

			Utility.PushColor(ConsoleColor.White);
			Console.WriteLine("Generating Champion Spawns");
			Utility.PopColor();

			ChampionSpawn spawn;

			XmlDocument doc = new XmlDocument();
			doc.Load(m_ConfigPath);
			foreach (XmlNode node in doc.GetElementsByTagName("championSystem")[0].ChildNodes)
			{
				if (node.Name.Equals("spawn"))
				{
					spawn = new ChampionSpawn();
					spawn.SpawnName = GetAttr(node, "name", "Unamed Spawner");
					string value = GetAttr(node, "type", null);
					if(value == null)
						spawn.RandomizeType = true;
					else
						spawn.Type = (ChampionSpawnType)Enum.Parse(typeof(ChampionSpawnType), value);
					value = GetAttr(node, "spawnMod", "1.0");
					spawn.SpawnMod = double.Parse(value);
					value = GetAttr(node, "killsMod", "1.0");
					spawn.KillsMod = double.Parse(value);
					foreach(XmlNode child in node.ChildNodes)
					{
						if (child.Name.Equals("location"))
						{
							int x = int.Parse(GetAttr(child, "x", "0"));
							int y = int.Parse(GetAttr(child, "y", "0"));
							int z = int.Parse(GetAttr(child, "z", "0"));
							int r = int.Parse(GetAttr(child, "radius", "0"));
							string mapName = GetAttr(child, "map", "Felucca");
							Map map = Map.Parse(mapName);

							spawn.SpawnRadius = r;
							spawn.MoveToWorld(new Point3D(x, y, z), map);
						}
					}
					spawn.GroupName = GetAttr(node, "group", null);
					m_AllSpawns.Add(spawn);
				}
			}

			Rotate();

			m_Initialized = true;
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:66,代码来源:ChampionSystem.cs


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