Exemplo n.º 1
0
        // Region Informations:
        public static void LoadRegionCodes()
        {
            TxtFile.ReadFromFile(@"\data\regioncode.txt", '\t');
            int count = TxtFile.amountLine;
            string s = null;
            for (int l = 0; l <= TxtFile.amountLine - 1; l++)
            {
                region r = new region();
                s = TxtFile.lines[l].ToString();
                TxtFile.commands = s.Split('\t');
                r.ID = Convert.ToInt32(TxtFile.commands[1]);
                r.Name = TxtFile.commands[2];
                if (r.Name == "xxx") r.Name = "";
                //r.SecX = Convert.ToInt32(TxtFile.commands[5]);
                //r.SecY = Convert.ToInt32(TxtFile.commands[6]);
                Data.RegionBase.Add(r);
            }

            //get safe zones
            foreach (region r in Data.RegionBase)
            {
                switch (r.ID)
                {
                    //the edges of cities:
                    case 25257:
                    case 24999:
                    case 25001:
                    case 26521:
                    case 26263:
                    case 26265:
                    case 23686:
                    case 23689:
                    case 23175:
                    case 27244:
                    case 27245:
                    case 27501:
                    case 27500:
                    case 27499:
                    case 26957:
                    case 27471:
                    //the area of cities:
                    case 26958:
                    case 26702:
                    case 26446:
                    case 26704:
                    case 26448:
                    case 26960:
                    case 27216:
                    case 27472:
                    case 27217:
                    case 27473:
                    case 27985:
                    case 27729:
                    case 27243:
                    case 23687:
                    case 23431:
                    case 23943:
                    case 24199:
                    case 23688:
                    case 23432:
                    case 26519:
                    case 25000:
                    case 25256:
                    case 25255:
                    case 24743:
                        Data.safeZone.Add(r);
                        break;

                }
            }
            Console.WriteLine("[INFO] Loaded " + TxtFile.amountLine + " Zones");
        }
Exemplo n.º 2
0
 public static void LoadCaves()
 {
     TxtFile.ReadFromFile(@"\data\caveteleportdata.txt", '\t');// made some changes here but still need to add some data to the text files
     string s = null;
     int count = TxtFile.amountLine;
     for (int l = 0; l <= TxtFile.amountLine - 1; l++)
     {
         region r = new region();
         s = TxtFile.lines[l].ToString();
         TxtFile.commands = s.Split('\t');
         r.ID = l;
         short area = short.Parse(TxtFile.commands[5]);
         r.Name = TxtFile.commands[2];
         r.SecX = Convert.ToByte((area).ToString("X4").Substring(2, 2), 16);
         r.SecY = Convert.ToByte((area).ToString("X4").Substring(0, 2), 16);
         Data.Cave.Add(r);
     }
     Console.WriteLine("[INFO] Loaded " + TxtFile.amountLine + " Cave teleport data");
 }