public void Execute(IEnumerable <Area7> Areas, lzGARCFile encdata)
        {
            GetTableRandSettings((RandOption)TableRandomizationOption, out int slotStart, out int slotStop, out bool copy);

            foreach (var Map in Areas)
            {
                foreach (var Table in Map.Tables)
                {
                    if (ModifyLevel)
                    {
                        Table.MinLevel = Randomizer.getModifiedLevel(Table.MinLevel, LevelAmplifier);
                        Table.MaxLevel = Randomizer.getModifiedLevel(Table.MaxLevel, LevelAmplifier);
                    }

                    RandomizeTable7(Table, slotStart, slotStop);
                    if (copy) // copy row 0 to rest
                    {
                        Table.CopySlotsToSOS();
                    }

                    Table.Write();
                }
                encdata[Map.FileNumber] = Area7.GetDayNightTableBinary(Map.Tables);
            }
        }
Exemple #2
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image      = Properties.Resources.sun;
            PB_NightIcon.Image    = Properties.Resources.moon;
            PB_DayIcon.SizeMode   = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            var locationList = Main.Config.getText(TextName.metlist_000000);

            locationList = GetGoodLocationList(locationList);

            nup_spec  = LoadFormeNUD();
            cb_spec   = LoadSpeciesComboBoxes();
            rate_spec = LoadRateNUD();

            encdata = ed;
            var areas = Area7.GetArray(ed, zd, wd, locationList);

            Areas = areas.OrderBy(a => a.Zones[0].Name).ToArray();

            LoadData();

            // ExportEncounters("um", "uu");
        }
Exemple #3
0
            public World(lzGARCFile garc, int worldID)
            {
                int index = worldID * 11;

                _7 = Mini.UnpackMini(garc[index + 7], "ZS");
                _8 = Mini.UnpackMini(garc[index + 8], "ZI");

                ZoneScripts     = HasZS ? _7.Select(arr => new Script(arr)).ToArray() : new Script[0];
                ZoneInfoScripts = HasZI ? _8.Select(arr => new Script(arr)).ToArray() : new Script[0];
            }
Exemple #4
0
        public OWSE7(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            EncounterData = ed;
            ZoneData      = zd;
            WorldData     = wd;


            locationList = Main.getText(TextName.metlist_000000);
            locationList = SMWE.getGoodLocationList(locationList);
        }
Exemple #5
0
        /// <summary>
        /// Gets an annotated Area array
        /// </summary>
        /// <param name="ed">Encounter Data GARC</param>
        /// <param name="zd">ZoneData GARC</param>
        /// <param name="wd">WorldData GARC</param>
        /// <param name="locationList">Location strings</param>
        /// <returns>Annotated Area Array</returns>
        public static Area7[] GetArray(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd, string[] locationList)
        {
            var Worlds = wd.Files.Select(f => Mini.UnpackMini(f, "WD")[0]).ToArray();

            byte[][] zdfiles   = zd.Files;
            var      worldData = zdfiles[1];
            var      zoneData  = zdfiles[0];
            var      zones     = ZoneData7.GetZoneData7Array(zoneData, worldData, locationList, Worlds);
            var      areas     = GetArray(ed, zones);

            return(areas);
        }
Exemple #6
0
        public PickupEditor7(lzGARCFile pickup)
        {
            InitializeComponent();
            g_pickup = pickup;
            var itemlist = Main.Config.getText(TextName.ItemNames);

            itemlist[0] = "";
            items       = itemlist.Select((v, i) => $"{v} - {i:000}").ToArray();
            setupFLP();

            byte[] data = pickup.Files[0];
            getList(data);
        }
Exemple #7
0
        public OWSE7(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            EncounterData = ed;
            ZoneData      = zd;
            WorldData     = wd;

            locationList = Main.Config.getText(TextName.metlist_000000);
            locationList = SMWE.GetGoodLocationList(locationList);

            InitializeComponent();

            var zdFiles = ZoneData.Files;

            zoneData  = zdFiles[0];
            worldData = zdFiles[1];
            loadData();
        }
