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);
        }
Beispiel #2
0
        private static void Process(ChampionEntry[] entries)
        {
            for (int i = 0; i < entries.Length; i++)
            {
                ChampionEntry entry = entries[i];

                try
                {
                    ChampionSpawn spawn = Activator.CreateInstance(entry.m_ChampType) as ChampionSpawn;
                    spawn.RandomizeType = entry.m_RandomizeType;
                    spawn.Type          = entry.m_Type;
                    spawn.MoveToWorld(entry.m_SignLocation, entry.m_Map);
                    if (spawn.AlwaysActive)
                    {
                        spawn.ReadyToActivate = true;
                    }
                }
                catch
                {
                    Console.WriteLine("World: Failed to generate champion spawn {0} at {1} ({2}).", entry.m_ChampType.FullName, entry.m_SignLocation, entry.m_Map);
                }
            }
        }
        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;
        }
		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;
		}
Beispiel #5
0
        public static void LoadSpawns()
        {
            if (m_Initialized)
            {
                return;
            }

            RemoveSpawns();

            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
                    {
                        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 = XmlConvert.ToDouble(value);
                    value          = GetAttr(node, "killsMod", "1.0");
                    spawn.KillsMod = XmlConvert.ToDouble(value);

                    foreach (XmlNode child in node.ChildNodes)
                    {
                        if (child.Name.Equals("location"))
                        {
                            int    x       = XmlConvert.ToInt32(GetAttr(child, "x", "0"));
                            int    y       = XmlConvert.ToInt32(GetAttr(child, "y", "0"));
                            int    z       = XmlConvert.ToInt32(GetAttr(child, "z", "0"));
                            int    r       = XmlConvert.ToInt32(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);

                    if (spawn.Type == ChampionSpawnType.Infuse)
                    {
                        PrimevalLichPuzzle.GenLichPuzzle(null);
                    }
                }
            }

            Rotate();

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

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

            if (!m_Enabled)
            {
                return;
            }

            m_Timer = new InternalTimer();

            if (m_Initialized)
            {
                return;
            }

            m_AllSpawns.Clear();

            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 = XmlConvert.ToDouble(value);
                    value          = GetAttr(node, "killsMod", "1.0");
                    spawn.KillsMod = XmlConvert.ToDouble(value);
                    foreach (XmlNode child in node.ChildNodes)
                    {
                        if (child.Name.Equals("location"))
                        {
                            int    x       = XmlConvert.ToInt32(GetAttr(child, "x", "0"));
                            int    y       = XmlConvert.ToInt32(GetAttr(child, "y", "0"));
                            int    z       = XmlConvert.ToInt32(GetAttr(child, "z", "0"));
                            int    r       = XmlConvert.ToInt32(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;
        }