0.1 commit with cleaned code
17
.gitattributes
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
18
.gitignore
vendored
@@ -17,6 +17,7 @@
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
@@ -75,7 +76,6 @@ _Chutzpah*
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
@@ -150,24 +150,13 @@ publish/
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
# Windows Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Microsoft Azure ApplicationInsights config file
|
||||
ApplicationInsights.config
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
@@ -177,6 +166,7 @@ BundleArtifacts/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
@@ -233,4 +223,4 @@ _Pvt_Extensions
|
||||
.paket/paket.exe
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
.fake/
|
||||
18
BW2_hiddengrotto_swarm_tool.sln
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# SharpDevelop 5.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B&W 2 Hidden Grotto & Swarm tool", "BW2_hiddengrotto_swarm_tool\BW2_hiddengrotto_swarm_tool.csproj", "{04D6AB64-012D-4427-BE84-9589CF2D3103}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{04D6AB64-012D-4427-BE84-9589CF2D3103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04D6AB64-012D-4427-BE84-9589CF2D3103}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04D6AB64-012D-4427-BE84-9589CF2D3103}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{04D6AB64-012D-4427-BE84-9589CF2D3103}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{04D6AB64-012D-4427-BE84-9589CF2D3103}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>BW2_hiddengrotto_swarm_tool</RootNamespace>
|
||||
<AssemblyName>BW2_hiddengrotto_swarm_tool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainForm.cs" />
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
626
BW2_hiddengrotto_swarm_tool/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,626 @@
|
||||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 17/10/2015
|
||||
* Time: 16:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
namespace BW2_hiddengrotto_swarm_tool
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
private System.Windows.Forms.Button load_but;
|
||||
private System.Windows.Forms.TextBox savegamename;
|
||||
private System.Windows.Forms.ComboBox Grotto_route;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox normalgrottobox;
|
||||
private System.Windows.Forms.ComboBox fungrottobox;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.ComboBox normalgrottogroupbox;
|
||||
private System.Windows.Forms.ComboBox fungrottogroupbox;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.CheckBox normalgrottoavailable;
|
||||
private System.Windows.Forms.CheckBox fungrottoavailable;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button save_button;
|
||||
private System.Windows.Forms.ComboBox swarmbox;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox lastgrottobox;
|
||||
private System.Windows.Forms.Button lastvisitedhelp;
|
||||
private System.Windows.Forms.Button fungrottohelp;
|
||||
private System.Windows.Forms.NumericUpDown unknowngrottobox;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox gender5;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.TextBox gender10;
|
||||
private System.Windows.Forms.TextBox gender30;
|
||||
private System.Windows.Forms.TextBox gender60;
|
||||
private System.Windows.Forms.Button forceMale_but;
|
||||
private System.Windows.Forms.Button forceFemale_but;
|
||||
private System.Windows.Forms.Button note_but;
|
||||
private System.Windows.Forms.Button grotto_help;
|
||||
private System.Windows.Forms.Button table_but;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (components != null) {
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.load_but = new System.Windows.Forms.Button();
|
||||
this.savegamename = new System.Windows.Forms.TextBox();
|
||||
this.Grotto_route = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.normalgrottobox = new System.Windows.Forms.ComboBox();
|
||||
this.fungrottobox = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.normalgrottogroupbox = new System.Windows.Forms.ComboBox();
|
||||
this.fungrottogroupbox = new System.Windows.Forms.ComboBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.normalgrottoavailable = new System.Windows.Forms.CheckBox();
|
||||
this.fungrottoavailable = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.fungrottohelp = new System.Windows.Forms.Button();
|
||||
this.note_but = new System.Windows.Forms.Button();
|
||||
this.save_button = new System.Windows.Forms.Button();
|
||||
this.swarmbox = new System.Windows.Forms.ComboBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.grotto_help = new System.Windows.Forms.Button();
|
||||
this.table_but = new System.Windows.Forms.Button();
|
||||
this.forceMale_but = new System.Windows.Forms.Button();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.gender5 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.gender10 = new System.Windows.Forms.TextBox();
|
||||
this.gender60 = new System.Windows.Forms.TextBox();
|
||||
this.gender30 = new System.Windows.Forms.TextBox();
|
||||
this.forceFemale_but = new System.Windows.Forms.Button();
|
||||
this.lastvisitedhelp = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.lastgrottobox = new System.Windows.Forms.ComboBox();
|
||||
this.unknowngrottobox = new System.Windows.Forms.NumericUpDown();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.unknowngrottobox)).BeginInit();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// load_but
|
||||
//
|
||||
this.load_but.Location = new System.Drawing.Point(264, 12);
|
||||
this.load_but.Name = "load_but";
|
||||
this.load_but.Size = new System.Drawing.Size(162, 23);
|
||||
this.load_but.TabIndex = 0;
|
||||
this.load_but.Text = "Load B/W 2 Savegame";
|
||||
this.load_but.UseVisualStyleBackColor = true;
|
||||
this.load_but.Click += new System.EventHandler(this.load_butClick);
|
||||
//
|
||||
// savegamename
|
||||
//
|
||||
this.savegamename.Location = new System.Drawing.Point(13, 41);
|
||||
this.savegamename.Name = "savegamename";
|
||||
this.savegamename.Size = new System.Drawing.Size(694, 20);
|
||||
this.savegamename.TabIndex = 1;
|
||||
this.savegamename.TextChanged += new System.EventHandler(this.SavegamenameTextChanged);
|
||||
//
|
||||
// Grotto_route
|
||||
//
|
||||
this.Grotto_route.FormattingEnabled = true;
|
||||
this.Grotto_route.Items.AddRange(new object[] {
|
||||
"Sangi Ranch (10-15)",
|
||||
"Route 5 (20-25)",
|
||||
"Lostlorn Forest (20-25)",
|
||||
"Route 6 [Field] (25-30)",
|
||||
"Route 6 [Cave] (25-30)",
|
||||
"Route 7 (30-35)",
|
||||
"Route 13 [StairLeft] (35-40)",
|
||||
"Route 13 [StairDown] (35-40)",
|
||||
"Route 9 (35-40)",
|
||||
"Giant Chasm (45-50)",
|
||||
"Route 22 (40-45)",
|
||||
"Route 23 (50-55)",
|
||||
"Abundant [Field] (35-40)",
|
||||
"Abundant [Pond] (35-40)",
|
||||
"Pinwheel [Interior] (55-60)",
|
||||
"Pinwheel [Exterior] (55-60)",
|
||||
"Route 3 [Daycare] (55-60)",
|
||||
"Route 3 [Pond] (55-60)",
|
||||
"Route 2 (55-60)",
|
||||
"Route 18 (55-60)"});
|
||||
this.Grotto_route.Location = new System.Drawing.Point(23, 30);
|
||||
this.Grotto_route.Name = "Grotto_route";
|
||||
this.Grotto_route.Size = new System.Drawing.Size(197, 21);
|
||||
this.Grotto_route.TabIndex = 6;
|
||||
this.Grotto_route.SelectedIndexChanged += new System.EventHandler(this.Grotto_routeSelectedIndexChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(68, 18);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(100, 23);
|
||||
this.label2.TabIndex = 8;
|
||||
this.label2.Text = "Slot";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(68, 17);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(100, 23);
|
||||
this.label3.TabIndex = 9;
|
||||
this.label3.Text = "Slot";
|
||||
//
|
||||
// normalgrottobox
|
||||
//
|
||||
this.normalgrottobox.FormattingEnabled = true;
|
||||
this.normalgrottobox.Items.AddRange(new object[] {
|
||||
"Pokemon 1",
|
||||
"Pokemon 2",
|
||||
"Pokemon 3",
|
||||
"Item 1",
|
||||
"Item 2",
|
||||
"Item 3",
|
||||
"Item 4",
|
||||
"Dowsing 1",
|
||||
"Dowsing 2",
|
||||
"Dowsing 3",
|
||||
"Dowsing 4",
|
||||
"Unknown/Not used/Buggy 1",
|
||||
"Unknown/Not used/Buggy 2",
|
||||
"Unknown/Not used/Buggy 3",
|
||||
"Unknown/Not used/Buggy 4",
|
||||
"Unknown/Not used/Buggy 5"});
|
||||
this.normalgrottobox.Location = new System.Drawing.Point(68, 34);
|
||||
this.normalgrottobox.Name = "normalgrottobox";
|
||||
this.normalgrottobox.Size = new System.Drawing.Size(121, 21);
|
||||
this.normalgrottobox.TabIndex = 10;
|
||||
//
|
||||
// fungrottobox
|
||||
//
|
||||
this.fungrottobox.FormattingEnabled = true;
|
||||
this.fungrottobox.Items.AddRange(new object[] {
|
||||
"Pokemon 1",
|
||||
"Pokemon 2",
|
||||
"Pokemon 3 - GROUP A FEMALE 5% ^^^^",
|
||||
"Item 1",
|
||||
"Item 2 - GROUP A FEMALE 10% ^^^^",
|
||||
"Item 3",
|
||||
"Item 4",
|
||||
"Dowsing 1",
|
||||
"Dowsing 2",
|
||||
"Dowsing 3",
|
||||
"Dowsing 4",
|
||||
"Unknown/Not used/Buggy 1",
|
||||
"Unknown/Not used/Buggy 2",
|
||||
"Unknown - GROUP B FEMALE 60% ^^^^",
|
||||
"Unknown - GROUP A FEMALE 30% ^^^^",
|
||||
"Unknown/Not used/Buggy 5"});
|
||||
this.fungrottobox.Location = new System.Drawing.Point(68, 33);
|
||||
this.fungrottobox.Name = "fungrottobox";
|
||||
this.fungrottobox.Size = new System.Drawing.Size(204, 21);
|
||||
this.fungrottobox.TabIndex = 11;
|
||||
this.fungrottobox.SelectedIndexChanged += new System.EventHandler(this.FungrottoboxSelectedIndexChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(14, 18);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(48, 23);
|
||||
this.label4.TabIndex = 12;
|
||||
this.label4.Text = "Group";
|
||||
//
|
||||
// normalgrottogroupbox
|
||||
//
|
||||
this.normalgrottogroupbox.FormattingEnabled = true;
|
||||
this.normalgrottogroupbox.Items.AddRange(new object[] {
|
||||
"A",
|
||||
"B",
|
||||
"C",
|
||||
"D"});
|
||||
this.normalgrottogroupbox.Location = new System.Drawing.Point(14, 34);
|
||||
this.normalgrottogroupbox.Name = "normalgrottogroupbox";
|
||||
this.normalgrottogroupbox.Size = new System.Drawing.Size(48, 21);
|
||||
this.normalgrottogroupbox.TabIndex = 13;
|
||||
//
|
||||
// fungrottogroupbox
|
||||
//
|
||||
this.fungrottogroupbox.FormattingEnabled = true;
|
||||
this.fungrottogroupbox.Items.AddRange(new object[] {
|
||||
"A",
|
||||
"B",
|
||||
"C",
|
||||
"D"});
|
||||
this.fungrottogroupbox.Location = new System.Drawing.Point(14, 33);
|
||||
this.fungrottogroupbox.Name = "fungrottogroupbox";
|
||||
this.fungrottogroupbox.Size = new System.Drawing.Size(48, 21);
|
||||
this.fungrottogroupbox.TabIndex = 15;
|
||||
this.fungrottogroupbox.SelectedIndexChanged += new System.EventHandler(this.FungrottogroupboxSelectedIndexChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Location = new System.Drawing.Point(14, 17);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(48, 23);
|
||||
this.label5.TabIndex = 14;
|
||||
this.label5.Text = "Group";
|
||||
//
|
||||
// normalgrottoavailable
|
||||
//
|
||||
this.normalgrottoavailable.Location = new System.Drawing.Point(68, 61);
|
||||
this.normalgrottoavailable.Name = "normalgrottoavailable";
|
||||
this.normalgrottoavailable.Size = new System.Drawing.Size(104, 24);
|
||||
this.normalgrottoavailable.TabIndex = 16;
|
||||
this.normalgrottoavailable.Text = "Available";
|
||||
this.normalgrottoavailable.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// fungrottoavailable
|
||||
//
|
||||
this.fungrottoavailable.Location = new System.Drawing.Point(68, 60);
|
||||
this.fungrottoavailable.Name = "fungrottoavailable";
|
||||
this.fungrottoavailable.Size = new System.Drawing.Size(104, 24);
|
||||
this.fungrottoavailable.TabIndex = 17;
|
||||
this.fungrottoavailable.Text = "Available";
|
||||
this.fungrottoavailable.UseVisualStyleBackColor = true;
|
||||
this.fungrottoavailable.CheckedChanged += new System.EventHandler(this.FungrottoavailableCheckedChanged);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.normalgrottoavailable);
|
||||
this.groupBox1.Controls.Add(this.normalgrottogroupbox);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.normalgrottobox);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Location = new System.Drawing.Point(23, 66);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(195, 98);
|
||||
this.groupBox1.TabIndex = 18;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Normal Grotto";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.fungrottohelp);
|
||||
this.groupBox2.Controls.Add(this.fungrottoavailable);
|
||||
this.groupBox2.Controls.Add(this.fungrottogroupbox);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.fungrottobox);
|
||||
this.groupBox2.Controls.Add(this.label3);
|
||||
this.groupBox2.Location = new System.Drawing.Point(224, 67);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(278, 97);
|
||||
this.groupBox2.TabIndex = 19;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Funfest Grotto ?";
|
||||
//
|
||||
// fungrottohelp
|
||||
//
|
||||
this.fungrottohelp.Location = new System.Drawing.Point(256, 0);
|
||||
this.fungrottohelp.Name = "fungrottohelp";
|
||||
this.fungrottohelp.Size = new System.Drawing.Size(22, 23);
|
||||
this.fungrottohelp.TabIndex = 23;
|
||||
this.fungrottohelp.Text = "?";
|
||||
this.fungrottohelp.UseVisualStyleBackColor = true;
|
||||
this.fungrottohelp.Click += new System.EventHandler(this.FungrottohelpClick);
|
||||
//
|
||||
// note_but
|
||||
//
|
||||
this.note_but.Location = new System.Drawing.Point(23, 170);
|
||||
this.note_but.Name = "note_but";
|
||||
this.note_but.Size = new System.Drawing.Size(75, 23);
|
||||
this.note_but.TabIndex = 24;
|
||||
this.note_but.Text = "Note";
|
||||
this.note_but.UseVisualStyleBackColor = true;
|
||||
this.note_but.Click += new System.EventHandler(this.Note_butClick);
|
||||
//
|
||||
// save_button
|
||||
//
|
||||
this.save_button.Enabled = false;
|
||||
this.save_button.Location = new System.Drawing.Point(537, 298);
|
||||
this.save_button.Name = "save_button";
|
||||
this.save_button.Size = new System.Drawing.Size(162, 23);
|
||||
this.save_button.TabIndex = 20;
|
||||
this.save_button.Text = "Save";
|
||||
this.save_button.UseVisualStyleBackColor = true;
|
||||
this.save_button.Click += new System.EventHandler(this.Save_buttonClick);
|
||||
//
|
||||
// swarmbox
|
||||
//
|
||||
this.swarmbox.FormattingEnabled = true;
|
||||
this.swarmbox.Items.AddRange(new object[] {
|
||||
"Route 1",
|
||||
"Dreamyard",
|
||||
"Route 6",
|
||||
"Route 3",
|
||||
"Route 9",
|
||||
"Resort Desert",
|
||||
"Route 5",
|
||||
"Route 7",
|
||||
"Route 12",
|
||||
"Route 8",
|
||||
"Route 11",
|
||||
"Route 13",
|
||||
"Abundant Shrine",
|
||||
"Route 15",
|
||||
"Route 16",
|
||||
"Route 18",
|
||||
"Rebirth Mountain",
|
||||
"Route 20",
|
||||
"Route 22"});
|
||||
this.swarmbox.Location = new System.Drawing.Point(6, 30);
|
||||
this.swarmbox.Name = "swarmbox";
|
||||
this.swarmbox.Size = new System.Drawing.Size(161, 21);
|
||||
this.swarmbox.TabIndex = 22;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.grotto_help);
|
||||
this.groupBox3.Controls.Add(this.table_but);
|
||||
this.groupBox3.Controls.Add(this.note_but);
|
||||
this.groupBox3.Controls.Add(this.forceMale_but);
|
||||
this.groupBox3.Controls.Add(this.groupBox5);
|
||||
this.groupBox3.Controls.Add(this.forceFemale_but);
|
||||
this.groupBox3.Controls.Add(this.lastvisitedhelp);
|
||||
this.groupBox3.Controls.Add(this.label1);
|
||||
this.groupBox3.Controls.Add(this.lastgrottobox);
|
||||
this.groupBox3.Controls.Add(this.groupBox2);
|
||||
this.groupBox3.Controls.Add(this.groupBox1);
|
||||
this.groupBox3.Controls.Add(this.Grotto_route);
|
||||
this.groupBox3.Location = new System.Drawing.Point(13, 67);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(508, 254);
|
||||
this.groupBox3.TabIndex = 23;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Hidden Grotto";
|
||||
//
|
||||
// grotto_help
|
||||
//
|
||||
this.grotto_help.Location = new System.Drawing.Point(307, 30);
|
||||
this.grotto_help.Name = "grotto_help";
|
||||
this.grotto_help.Size = new System.Drawing.Size(18, 23);
|
||||
this.grotto_help.TabIndex = 25;
|
||||
this.grotto_help.Text = "?";
|
||||
this.grotto_help.UseVisualStyleBackColor = true;
|
||||
this.grotto_help.Click += new System.EventHandler(this.Grotto_helpClick);
|
||||
//
|
||||
// table_but
|
||||
//
|
||||
this.table_but.Enabled = false;
|
||||
this.table_but.Location = new System.Drawing.Point(226, 30);
|
||||
this.table_but.Name = "table_but";
|
||||
this.table_but.Size = new System.Drawing.Size(75, 23);
|
||||
this.table_but.TabIndex = 25;
|
||||
this.table_but.Text = "Grotto Table";
|
||||
this.table_but.UseVisualStyleBackColor = true;
|
||||
this.table_but.Click += new System.EventHandler(this.Black2table_butClick);
|
||||
//
|
||||
// forceMale_but
|
||||
//
|
||||
this.forceMale_but.Location = new System.Drawing.Point(365, 43);
|
||||
this.forceMale_but.Name = "forceMale_but";
|
||||
this.forceMale_but.Size = new System.Drawing.Size(103, 23);
|
||||
this.forceMale_but.TabIndex = 26;
|
||||
this.forceMale_but.Text = "Force Male";
|
||||
this.forceMale_but.UseVisualStyleBackColor = true;
|
||||
this.forceMale_but.Click += new System.EventHandler(this.ForceMale_butClick);
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.label9);
|
||||
this.groupBox5.Controls.Add(this.label6);
|
||||
this.groupBox5.Controls.Add(this.label8);
|
||||
this.groupBox5.Controls.Add(this.gender5);
|
||||
this.groupBox5.Controls.Add(this.label7);
|
||||
this.groupBox5.Controls.Add(this.gender10);
|
||||
this.groupBox5.Controls.Add(this.gender60);
|
||||
this.groupBox5.Controls.Add(this.gender30);
|
||||
this.groupBox5.Location = new System.Drawing.Point(368, 170);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(134, 76);
|
||||
this.groupBox5.TabIndex = 24;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Gender";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.Location = new System.Drawing.Point(63, 46);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(27, 23);
|
||||
this.label9.TabIndex = 31;
|
||||
this.label9.Text = "60%";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Location = new System.Drawing.Point(6, 22);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(25, 23);
|
||||
this.label6.TabIndex = 28;
|
||||
this.label6.Text = "5%";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.Location = new System.Drawing.Point(2, 46);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(27, 23);
|
||||
this.label8.TabIndex = 30;
|
||||
this.label8.Text = "30%";
|
||||
//
|
||||
// gender5
|
||||
//
|
||||
this.gender5.Enabled = false;
|
||||
this.gender5.Location = new System.Drawing.Point(35, 22);
|
||||
this.gender5.Name = "gender5";
|
||||
this.gender5.Size = new System.Drawing.Size(22, 20);
|
||||
this.gender5.TabIndex = 24;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Location = new System.Drawing.Point(65, 19);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(27, 23);
|
||||
this.label7.TabIndex = 29;
|
||||
this.label7.Text = "10%";
|
||||
//
|
||||
// gender10
|
||||
//
|
||||
this.gender10.Enabled = false;
|
||||
this.gender10.Location = new System.Drawing.Point(96, 19);
|
||||
this.gender10.Name = "gender10";
|
||||
this.gender10.Size = new System.Drawing.Size(22, 20);
|
||||
this.gender10.TabIndex = 25;
|
||||
//
|
||||
// gender60
|
||||
//
|
||||
this.gender60.Enabled = false;
|
||||
this.gender60.Location = new System.Drawing.Point(96, 46);
|
||||
this.gender60.Name = "gender60";
|
||||
this.gender60.Size = new System.Drawing.Size(22, 20);
|
||||
this.gender60.TabIndex = 27;
|
||||
//
|
||||
// gender30
|
||||
//
|
||||
this.gender30.Enabled = false;
|
||||
this.gender30.Location = new System.Drawing.Point(35, 46);
|
||||
this.gender30.Name = "gender30";
|
||||
this.gender30.Size = new System.Drawing.Size(22, 20);
|
||||
this.gender30.TabIndex = 26;
|
||||
//
|
||||
// forceFemale_but
|
||||
//
|
||||
this.forceFemale_but.Location = new System.Drawing.Point(365, 14);
|
||||
this.forceFemale_but.Name = "forceFemale_but";
|
||||
this.forceFemale_but.Size = new System.Drawing.Size(103, 23);
|
||||
this.forceFemale_but.TabIndex = 25;
|
||||
this.forceFemale_but.Text = "Force Female";
|
||||
this.forceFemale_but.UseVisualStyleBackColor = true;
|
||||
this.forceFemale_but.Click += new System.EventHandler(this.ForceFemale_butClick);
|
||||
//
|
||||
// lastvisitedhelp
|
||||
//
|
||||
this.lastvisitedhelp.Location = new System.Drawing.Point(323, 201);
|
||||
this.lastvisitedhelp.Name = "lastvisitedhelp";
|
||||
this.lastvisitedhelp.Size = new System.Drawing.Size(22, 23);
|
||||
this.lastvisitedhelp.TabIndex = 22;
|
||||
this.lastvisitedhelp.Text = "?";
|
||||
this.lastvisitedhelp.UseVisualStyleBackColor = true;
|
||||
this.lastvisitedhelp.Click += new System.EventHandler(this.LastvisitedhelpClick);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(20, 204);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(94, 23);
|
||||
this.label1.TabIndex = 21;
|
||||
this.label1.Text = "Last Visited Grotto";
|
||||
//
|
||||
// lastgrottobox
|
||||
//
|
||||
this.lastgrottobox.FormattingEnabled = true;
|
||||
this.lastgrottobox.Items.AddRange(new object[] {
|
||||
"Sangi Ranch (10-15)",
|
||||
"Route 5 (20-25)",
|
||||
"Lostlorn Forest (20-25)",
|
||||
"Route 6 [Field] (25-30)",
|
||||
"Route 6 [Cave] (25-30)",
|
||||
"Route 7 (30-35)",
|
||||
"Route 13 [StairLeft] (35-40)",
|
||||
"Route 13 [StairDown] (35-40)",
|
||||
"Route 9 (35-40)",
|
||||
"Giant Chasm (45-50)",
|
||||
"Route 22 (40-45)",
|
||||
"Route 23 (50-55)",
|
||||
"Abundant [Field] (35-40)",
|
||||
"Abundant [Pond] (35-40)",
|
||||
"Pinwheel [Interior] (55-60)",
|
||||
"Pinwheel [Exterior] (55-60)",
|
||||
"Route 3 [Daycare] (55-60)",
|
||||
"Route 3 [Pond] (55-60)",
|
||||
"Route 2 (55-60)",
|
||||
"Route 18 (55-60)"});
|
||||
this.lastgrottobox.Location = new System.Drawing.Point(120, 201);
|
||||
this.lastgrottobox.Name = "lastgrottobox";
|
||||
this.lastgrottobox.Size = new System.Drawing.Size(197, 21);
|
||||
this.lastgrottobox.TabIndex = 20;
|
||||
//
|
||||
// unknowngrottobox
|
||||
//
|
||||
this.unknowngrottobox.Location = new System.Drawing.Point(538, 149);
|
||||
this.unknowngrottobox.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.unknowngrottobox.Name = "unknowngrottobox";
|
||||
this.unknowngrottobox.Size = new System.Drawing.Size(52, 20);
|
||||
this.unknowngrottobox.TabIndex = 23;
|
||||
this.unknowngrottobox.Visible = false;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.swarmbox);
|
||||
this.groupBox4.Location = new System.Drawing.Point(532, 67);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(175, 65);
|
||||
this.groupBox4.TabIndex = 24;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Current Swarm";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(722, 333);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.save_button);
|
||||
this.Controls.Add(this.savegamename);
|
||||
this.Controls.Add(this.load_but);
|
||||
this.Controls.Add(this.unknowngrottobox);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "BW2 Grotto & Swarm tool 0.1 by suloku";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.unknowngrottobox)).EndInit();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
880
BW2_hiddengrotto_swarm_tool/MainForm.cs
Normal file
@@ -0,0 +1,880 @@
|
||||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 27/02/2016
|
||||
* Time: 16:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
|
||||
|
||||
namespace BW2_hiddengrotto_swarm_tool
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Description of MainForm.
|
||||
/// </summary>
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
//Hidden Hollow BW2
|
||||
/* Structure:
|
||||
The block at 0x23B00 contains rival data and hidden hollow information.
|
||||
|
||||
Hidden hollows start at 0xCC in that block. Each hollow takes 2 bytes (40 bytes in total),
|
||||
and afterwards there's an additional byte containing the last hidden hollow visited, probably used
|
||||
when the game is saved to know at which hollow the game saved (changing this in a save that saved at a hollow
|
||||
will warp to that hollow).
|
||||
|
||||
When a hollow regenerates, both bytes for that hollow are randomly generated.
|
||||
|
||||
The first byte determines the content of the hollow:
|
||||
- Group A slots range from 0x00 to 0x15
|
||||
- Group B slots range from 0x20 to 0x35
|
||||
- Group C slots range from 0x40 to 0x55
|
||||
- Group D slots range from 0x60 to 0x75
|
||||
- A hollow is marked as "used" when the last bit is set to 0 (0x06, 0x1A...)
|
||||
|
||||
The second byte is used to determine the gender of the pokemon in the hollow and
|
||||
can range from 0x00 to 0x7F (at least, I haven't seen greater values).
|
||||
The gender depends on the hollow and the pokemon female/male ratio for that hollow, see the code for more information.
|
||||
|
||||
To be confirmed if this second byte is used to determine the content of the hollows when
|
||||
in a special funfest mission or in the Noisy/Quiet hidden hollow funfest mission.
|
||||
|
||||
|
||||
*/
|
||||
public const int GROTTO_START_OFFSET = 0x23B00; //Start offset of block containing rival and hollow data
|
||||
public const int HOLLOW_UNKNOWN_OFFSET = 0xC5; //This value might not be related to hidden hollows
|
||||
public const int HOLLOW_OFFSET = 0xCC; //Start offset of hollow data
|
||||
public const int GROTTO_BLOCK_SIZE = 0x100; //Size of the block
|
||||
public const int GROTTO_BLOCK_SIZE_CRC = 0x100-0x4; //Size of the block used to calculate CRC checksum
|
||||
public const int GROTTO_CRC_OFFSET = 0x100-0x2; //Location of CRC checksum
|
||||
public const int GROTTO_CRC_TABLE_OFFSET = 0x84; //Location of CRC checksum in checksum table
|
||||
|
||||
//Overworld block (contains swarm byte)
|
||||
public const int OVERWORLD_START_OFFSET = 0x21900;//Start offset of block containing swarm data
|
||||
public const int SWARM_OFFSET = 0x2C; //Offset of swarm data byte
|
||||
public const int OVERWORLD_BLOCK_SIZE = 0x38; //Size of the block
|
||||
public const int OVERWORLD_BLOCK_SIZE_CRC = 0x38-0x04; //Size of the block used to calculate CRC checksum
|
||||
public const int OVERWORLD_CRC_OFFSET = 0x38-0x02; //Location of CRC checksum
|
||||
public const int OVERWORLD_CRC_TABLE_OFFSET = 0x6E; //Location of CRC checksum in checksum table
|
||||
|
||||
public const int BACKUP_SAVE_OFFSET = 0x26000; //Gap between main save and backup save
|
||||
public const int CRC_TABLE = 0x25F00; //CRC table offset
|
||||
public const int CRC_TABLE_SIZE = 0x94; //CRC table size
|
||||
public const int CRC_TABLE_CRC = 0x25FA2; //CRC table's crc offset
|
||||
|
||||
byte grotto = 0x00; //Variable that will hold current grotto data byte 1
|
||||
byte grotto_fun = 0x00; //Variable that will hold current grotto data byte 2 (funfest data?)
|
||||
byte last_grotto = 0x00; //Variable that will hold last visited grotto byte
|
||||
byte grotto_unknown = 0x00;
|
||||
|
||||
byte swarm = 0x00;
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
unknowngrottobox.Hexadecimal = true;
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
}
|
||||
|
||||
byte[] savebuffer = new byte[524288];
|
||||
byte[] grottobuffer = new byte[GROTTO_BLOCK_SIZE];
|
||||
byte[] grottobuffer_dec = new byte[GROTTO_BLOCK_SIZE];
|
||||
byte[] overworldbuffer = new byte[OVERWORLD_BLOCK_SIZE];
|
||||
|
||||
/// <summary>
|
||||
/// Reads data into a complete array, throwing an EndOfStreamException
|
||||
/// if the stream runs out of data first, or if an IOException
|
||||
/// naturally occurs.
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream to read data from</param>
|
||||
/// <param name="data">The array to read bytes into. The array
|
||||
/// will be completely filled from the stream, so an appropriate
|
||||
/// size must be given.</param>
|
||||
public static void ReadWholeArray (Stream stream, byte[] data)
|
||||
{
|
||||
int offset=0;
|
||||
int remaining = data.Length;
|
||||
while (remaining > 0)
|
||||
{
|
||||
int read = stream.Read(data, offset, remaining);
|
||||
if (read <= 0)
|
||||
throw new EndOfStreamException
|
||||
(String.Format("End of stream reached with {0} bytes left to read", remaining));
|
||||
remaining -= read;
|
||||
offset += read;
|
||||
}
|
||||
}
|
||||
private void PDR_read_data()
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(savegamename.Text, FileMode.Open);
|
||||
if (saveFile.Length != 524288 && saveFile.Length != 524288+122 ){
|
||||
savegamename.Text = "";
|
||||
MessageBox.Show("Invalid file length", "Error");
|
||||
return;
|
||||
}
|
||||
ReadWholeArray(saveFile, savebuffer);
|
||||
saveFile.Close();
|
||||
}
|
||||
private void PDR_get_data()
|
||||
{
|
||||
OpenFileDialog openFD = new OpenFileDialog();
|
||||
//openFD.InitialDirectory = "c:\\";
|
||||
openFD.Filter = "NDS save data|*.sav;*.dsv|All Files (*.*)|*.*";
|
||||
if (openFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
#region filename
|
||||
savegamename.Text = openFD.FileName;
|
||||
#endregion
|
||||
PDR_read_data();
|
||||
}
|
||||
|
||||
}
|
||||
private void PDR_save_data()
|
||||
{ if (savegamename.Text.Length < 1) return;
|
||||
SaveFileDialog saveFD = new SaveFileDialog();
|
||||
//saveFD.InitialDirectory = "c:\\";
|
||||
saveFD.Filter = "NDS save data|*.sav;*.dsv|All Files (*.*)|*.*";
|
||||
if (saveFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(saveFD.FileName, FileMode.Create);
|
||||
//Write file
|
||||
saveFile.Write(savebuffer, 0, savebuffer.Length);
|
||||
saveFile.Close();
|
||||
MessageBox.Show("File Saved.", "Save file");
|
||||
}
|
||||
}
|
||||
private void PDR_fix_grotto_checksum()
|
||||
{
|
||||
//Recalculate checksum table's checksum
|
||||
byte[] checktable = new byte[GROTTO_BLOCK_SIZE_CRC];
|
||||
Array.Copy(grottobuffer, 0x00, checktable, 0, GROTTO_BLOCK_SIZE_CRC);
|
||||
byte[] crcsum = new byte[2];
|
||||
crcsum = ccitt16(checktable);
|
||||
//MessageBox.Show(BitConverter.ToUInt16(tablecrcsum, 0).ToString());
|
||||
//Put new checksum in buffer
|
||||
Array.Copy(crcsum, 0, grottobuffer, GROTTO_CRC_OFFSET, 2);
|
||||
}
|
||||
//adapted from Gocario's PHBank (www.github.com/gocario/phbank)
|
||||
byte[] ccitt16(byte[] data)
|
||||
// --------------------------------------------------
|
||||
{
|
||||
int len = data.Length;
|
||||
UInt16 crc = 0xFFFF;
|
||||
|
||||
for (UInt32 i = 0; i < len; i++)
|
||||
{
|
||||
crc ^= ((UInt16)((data[i] << 8)&0x0000FFFF));
|
||||
|
||||
for (UInt32 j = 0; j < 0x8; j++)
|
||||
{
|
||||
if ((crc & 0x8000) > 0)
|
||||
crc = (UInt16)(((UInt16)((crc << 1)&0x0000FFFF ) ^ 0x1021) &0x0000FFFF);
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return BitConverter.GetBytes(crc);
|
||||
}
|
||||
private void PDR_fix_overworld_checksum()
|
||||
{
|
||||
//Recalculate checksum table's checksum
|
||||
byte[] checktable = new byte[OVERWORLD_BLOCK_SIZE_CRC];
|
||||
Array.Copy(overworldbuffer, 0x00, checktable, 0, OVERWORLD_BLOCK_SIZE_CRC);
|
||||
byte[] crcsum = new byte[2];
|
||||
crcsum = ccitt16(checktable);
|
||||
//MessageBox.Show(BitConverter.ToUInt16(crcsum, 0).ToString());
|
||||
//Put new checksum in buffer
|
||||
Array.Copy(crcsum, 0, overworldbuffer, OVERWORLD_CRC_OFFSET, 2);
|
||||
}
|
||||
private void PDR_injectNsave()
|
||||
{
|
||||
//Put new forest in both save file slots
|
||||
Array.Copy(grottobuffer, 0, savebuffer, GROTTO_START_OFFSET, GROTTO_BLOCK_SIZE);//slot 1
|
||||
Array.Copy(grottobuffer, 0, savebuffer, GROTTO_START_OFFSET+BACKUP_SAVE_OFFSET, GROTTO_BLOCK_SIZE);//slot 2
|
||||
//Overworld
|
||||
Array.Copy(overworldbuffer, 0, savebuffer, OVERWORLD_START_OFFSET, OVERWORLD_BLOCK_SIZE);//slot 1
|
||||
Array.Copy(overworldbuffer, 0, savebuffer, OVERWORLD_START_OFFSET+BACKUP_SAVE_OFFSET, OVERWORLD_BLOCK_SIZE);//slot 2
|
||||
|
||||
//Put it into checksum table
|
||||
Array.Copy(grottobuffer, GROTTO_CRC_OFFSET, savebuffer, CRC_TABLE+GROTTO_CRC_TABLE_OFFSET, 2);
|
||||
Array.Copy(grottobuffer, GROTTO_CRC_OFFSET, savebuffer, CRC_TABLE+GROTTO_CRC_TABLE_OFFSET+BACKUP_SAVE_OFFSET, 2); // Slot 2
|
||||
//MessageBox.Show(BitConverter.ToUInt16(grottobuffer, pos).ToString());
|
||||
|
||||
//Put it into checksum table
|
||||
Array.Copy(overworldbuffer, OVERWORLD_CRC_OFFSET, savebuffer, CRC_TABLE+OVERWORLD_CRC_TABLE_OFFSET, 2);
|
||||
Array.Copy(overworldbuffer, OVERWORLD_CRC_OFFSET, savebuffer, CRC_TABLE+OVERWORLD_CRC_TABLE_OFFSET+BACKUP_SAVE_OFFSET, 2); // Slot 2
|
||||
//MessageBox.Show(BitConverter.ToUInt16(grottobuffer, pos).ToString());
|
||||
|
||||
//Recalculate checksum table's checksum
|
||||
byte[] checktable = new byte[CRC_TABLE_SIZE];
|
||||
Array.Copy(savebuffer, CRC_TABLE, checktable, 0, CRC_TABLE_SIZE);
|
||||
byte[] tablecrcsum = new byte[2];
|
||||
//tablecrcsum = checksum.ComputeChecksumBytes(checktable);
|
||||
tablecrcsum = ccitt16(checktable);
|
||||
//MessageBox.Show(BitConverter.ToUInt16(tablecrcsum, 0).ToString());
|
||||
//Put new checksum in savefile
|
||||
Array.Copy(tablecrcsum, 0, savebuffer, CRC_TABLE_CRC, 2);
|
||||
Array.Copy(tablecrcsum, 0, savebuffer, CRC_TABLE_CRC+BACKUP_SAVE_OFFSET, 2); // Slot 2
|
||||
//Write Data
|
||||
PDR_save_data();
|
||||
}
|
||||
void loadSwarmData()
|
||||
{
|
||||
swarm = overworldbuffer[SWARM_OFFSET];
|
||||
//MessageBox.Show("0x"+(swarm).ToString("X"));
|
||||
swarmbox.SelectedIndex = swarm;
|
||||
}
|
||||
void loadGrottoData()
|
||||
{
|
||||
grotto = grottobuffer[HOLLOW_OFFSET+(Grotto_route.SelectedIndex*2)];
|
||||
grotto_fun = grottobuffer[HOLLOW_OFFSET+(Grotto_route.SelectedIndex*2)+1];
|
||||
last_grotto = grottobuffer[HOLLOW_OFFSET+40];
|
||||
grotto_unknown = grottobuffer[HOLLOW_OFFSET-7];
|
||||
|
||||
unknowngrottobox.Value = grotto_unknown;
|
||||
|
||||
lastgrottobox.SelectedIndex = last_grotto;
|
||||
|
||||
//Group
|
||||
switch (grotto & 0xF0)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x10:
|
||||
normalgrottogroupbox.SelectedIndex = 0;
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x30:
|
||||
normalgrottogroupbox.SelectedIndex = 1;
|
||||
break;
|
||||
case 0x40:
|
||||
case 0x50:
|
||||
normalgrottogroupbox.SelectedIndex = 2;
|
||||
break;
|
||||
case 0x60:
|
||||
case 0x70:
|
||||
normalgrottogroupbox.SelectedIndex = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
//Slot
|
||||
byte check = grotto;
|
||||
while(check > 0x1F)
|
||||
{
|
||||
check -= 0x20;
|
||||
}
|
||||
switch (check & 0x1F)
|
||||
{
|
||||
case 0x00:
|
||||
normalgrottobox.SelectedIndex = 0;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x01:
|
||||
normalgrottobox.SelectedIndex = 0;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x02:
|
||||
normalgrottobox.SelectedIndex = 1;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x03:
|
||||
normalgrottobox.SelectedIndex = 1;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x04:
|
||||
normalgrottobox.SelectedIndex = 2;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x05:
|
||||
normalgrottobox.SelectedIndex = 2;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x06:
|
||||
normalgrottobox.SelectedIndex = 3;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x07:
|
||||
normalgrottobox.SelectedIndex = 3;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x08:
|
||||
normalgrottobox.SelectedIndex = 4;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x09:
|
||||
normalgrottobox.SelectedIndex = 4;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0A:
|
||||
normalgrottobox.SelectedIndex = 5;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0B:
|
||||
normalgrottobox.SelectedIndex = 5;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0C:
|
||||
normalgrottobox.SelectedIndex = 6;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0D:
|
||||
normalgrottobox.SelectedIndex = 6;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0F:
|
||||
normalgrottobox.SelectedIndex = 7;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0E:
|
||||
normalgrottobox.SelectedIndex = 7;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x10:
|
||||
normalgrottobox.SelectedIndex = 8;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x11:
|
||||
normalgrottobox.SelectedIndex = 8;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x12:
|
||||
normalgrottobox.SelectedIndex = 9;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x13:
|
||||
normalgrottobox.SelectedIndex = 9;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x14:
|
||||
normalgrottobox.SelectedIndex = 10;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x15:
|
||||
normalgrottobox.SelectedIndex = 10;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x16:
|
||||
normalgrottobox.SelectedIndex = 11;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x17:
|
||||
normalgrottobox.SelectedIndex = 11;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x18:
|
||||
normalgrottobox.SelectedIndex = 12;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x19:
|
||||
normalgrottobox.SelectedIndex = 12;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1A:
|
||||
normalgrottobox.SelectedIndex = 13;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1B:
|
||||
normalgrottobox.SelectedIndex = 13;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1C:
|
||||
normalgrottobox.SelectedIndex = 14;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1D:
|
||||
normalgrottobox.SelectedIndex = 14;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1E:
|
||||
normalgrottobox.SelectedIndex = 15;
|
||||
normalgrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1F:
|
||||
normalgrottobox.SelectedIndex = 15;
|
||||
normalgrottoavailable.Checked = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
//Group
|
||||
switch (grotto_fun & 0xF0)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x10:
|
||||
fungrottogroupbox.SelectedIndex = 0;
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x30:
|
||||
fungrottogroupbox.SelectedIndex = 1;
|
||||
break;
|
||||
case 0x40:
|
||||
case 0x50:
|
||||
fungrottogroupbox.SelectedIndex = 2;
|
||||
break;
|
||||
case 0x60:
|
||||
case 0x70:
|
||||
fungrottogroupbox.SelectedIndex = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
//Slot
|
||||
check = grotto_fun;
|
||||
while(check > 0x1F)
|
||||
{
|
||||
check -= 0x20;
|
||||
}
|
||||
switch (check & 0x1F)
|
||||
{
|
||||
case 0x00:
|
||||
fungrottobox.SelectedIndex = 0;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x01:
|
||||
fungrottobox.SelectedIndex = 0;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x02:
|
||||
fungrottobox.SelectedIndex = 1;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x03:
|
||||
fungrottobox.SelectedIndex = 1;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x04:
|
||||
fungrottobox.SelectedIndex = 2;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x05:
|
||||
fungrottobox.SelectedIndex = 2;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x06:
|
||||
fungrottobox.SelectedIndex = 3;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x07:
|
||||
fungrottobox.SelectedIndex = 3;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x08:
|
||||
fungrottobox.SelectedIndex = 4;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x09:
|
||||
fungrottobox.SelectedIndex = 4;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0A:
|
||||
fungrottobox.SelectedIndex = 5;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0B:
|
||||
fungrottobox.SelectedIndex = 5;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0C:
|
||||
fungrottobox.SelectedIndex = 6;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0D:
|
||||
fungrottobox.SelectedIndex = 6;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x0F:
|
||||
fungrottobox.SelectedIndex = 7;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x0E:
|
||||
fungrottobox.SelectedIndex = 7;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x10:
|
||||
fungrottobox.SelectedIndex = 8;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x11:
|
||||
fungrottobox.SelectedIndex = 8;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x12:
|
||||
fungrottobox.SelectedIndex = 9;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x13:
|
||||
fungrottobox.SelectedIndex = 9;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x14:
|
||||
fungrottobox.SelectedIndex = 10;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x15:
|
||||
fungrottobox.SelectedIndex = 10;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x16:
|
||||
fungrottobox.SelectedIndex = 11;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x17:
|
||||
fungrottobox.SelectedIndex = 11;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x18:
|
||||
fungrottobox.SelectedIndex = 12;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x19:
|
||||
fungrottobox.SelectedIndex = 12;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1A:
|
||||
fungrottobox.SelectedIndex = 13;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1B:
|
||||
fungrottobox.SelectedIndex = 13;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1C:
|
||||
fungrottobox.SelectedIndex = 14;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1D:
|
||||
fungrottobox.SelectedIndex = 14;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
case 0x1E:
|
||||
fungrottobox.SelectedIndex = 15;
|
||||
fungrottoavailable.Checked = false;
|
||||
break;
|
||||
case 0x1F:
|
||||
fungrottobox.SelectedIndex = 15;
|
||||
fungrottoavailable.Checked = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
void setSwarmData()
|
||||
{
|
||||
overworldbuffer[SWARM_OFFSET] = BitConverter.GetBytes(swarmbox.SelectedIndex)[0];
|
||||
}
|
||||
void setLastGrottoData()
|
||||
{
|
||||
grottobuffer[HOLLOW_OFFSET+40] = BitConverter.GetBytes(lastgrottobox.SelectedIndex)[0];
|
||||
//MessageBox.Show(System.Decimal.ToByte(gendergrottobox.Value).ToString());
|
||||
//grottobuffer[HOLLOW_OFFSET-7] = System.Decimal.ToByte(gendergrottobox.Value);
|
||||
}
|
||||
void setGrottoData()
|
||||
{
|
||||
byte newgrotto = 0x00;
|
||||
//Group
|
||||
switch (normalgrottobox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
newgrotto = 0x00;
|
||||
break;
|
||||
case 1:
|
||||
newgrotto = 0x02;
|
||||
break;
|
||||
case 2:
|
||||
newgrotto = 0x04;
|
||||
break;
|
||||
case 3:
|
||||
newgrotto = 0x06;
|
||||
break;
|
||||
case 4:
|
||||
newgrotto = 0x08;
|
||||
break;
|
||||
case 5:
|
||||
newgrotto = 0x0A;
|
||||
break;
|
||||
case 6:
|
||||
newgrotto = 0x0C;
|
||||
break;
|
||||
case 7:
|
||||
newgrotto = 0x0E;
|
||||
break;
|
||||
case 8:
|
||||
newgrotto = 0x10;
|
||||
break;
|
||||
case 9:
|
||||
newgrotto = 0x12;
|
||||
break;
|
||||
case 10:
|
||||
newgrotto = 0x14;
|
||||
break;
|
||||
case 11:
|
||||
newgrotto = 0x16;
|
||||
break;
|
||||
case 12:
|
||||
newgrotto = 0x18;
|
||||
break;
|
||||
case 13:
|
||||
newgrotto = 0x1A;
|
||||
break;
|
||||
case 14:
|
||||
newgrotto = 0x1C;
|
||||
break;
|
||||
case 15:
|
||||
newgrotto = 0x1E;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(normalgrottoavailable.Checked) newgrotto += 0x01;
|
||||
switch (normalgrottogroupbox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
newgrotto += 0x00;
|
||||
break;
|
||||
case 1:
|
||||
newgrotto += 0x20;
|
||||
break;
|
||||
case 2:
|
||||
newgrotto += 0x20*2;
|
||||
break;
|
||||
case 3:
|
||||
newgrotto += 0x20*3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
grottobuffer[HOLLOW_OFFSET+(Grotto_route.SelectedIndex*2)] = newgrotto;
|
||||
}
|
||||
void setFunGrottoData()
|
||||
{
|
||||
byte newgrotto = 0x00;
|
||||
//Group
|
||||
switch (fungrottobox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
newgrotto = 0x00;
|
||||
break;
|
||||
case 1:
|
||||
newgrotto = 0x02;
|
||||
break;
|
||||
case 2:
|
||||
newgrotto = 0x04;
|
||||
break;
|
||||
case 3:
|
||||
newgrotto = 0x06;
|
||||
break;
|
||||
case 4:
|
||||
newgrotto = 0x08;
|
||||
break;
|
||||
case 5:
|
||||
newgrotto = 0x0A;
|
||||
break;
|
||||
case 6:
|
||||
newgrotto = 0x0C;
|
||||
break;
|
||||
case 7:
|
||||
newgrotto = 0x0E;
|
||||
break;
|
||||
case 8:
|
||||
newgrotto = 0x10;
|
||||
break;
|
||||
case 9:
|
||||
newgrotto = 0x12;
|
||||
break;
|
||||
case 10:
|
||||
newgrotto = 0x14;
|
||||
break;
|
||||
case 11:
|
||||
newgrotto = 0x16;
|
||||
break;
|
||||
case 12:
|
||||
newgrotto = 0x18;
|
||||
break;
|
||||
case 13:
|
||||
newgrotto = 0x1A;
|
||||
break;
|
||||
case 14:
|
||||
newgrotto = 0x1C;
|
||||
break;
|
||||
case 15:
|
||||
newgrotto = 0x1E;
|
||||
break;
|
||||
}
|
||||
if(fungrottoavailable.Checked) newgrotto += 0x01;
|
||||
switch (fungrottogroupbox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
newgrotto += 0x00;
|
||||
break;
|
||||
case 1:
|
||||
newgrotto += 0x20;
|
||||
break;
|
||||
case 2:
|
||||
newgrotto += 0x20*2;
|
||||
break;
|
||||
case 3:
|
||||
newgrotto += 0x20*3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
grottobuffer[HOLLOW_OFFSET+(Grotto_route.SelectedIndex*2)+1] = newgrotto;
|
||||
}
|
||||
void updategenders()
|
||||
{
|
||||
switch(fungrottogroupbox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
if (fungrottobox.SelectedIndex < 15 && fungrottobox.SelectedIndex > 4)
|
||||
{
|
||||
gender5.Text = gender10.Text = "M";
|
||||
gender30.Text = gender60.Text = "F";
|
||||
}else if (fungrottobox.SelectedIndex < 5 && fungrottobox.SelectedIndex > 2)
|
||||
{
|
||||
gender5.Text = "M";
|
||||
gender10.Text = gender30.Text = gender60.Text = "F";
|
||||
}else if (fungrottobox.SelectedIndex < 3)
|
||||
{
|
||||
gender5.Text = gender10.Text = gender30.Text = gender60.Text = "F";
|
||||
}
|
||||
else{
|
||||
gender5.Text = gender10.Text = gender30.Text = gender60.Text = "M";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (fungrottobox.SelectedIndex < 14)
|
||||
{
|
||||
gender5.Text = gender10.Text = gender30.Text = "M";
|
||||
gender60.Text = "F";
|
||||
}else{
|
||||
gender5.Text = gender10.Text = gender30.Text = gender60.Text = "M";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
gender5.Text = gender10.Text = gender30.Text = gender60.Text = "M";
|
||||
break;
|
||||
}
|
||||
}
|
||||
void load_butClick(object sender, EventArgs e)
|
||||
{
|
||||
PDR_get_data();
|
||||
Array.Copy(savebuffer, GROTTO_START_OFFSET, grottobuffer, 0, GROTTO_BLOCK_SIZE);
|
||||
Array.Copy(savebuffer, OVERWORLD_START_OFFSET, overworldbuffer, 0, OVERWORLD_BLOCK_SIZE);
|
||||
Grotto_route.SelectedIndex = 0;
|
||||
loadGrottoData();
|
||||
loadSwarmData();
|
||||
}
|
||||
void SavegamenameTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (savegamename.Text.Length > 0){
|
||||
save_button.Enabled = true;
|
||||
}else{
|
||||
save_button.Enabled = false;
|
||||
}
|
||||
}
|
||||
void Grotto_routeSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
loadGrottoData();
|
||||
if (Grotto_route.SelectedIndex > -1) table_but.Enabled = true;
|
||||
}
|
||||
void FungrottoboxSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
updategenders();
|
||||
}
|
||||
void FungrottoavailableCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
updategenders();
|
||||
}
|
||||
void FungrottogroupboxSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
updategenders();
|
||||
}
|
||||
void Save_buttonClick(object sender, EventArgs e)
|
||||
{
|
||||
setSwarmData();
|
||||
PDR_fix_overworld_checksum();
|
||||
setGrottoData();
|
||||
setFunGrottoData();
|
||||
setLastGrottoData();
|
||||
PDR_fix_grotto_checksum();
|
||||
PDR_injectNsave();
|
||||
}
|
||||
void LastvisitedhelpClick(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("This value stores the last visited grotto. If you saved within a hidden grotto and modify this value, your savegame will warp its location to the selected hidden grotto.\n\nBeware you can get stuck if you don't have some HM moves in your team required to reach the grotto.");
|
||||
}
|
||||
void FungrottohelpClick(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("This value seems to be used to determine if there will be a stunky/glameaow in the noisy/quiet grotto funfest mission. Maybe it is only used on special funfest mission like this one (and the event funfest missions for eevee and its evolutions. On this mission, if funfest value has a pokemon 1, 2 or 3 value, a pokemon will appear, if not, the normal grotto item will appear." +
|
||||
"\n\nThis value is randomly set alongside with the normal grotto value when the grotto is regenerated." +
|
||||
"\n\nUnknown/Not used/Buggy: if normal grotto is unavailable and one of this funfest(?) grotto values is available, a ghost dowsing machine item will appear (dowsing detects an item, but it can't be retrieved)." +
|
||||
"\n\nMore testing needed.");
|
||||
}
|
||||
void ForceFemale_butClick(object sender, EventArgs e)
|
||||
{
|
||||
//Input a setting that will make all grotto pokemon female
|
||||
fungrottogroupbox.SelectedIndex = 0;
|
||||
fungrottobox.SelectedIndex = 0;
|
||||
}
|
||||
void ForceMale_butClick(object sender, EventArgs e)
|
||||
{
|
||||
//Input a setting that will make all grotto pokemon male
|
||||
fungrottogroupbox.SelectedIndex = 3;
|
||||
}
|
||||
void Note_butClick(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Note: if you have saved inside a grotto that has a pokemon and modify the grotto slot to hold an item, after you load the save you can still trigger a battle with the pokemon. In this case you will battle a level 1 Gurdur (which isn't a pokemon available at hidden grottoes).");
|
||||
}
|
||||
|
||||
void Black2table_butClick(object sender, EventArgs e)
|
||||
{
|
||||
Form form = new Form();
|
||||
|
||||
PictureBox pictureBox = new PictureBox();
|
||||
|
||||
pictureBox.Dock = DockStyle.Fill;
|
||||
pictureBox.Image = Image.FromFile("./grotto_tables/b2_"+Grotto_route.SelectedIndex+".png");
|
||||
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
form.Controls.Add(pictureBox);
|
||||
Size size = new Size(720,300);
|
||||
form.Size = size;
|
||||
form.ShowDialog();
|
||||
}
|
||||
void Grotto_helpClick(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageBox.Show(
|
||||
"Open pokemon slots Hidden Grotto spreadsheet in web browser?", "Visit", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk
|
||||
) == DialogResult.Yes)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://sites.google.com/site/pokemonslots/gen-v/hidden-grottos");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
BW2_hiddengrotto_swarm_tool/MainForm.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
31
BW2_hiddengrotto_swarm_tool/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 17/10/2015
|
||||
* Time: 16:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BW2_hiddengrotto_swarm_tool
|
||||
{
|
||||
/// <summary>
|
||||
/// Class with program entry point.
|
||||
/// </summary>
|
||||
internal sealed class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Program entry point.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
31
BW2_hiddengrotto_swarm_tool/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
#region Using directives
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BW Entralink Forest tool")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BW Entralink Forest tool")]
|
||||
[assembly: AssemblyCopyright("Copyright 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
6
BW2_hiddengrotto_swarm_tool/app.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
||||
</startup>
|
||||
</configuration>
|
||||
12
README.md
@@ -1,2 +1,12 @@
|
||||
# BW2_grottoswarm
|
||||
Pokémon Black & White 2 savegame tool to edit hidden grotto and swarming Pokémon
|
||||
BW2 Grotto & Swarm tool 0.1 by suloku '16
|
||||
-------------------------------------
|
||||
|
||||
This is a simple tool that can edit the hidden grotto slots in a Pokémon Black and White 2 savegame. It can also change the gender of the pokémon in the grotto.
|
||||
|
||||
The hidden grotto slot tables are included, thanks to whoever made them in the first place.
|
||||
|
||||
It can also edit the current swarm of the day, but remember the savegame must be on that same day or the swarm will change upon loading the save.
|
||||
|
||||
|
||||
Note: at this moment I'm not really sure if the "funfest" grotto slot is really used in funfest missions, I now think that the data is only used to determine the gender of the pokémon inside the grotto, but since it doesn't affect the functionality of the program, I'm releasing it in its current state.
|
||||
|
||||
BIN
grotto_tables/b2_0.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_1.PNG
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
grotto_tables/b2_10.PNG
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
grotto_tables/b2_11.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_12.PNG
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
grotto_tables/b2_13.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_14.PNG
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
grotto_tables/b2_15.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_16.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_17.PNG
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
grotto_tables/b2_18.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_19.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_2.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_3.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_4.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_5.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_6.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_7.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_8.PNG
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
grotto_tables/b2_9.PNG
Normal file
|
After Width: | Height: | Size: 19 KiB |