Exemple #8
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image      = Properties.Resources.sun;
            PB_NightIcon.Image    = Properties.Resources.moon;
            PB_DayIcon.SizeMode   = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            var locationList = Main.Config.getText(TextName.metlist_000000);

            locationList = GetGoodLocationList(locationList);

            nup_spec  = LoadFormeNUD();
            cb_spec   = LoadSpeciesComboBoxes();
            rate_spec = LoadRateNUD();

            encdata = ed;
            var areas = Area7.GetArray(ed, zd, wd, locationList);

            Areas = areas.OrderBy(a => a.Zones[0].Name).ToArray();

            LoadData();
            RandSettings.GetFormSettings(this, GB_Tweak.Controls);

            var weather = string.Format("If weather is active, create a random number.{0}If 0, use slot 0.{0}If <= 10, use slot 1.{0}Else, pick an SOS table and a slot.", Environment.NewLine);

            new ToolTip().SetToolTip(L_AddSOS, weather);
            var sos   = new[] { L_SOS1, L_SOS2, L_SOS3, L_SOS4, L_SOS5, L_SOS6, L_SOS7 };
            var rates = new[] { 1, 1, 1, 10, 10, 10, 67 };

            for (int i = 0; i < sos.Length; i++)
            {
                new ToolTip().SetToolTip(sos[i], $"Table Selection Rate: {rates[i]}%");
            }

            // ExportEncounters("um", "uu");
        }
Exemple #9
0
        public static Area7[] GetArray(lzGARCFile ed, ZoneData7[] zd)
        {
            int fileCount = ed.FileCount;
            var numAreas  = fileCount / 11;
            var areas     = new Area7[numAreas];

            for (int i = 0; i < numAreas; i++)
            {
                areas[i] = new Area7
                {
                    FileNumber = 9 + (11 * i),
                    Zones      = zd.Where(z => z.AreaIndex == i).ToArray()
                };
                var md = ed[areas[i].FileNumber];
                if (md.Length <= 0)
                {
                    areas[i].HasTables = false;
                    continue;
                }

                byte[][] Tables = Mini.UnpackMini(md, PackIdentifier);
                areas[i].HasTables = Tables.Any(t => t.Length > 0);
                if (!areas[i].HasTables)
                {
                    continue;
                }

                foreach (var Table in Tables)
                {
                    var DayTable   = Table.Skip(4).Take(0x164).ToArray();
                    var NightTable = Table.Skip(0x168).ToArray();
                    areas[i].Tables.Add(new EncounterTable(DayTable));
                    areas[i].Tables.Add(new EncounterTable(NightTable));
                }
            }
            return(areas);
        }
