當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。