Exemple #10
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image      = Properties.Resources.sun;
            PB_NightIcon.Image    = Properties.Resources.moon;
            PB_DayIcon.SizeMode   = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            for (int i = 0; i < locationList.Length; i++)
            {
                locationList[i] = locationList[i].Replace("\r", "");
            }

            var metSM_00000 = locationList;

            var metSM_00000_good = (string[])metSM_00000.Clone();

            for (int i = 0; i < metSM_00000.Length; i += 2)
            {
                var nextLoc = metSM_00000[i + 1];
                if (!string.IsNullOrWhiteSpace(nextLoc) && nextLoc[0] != '[')
                {
                    metSM_00000_good[i] += $" ({nextLoc})";
                }
                if (i > 0 && !string.IsNullOrWhiteSpace(metSM_00000_good[i]) && metSM_00000_good.Take(i - 1).Contains(metSM_00000_good[i]))
                {
                    metSM_00000_good[i] += $" ({metSM_00000_good.Take(i - 1).Count(s => s == metSM_00000_good[i]) + 1})";
                }
            }
            metSM_00000_good.CopyTo(metSM_00000, 0);

            metSM_00000.CopyTo(locationList, 0);

            nup_spec = new[]
            {
                new [] { NUP_Forme1, NUP_Forme2, NUP_Forme3, NUP_Forme4, NUP_Forme5, NUP_Forme6, NUP_Forme7, NUP_Forme8, NUP_Forme9, NUP_Forme10 },
                new [] { NUP_Forme11, NUP_Forme12, NUP_Forme13, NUP_Forme14, NUP_Forme15, NUP_Forme16, NUP_Forme17, NUP_Forme18, NUP_Forme19, NUP_Forme20 },
                new [] { NUP_Forme21, NUP_Forme22, NUP_Forme23, NUP_Forme24, NUP_Forme25, NUP_Forme26, NUP_Forme27, NUP_Forme28, NUP_Forme29, NUP_Forme30 },
                new [] { NUP_Forme31, NUP_Forme32, NUP_Forme33, NUP_Forme34, NUP_Forme35, NUP_Forme36, NUP_Forme37, NUP_Forme38, NUP_Forme39, NUP_Forme40 },
                new [] { NUP_Forme41, NUP_Forme42, NUP_Forme43, NUP_Forme44, NUP_Forme45, NUP_Forme46, NUP_Forme47, NUP_Forme48, NUP_Forme49, NUP_Forme50 },
                new [] { NUP_Forme51, NUP_Forme52, NUP_Forme53, NUP_Forme54, NUP_Forme55, NUP_Forme56, NUP_Forme57, NUP_Forme58, NUP_Forme59, NUP_Forme60 },
                new [] { NUP_Forme61, NUP_Forme62, NUP_Forme63, NUP_Forme64, NUP_Forme65, NUP_Forme66, NUP_Forme67, NUP_Forme68, NUP_Forme69, NUP_Forme70 },
                new [] { NUP_Forme71, NUP_Forme72, NUP_Forme73, NUP_Forme74, NUP_Forme75, NUP_Forme76, NUP_Forme77, NUP_Forme78, NUP_Forme79, NUP_Forme80 },
                new [] { NUP_WeatherForme1, NUP_WeatherForme2, NUP_WeatherForme3, NUP_WeatherForme4, NUP_WeatherForme5, NUP_WeatherForme6 }
            };
            cb_spec = new[]
            {
                new[] { CB_Enc1, CB_Enc2, CB_Enc3, CB_Enc4, CB_Enc5, CB_Enc6, CB_Enc7, CB_Enc8, CB_Enc9, CB_Enc10 },
                new[] { CB_Enc11, CB_Enc12, CB_Enc13, CB_Enc14, CB_Enc15, CB_Enc16, CB_Enc17, CB_Enc18, CB_Enc19, CB_Enc20 },
                new[] { CB_Enc21, CB_Enc22, CB_Enc23, CB_Enc24, CB_Enc25, CB_Enc26, CB_Enc27, CB_Enc28, CB_Enc29, CB_Enc30 },
                new[] { CB_Enc31, CB_Enc32, CB_Enc33, CB_Enc34, CB_Enc35, CB_Enc36, CB_Enc37, CB_Enc38, CB_Enc39, CB_Enc40 },
                new[] { CB_Enc41, CB_Enc42, CB_Enc43, CB_Enc44, CB_Enc45, CB_Enc46, CB_Enc47, CB_Enc48, CB_Enc49, CB_Enc50 },
                new[] { CB_Enc51, CB_Enc52, CB_Enc53, CB_Enc54, CB_Enc55, CB_Enc56, CB_Enc57, CB_Enc58, CB_Enc59, CB_Enc60 },
                new[] { CB_Enc61, CB_Enc62, CB_Enc63, CB_Enc64, CB_Enc65, CB_Enc66, CB_Enc67, CB_Enc68, CB_Enc69, CB_Enc70 },
                new[] { CB_Enc71, CB_Enc72, CB_Enc73, CB_Enc74, CB_Enc75, CB_Enc76, CB_Enc77, CB_Enc78, CB_Enc79, CB_Enc80 },
                new[] { CB_WeatherEnc1, CB_WeatherEnc2, CB_WeatherEnc3, CB_WeatherEnc4, CB_WeatherEnc5, CB_WeatherEnc6 }
            };
            rate_spec = new[]
            { L_Rate1, L_Rate2, L_Rate3, L_Rate4, L_Rate5, L_Rate6, L_Rate7, L_Rate8, L_Rate9, L_Rate10 };

            foreach (var cb_l in cb_spec)
            {
                foreach (var cb in cb_l)
                {
                    cb.Items.AddRange(speciesList); cb.SelectedIndex = 0; cb.SelectedIndexChanged += updateSpeciesForm;
                }
            }
            foreach (var nup_l in nup_spec)
            {
                foreach (var nup in nup_l)
                {
                    nup.ValueChanged += updateSpeciesForm;
                }
            }
            foreach (var l in rate_spec)
            {
                l.Text = "0%";
            }

            byte[][] zdfiles = zd.Files;
            worldData = zdfiles[1]; // 1.bin
            zoneData  = zdfiles[0]; // dec_0.bin
            Zones     = new Zone[zoneData.Length / 0x54];

            var Worlds = wd.Files.Select(f => mini.unpackMini(f, "WD")[0]).ToArray();

            for (int i = 0; i < Zones.Length; i++)
            {
                Zones[i] = new Zone(i)
                {
                    WorldIndex = BitConverter.ToUInt16(worldData, i * 0x2)
                };
                var World         = Worlds[Zones[i].WorldIndex];
                var mappingOffset = BitConverter.ToInt32(World, 0x8);
                for (var ofs = mappingOffset; ofs < World.Length; ofs += 4)
                {
                    if (BitConverter.ToUInt16(World, ofs) != i)
                    {
                        continue;
                    }
                    Zones[i].AreaIndex = BitConverter.ToUInt16(World, ofs + 2);
                    break;
                }
            }

            encdata = ed;
            LoadData();
        }
Exemple #11
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image      = Properties.Resources.sun;
            PB_NightIcon.Image    = Properties.Resources.moon;
            PB_DayIcon.SizeMode   = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            locationList   = Main.getText(TextName.metlist_000000);
            locationList   = getGoodLocationList(locationList);

            nup_spec = new[]
            {
                new [] { NUP_Forme1, NUP_Forme2, NUP_Forme3, NUP_Forme4, NUP_Forme5, NUP_Forme6, NUP_Forme7, NUP_Forme8, NUP_Forme9, NUP_Forme10 },
                new [] { NUP_Forme11, NUP_Forme12, NUP_Forme13, NUP_Forme14, NUP_Forme15, NUP_Forme16, NUP_Forme17, NUP_Forme18, NUP_Forme19, NUP_Forme20 },
                new [] { NUP_Forme21, NUP_Forme22, NUP_Forme23, NUP_Forme24, NUP_Forme25, NUP_Forme26, NUP_Forme27, NUP_Forme28, NUP_Forme29, NUP_Forme30 },
                new [] { NUP_Forme31, NUP_Forme32, NUP_Forme33, NUP_Forme34, NUP_Forme35, NUP_Forme36, NUP_Forme37, NUP_Forme38, NUP_Forme39, NUP_Forme40 },
                new [] { NUP_Forme41, NUP_Forme42, NUP_Forme43, NUP_Forme44, NUP_Forme45, NUP_Forme46, NUP_Forme47, NUP_Forme48, NUP_Forme49, NUP_Forme50 },
                new [] { NUP_Forme51, NUP_Forme52, NUP_Forme53, NUP_Forme54, NUP_Forme55, NUP_Forme56, NUP_Forme57, NUP_Forme58, NUP_Forme59, NUP_Forme60 },
                new [] { NUP_Forme61, NUP_Forme62, NUP_Forme63, NUP_Forme64, NUP_Forme65, NUP_Forme66, NUP_Forme67, NUP_Forme68, NUP_Forme69, NUP_Forme70 },
                new [] { NUP_Forme71, NUP_Forme72, NUP_Forme73, NUP_Forme74, NUP_Forme75, NUP_Forme76, NUP_Forme77, NUP_Forme78, NUP_Forme79, NUP_Forme80 },
                new [] { NUP_WeatherForme1, NUP_WeatherForme2, NUP_WeatherForme3, NUP_WeatherForme4, NUP_WeatherForme5, NUP_WeatherForme6 }
            };
            cb_spec = new[]
            {
                new[] { CB_Enc1, CB_Enc2, CB_Enc3, CB_Enc4, CB_Enc5, CB_Enc6, CB_Enc7, CB_Enc8, CB_Enc9, CB_Enc10 },
                new[] { CB_Enc11, CB_Enc12, CB_Enc13, CB_Enc14, CB_Enc15, CB_Enc16, CB_Enc17, CB_Enc18, CB_Enc19, CB_Enc20 },
                new[] { CB_Enc21, CB_Enc22, CB_Enc23, CB_Enc24, CB_Enc25, CB_Enc26, CB_Enc27, CB_Enc28, CB_Enc29, CB_Enc30 },
                new[] { CB_Enc31, CB_Enc32, CB_Enc33, CB_Enc34, CB_Enc35, CB_Enc36, CB_Enc37, CB_Enc38, CB_Enc39, CB_Enc40 },
                new[] { CB_Enc41, CB_Enc42, CB_Enc43, CB_Enc44, CB_Enc45, CB_Enc46, CB_Enc47, CB_Enc48, CB_Enc49, CB_Enc50 },
                new[] { CB_Enc51, CB_Enc52, CB_Enc53, CB_Enc54, CB_Enc55, CB_Enc56, CB_Enc57, CB_Enc58, CB_Enc59, CB_Enc60 },
                new[] { CB_Enc61, CB_Enc62, CB_Enc63, CB_Enc64, CB_Enc65, CB_Enc66, CB_Enc67, CB_Enc68, CB_Enc69, CB_Enc70 },
                new[] { CB_Enc71, CB_Enc72, CB_Enc73, CB_Enc74, CB_Enc75, CB_Enc76, CB_Enc77, CB_Enc78, CB_Enc79, CB_Enc80 },
                new[] { CB_WeatherEnc1, CB_WeatherEnc2, CB_WeatherEnc3, CB_WeatherEnc4, CB_WeatherEnc5, CB_WeatherEnc6 }
            };
            rate_spec = new[]
            { L_Rate1, L_Rate2, L_Rate3, L_Rate4, L_Rate5, L_Rate6, L_Rate7, L_Rate8, L_Rate9, L_Rate10 };

            foreach (var cb_l in cb_spec)
            {
                foreach (var cb in cb_l)
                {
                    cb.Items.AddRange(speciesList); cb.SelectedIndex = 0; cb.SelectedIndexChanged += updateSpeciesForm;
                }
            }
            foreach (var nup_l in nup_spec)
            {
                foreach (var nup in nup_l)
                {
                    nup.ValueChanged += updateSpeciesForm;
                }
            }
            foreach (var l in rate_spec)
            {
                l.Text = "0%";
            }

            byte[][] zdfiles = zd.Files;
            worldData = zdfiles[1]; // 1.bin
            zoneData  = zdfiles[0]; // dec_0.bin
            Zones     = new ZoneData7[zoneData.Length / ZoneData7.SIZE];

            var Worlds = wd.Files.Select(f => mini.unpackMini(f, "WD")[0]).ToArray();

            for (int i = 0; i < Zones.Length; i++)
            {
                Zones[i] = new ZoneData7(zoneData, i)
                {
                    WorldIndex = BitConverter.ToUInt16(worldData, i * 0x2)
                };
                Zones[i].setName(locationList, i);
                var World         = Worlds[Zones[i].WorldIndex];
                var mappingOffset = BitConverter.ToInt32(World, 0x8);
                for (var ofs = mappingOffset; ofs < World.Length; ofs += 4)
                {
                    if (BitConverter.ToUInt16(World, ofs) != i)
                    {
                        continue;
                    }
                    Zones[i].AreaIndex = BitConverter.ToUInt16(World, ofs + 2);
                    break;
                }
            }

            encdata = ed;
            LoadData();
        }
Exemple #12
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image = Properties.Resources.sun;
            PB_NightIcon.Image = Properties.Resources.moon;
            PB_DayIcon.SizeMode = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            for (int i = 0; i < locationList.Length; i++)
                locationList[i] = locationList[i].Replace("\r", "");

            var metSM_00000 = locationList;

            var metSM_00000_good = (string[])metSM_00000.Clone();
            for (int i = 0; i < metSM_00000.Length; i += 2)
            {
                var nextLoc = metSM_00000[i + 1];
                if (!string.IsNullOrWhiteSpace(nextLoc) && nextLoc[0] != '[')
                    metSM_00000_good[i] += $" ({nextLoc})";
                if (i > 0 && !string.IsNullOrWhiteSpace(metSM_00000_good[i]) && metSM_00000_good.Take(i - 1).Contains(metSM_00000_good[i]))
                    metSM_00000_good[i] += $" ({metSM_00000_good.Take(i - 1).Count(s => s == metSM_00000_good[i]) + 1})";
            }
            metSM_00000_good.CopyTo(metSM_00000, 0);

            metSM_00000.CopyTo(locationList, 0);

            nup_spec = new[]
            {
                new [] { NUP_Forme1, NUP_Forme2, NUP_Forme3, NUP_Forme4, NUP_Forme5, NUP_Forme6, NUP_Forme7, NUP_Forme8, NUP_Forme9, NUP_Forme10 },
                new [] { NUP_Forme11, NUP_Forme12, NUP_Forme13, NUP_Forme14, NUP_Forme15, NUP_Forme16, NUP_Forme17, NUP_Forme18, NUP_Forme19, NUP_Forme20 },
                new [] { NUP_Forme21, NUP_Forme22, NUP_Forme23, NUP_Forme24, NUP_Forme25, NUP_Forme26, NUP_Forme27, NUP_Forme28, NUP_Forme29, NUP_Forme30 },
                new [] { NUP_Forme31, NUP_Forme32, NUP_Forme33, NUP_Forme34, NUP_Forme35, NUP_Forme36, NUP_Forme37, NUP_Forme38, NUP_Forme39, NUP_Forme40 },
                new [] { NUP_Forme41, NUP_Forme42, NUP_Forme43, NUP_Forme44, NUP_Forme45, NUP_Forme46, NUP_Forme47, NUP_Forme48, NUP_Forme49, NUP_Forme50 },
                new [] { NUP_Forme51, NUP_Forme52, NUP_Forme53, NUP_Forme54, NUP_Forme55, NUP_Forme56, NUP_Forme57, NUP_Forme58, NUP_Forme59, NUP_Forme60 },
                new [] { NUP_Forme61, NUP_Forme62, NUP_Forme63, NUP_Forme64, NUP_Forme65, NUP_Forme66, NUP_Forme67, NUP_Forme68, NUP_Forme69, NUP_Forme70 },
                new [] { NUP_Forme71, NUP_Forme72, NUP_Forme73, NUP_Forme74, NUP_Forme75, NUP_Forme76, NUP_Forme77, NUP_Forme78, NUP_Forme79, NUP_Forme80 },
                new [] { NUP_WeatherForme1, NUP_WeatherForme2, NUP_WeatherForme3, NUP_WeatherForme4, NUP_WeatherForme5, NUP_WeatherForme6 }
            };
            cb_spec = new[]
            {
                new[] {CB_Enc1, CB_Enc2, CB_Enc3, CB_Enc4, CB_Enc5, CB_Enc6, CB_Enc7, CB_Enc8, CB_Enc9, CB_Enc10},
                new[] {CB_Enc11, CB_Enc12, CB_Enc13, CB_Enc14, CB_Enc15, CB_Enc16, CB_Enc17, CB_Enc18, CB_Enc19, CB_Enc20},
                new[] {CB_Enc21, CB_Enc22, CB_Enc23, CB_Enc24, CB_Enc25, CB_Enc26, CB_Enc27, CB_Enc28, CB_Enc29, CB_Enc30},
                new[] {CB_Enc31, CB_Enc32, CB_Enc33, CB_Enc34, CB_Enc35, CB_Enc36, CB_Enc37, CB_Enc38, CB_Enc39, CB_Enc40},
                new[] {CB_Enc41, CB_Enc42, CB_Enc43, CB_Enc44, CB_Enc45, CB_Enc46, CB_Enc47, CB_Enc48, CB_Enc49, CB_Enc50},
                new[] {CB_Enc51, CB_Enc52, CB_Enc53, CB_Enc54, CB_Enc55, CB_Enc56, CB_Enc57, CB_Enc58, CB_Enc59, CB_Enc60},
                new[] {CB_Enc61, CB_Enc62, CB_Enc63, CB_Enc64, CB_Enc65, CB_Enc66, CB_Enc67, CB_Enc68, CB_Enc69, CB_Enc70},
                new[] {CB_Enc71, CB_Enc72, CB_Enc73, CB_Enc74, CB_Enc75, CB_Enc76, CB_Enc77, CB_Enc78, CB_Enc79, CB_Enc80},
                new[] {CB_WeatherEnc1, CB_WeatherEnc2, CB_WeatherEnc3, CB_WeatherEnc4, CB_WeatherEnc5, CB_WeatherEnc6}
            };
            rate_spec = new[]
            {L_Rate1, L_Rate2, L_Rate3, L_Rate4, L_Rate5, L_Rate6, L_Rate7, L_Rate8, L_Rate9, L_Rate10};

            foreach (var cb_l in cb_spec) foreach (var cb in cb_l) { cb.Items.AddRange(speciesList); cb.SelectedIndex = 0; cb.SelectedIndexChanged += updateSpeciesForm; }
            foreach (var nup_l in nup_spec) foreach (var nup in nup_l) { nup.ValueChanged += updateSpeciesForm; }
            foreach (var l in rate_spec)
                l.Text = "0%";

            byte[][] zdfiles = zd.Files;
            worldData = zdfiles[1]; // 1.bin
            zoneData = zdfiles[0]; // dec_0.bin
            Zones = new Zone[zoneData.Length / 0x54];

            var Worlds = wd.Files.Select(f => mini.unpackMini(f, "WD")[0]).ToArray();
            for (int i = 0; i < Zones.Length; i++)
            {
                Zones[i] = new Zone(i) {WorldIndex = BitConverter.ToUInt16(worldData, i*0x2)};
                var World = Worlds[Zones[i].WorldIndex];
                var mappingOffset = BitConverter.ToInt32(World, 0x8);
                for (var ofs = mappingOffset; ofs < World.Length; ofs += 4)
                {
                    if (BitConverter.ToUInt16(World, ofs) != i)
                        continue;
                    Zones[i].AreaIndex = BitConverter.ToUInt16(World, ofs + 2);
                    break;
                }
            }

            encdata = ed;
            LoadData();
        }