├── .gitignore ├── WC3Tool.sln └── WC3Tool ├── EventTool.Designer.cs ├── EventTool.cs ├── EventTool.resx ├── MainScreen.Designer.cs ├── MainScreen.cs ├── MainScreen.resx ├── Program.cs ├── Properties └── AssemblyInfo.cs ├── WC3 ├── Decor_editor.Designer.cs ├── Decor_editor.cs ├── Decor_editor.resx ├── ECB.cs ├── ECB_editor.Designer.cs ├── ECB_editor.cs ├── ECB_editor.resx ├── ECT.cs ├── ECT_editor.Designer.cs ├── ECT_editor.cs ├── ECT_editor.resx ├── ECT_editor_text.cs ├── ECT_pkedit.Designer.cs ├── ECT_pkedit.cs ├── ECT_pkedit.resx ├── FILEIO.cs ├── GiveEggOrg.resx ├── Image │ ├── Cards.resx │ └── Icons.resx ├── ME3.cs ├── ME3_editor.Designer.cs ├── ME3_editor.cs ├── ME3_editor.resx ├── PKHEX │ ├── SpeciesConverter.cs │ └── StringConverter.cs ├── SAV3.cs ├── TV.cs ├── TV_editor.Designer.cs ├── TV_editor.cs ├── TV_editor.resx ├── Tickets.resx ├── WC3_editor.Designer.cs ├── WC3_editor.cs ├── WC3_editor.resx ├── WC3_editor_givegg.Designer.cs ├── WC3_editor_givegg.cs ├── WC3_editor_givegg.resx ├── WC3_editor_giveggExt.Designer.cs ├── WC3_editor_giveggExt.cs ├── WC3_editor_giveggExt.resx ├── WCN_editor.Designer.cs ├── WCN_editor.cs ├── WCN_editor.resx └── wc3.cs ├── WC3Tool.csproj └── app.config /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | 24 | # Visual Studio 2015 cache/options directory 25 | .vs/ 26 | # Uncomment if you have tasks that create the project's static files in wwwroot 27 | #wwwroot/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | # DNX 43 | project.lock.json 44 | artifacts/ 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opendb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | # NuGet v3's project.json files produces more ignoreable files 154 | *.nuget.props 155 | *.nuget.targets 156 | 157 | # Microsoft Azure Build Output 158 | csx/ 159 | *.build.csdef 160 | 161 | # Microsoft Azure Emulator 162 | ecf/ 163 | rcf/ 164 | 165 | # Microsoft Azure ApplicationInsights config file 166 | ApplicationInsights.config 167 | 168 | # Windows Store app package directory 169 | AppPackages/ 170 | BundleArtifacts/ 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # RIA/Silverlight projects 190 | Generated_Code/ 191 | 192 | # Backup & report files from converting an old project file 193 | # to a newer Visual Studio version. Backup files are not needed, 194 | # because we have git ;-) 195 | _UpgradeReport_Files/ 196 | Backup*/ 197 | UpgradeLog*.XML 198 | UpgradeLog*.htm 199 | 200 | # SQL Server files 201 | *.mdf 202 | *.ldf 203 | 204 | # Business Intelligence projects 205 | *.rdl.data 206 | *.bim.layout 207 | *.bim_*.settings 208 | 209 | # Microsoft Fakes 210 | FakesAssemblies/ 211 | 212 | # GhostDoc plugin setting file 213 | *.GhostDoc.xml 214 | 215 | # Node.js Tools for Visual Studio 216 | .ntvs_analysis.dat 217 | 218 | # Visual Studio 6 build log 219 | *.plg 220 | 221 | # Visual Studio 6 workspace options file 222 | *.opt 223 | 224 | # Visual Studio LightSwitch build output 225 | **/*.HTMLClient/GeneratedArtifacts 226 | **/*.DesktopClient/GeneratedArtifacts 227 | **/*.DesktopClient/ModelManifest.xml 228 | **/*.Server/GeneratedArtifacts 229 | **/*.Server/ModelManifest.xml 230 | _Pvt_Extensions 231 | 232 | # Paket dependency manager 233 | .paket/paket.exe 234 | 235 | # FAKE - F# Make 236 | .fake/ 237 | 238 | .idea/ 239 | .DS_Store 240 | -------------------------------------------------------------------------------- /WC3Tool.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.489 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WC3Tool", "WC3Tool\WC3Tool.csproj", "{1E65C335-2DE3-410B-B713-5F7B023106CD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1E65C335-2DE3-410B-B713-5F7B023106CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1E65C335-2DE3-410B-B713-5F7B023106CD}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1E65C335-2DE3-410B-B713-5F7B023106CD}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1E65C335-2DE3-410B-B713-5F7B023106CD}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {89690047-6FB5-4E39-BAAF-5C11B579D6EC} 24 | EndGlobalSection 25 | GlobalSection(MonoDevelopProperties) = preSolution 26 | Policies = $0 27 | $0.DotNetNamingPolicy = $1 28 | $1.DirectoryNamespaceAssociation = PrefixedHierarchical 29 | $0.VersionControlPolicy = $2 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /WC3Tool/EventTool.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/MainScreen.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 127 | 17, 17 128 | 129 | 130 | -------------------------------------------------------------------------------- /WC3Tool/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 28/04/2016 5 | * Time: 21:22 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Windows.Forms; 11 | 12 | namespace WC3Tool 13 | { 14 | /// 15 | /// Class with program entry point. 16 | /// 17 | internal sealed class Program 18 | { 19 | /// 20 | /// Program entry point. 21 | /// 22 | [STAThread] 23 | private static void Main(string[] args) 24 | { 25 | Application.EnableVisualStyles(); 26 | Application.SetCompatibleTextRenderingDefault(false); 27 | Application.Run(new MainScreen()); 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /WC3Tool/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | 6 | #endregion 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("WC3Tool")] 12 | [assembly: AssemblyDescription("")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("WC3Tool")] 16 | [assembly: AssemblyCopyright("Copyright 2019")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // This sets the default COM visibility of types in the assembly to invisible. 21 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // The assembly version has following format : 25 | // 26 | // Major.Minor.Build.Revision 27 | // 28 | // You can specify all the values or you can use the default the Revision and 29 | // Build Numbers by using the '*' as shown below: 30 | [assembly: AssemblyVersion("1.0.*")] 31 | -------------------------------------------------------------------------------- /WC3Tool/WC3/Decor_editor.Designer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 03/05/2016 5 | * Time: 17:34 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | namespace WC3Tool 10 | { 11 | partial class Decor_editor 12 | { 13 | /// 14 | /// Designer variable used to keep track of non-visual components. 15 | /// 16 | private System.ComponentModel.IContainer components = null; 17 | private System.Windows.Forms.ComboBox decortypebox; 18 | private System.Windows.Forms.Label label1; 19 | private System.Windows.Forms.NumericUpDown numericUpDown1; 20 | private System.Windows.Forms.Label label2; 21 | private System.Windows.Forms.ComboBox decorationbox; 22 | private System.Windows.Forms.Label Decoration; 23 | private System.Windows.Forms.Button save_but; 24 | private System.Windows.Forms.Button add_but; 25 | private System.Windows.Forms.Button del_but; 26 | 27 | /// 28 | /// Disposes resources used by the form. 29 | /// 30 | /// true if managed resources should be disposed; otherwise, false. 31 | protected override void Dispose(bool disposing) 32 | { 33 | if (disposing) { 34 | if (components != null) { 35 | components.Dispose(); 36 | } 37 | } 38 | base.Dispose(disposing); 39 | } 40 | 41 | /// 42 | /// This method is required for Windows Forms designer support. 43 | /// Do not change the method contents inside the source code editor. The Forms designer might 44 | /// not be able to load this method if it was changed manually. 45 | /// 46 | private void InitializeComponent() 47 | { 48 | this.decortypebox = new System.Windows.Forms.ComboBox(); 49 | this.label1 = new System.Windows.Forms.Label(); 50 | this.label2 = new System.Windows.Forms.Label(); 51 | this.decorationbox = new System.Windows.Forms.ComboBox(); 52 | this.Decoration = new System.Windows.Forms.Label(); 53 | this.save_but = new System.Windows.Forms.Button(); 54 | this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); 55 | this.add_but = new System.Windows.Forms.Button(); 56 | this.del_but = new System.Windows.Forms.Button(); 57 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); 58 | this.SuspendLayout(); 59 | // 60 | // decortypebox 61 | // 62 | this.decortypebox.FormattingEnabled = true; 63 | this.decortypebox.Items.AddRange(new object[] { 64 | "Desk", 65 | "Chair", 66 | "Plant", 67 | "Ornament", 68 | "Mat", 69 | "Poster", 70 | "Doll", 71 | "Cushion"}); 72 | this.decortypebox.Location = new System.Drawing.Point(9, 38); 73 | this.decortypebox.Name = "decortypebox"; 74 | this.decortypebox.Size = new System.Drawing.Size(297, 21); 75 | this.decortypebox.TabIndex = 0; 76 | this.decortypebox.SelectedIndexChanged += new System.EventHandler(this.DecortypeboxSelectedIndexChanged); 77 | // 78 | // label1 79 | // 80 | this.label1.Location = new System.Drawing.Point(9, 16); 81 | this.label1.Name = "label1"; 82 | this.label1.Size = new System.Drawing.Size(100, 19); 83 | this.label1.TabIndex = 1; 84 | this.label1.Text = "Decoration type"; 85 | // 86 | // label2 87 | // 88 | this.label2.Location = new System.Drawing.Point(9, 73); 89 | this.label2.Name = "label2"; 90 | this.label2.Size = new System.Drawing.Size(100, 13); 91 | this.label2.TabIndex = 3; 92 | this.label2.Text = "Slot"; 93 | // 94 | // decorationbox 95 | // 96 | this.decorationbox.FormattingEnabled = true; 97 | this.decorationbox.Items.AddRange(new object[] { 98 | "Empty", 99 | "Small Desk", 100 | "Pokémon Desk", 101 | "Heavy Desk", 102 | "Ragged Desk", 103 | "Comfort Desk", 104 | "Pretty Desk", 105 | "Brick Desk", 106 | "Camp Desk", 107 | "Hard Desk"}); 108 | this.decorationbox.Location = new System.Drawing.Point(135, 88); 109 | this.decorationbox.Name = "decorationbox"; 110 | this.decorationbox.Size = new System.Drawing.Size(171, 21); 111 | this.decorationbox.TabIndex = 4; 112 | this.decorationbox.SelectedIndexChanged += new System.EventHandler(this.DecorationboxSelectedIndexChanged); 113 | // 114 | // Decoration 115 | // 116 | this.Decoration.Location = new System.Drawing.Point(135, 73); 117 | this.Decoration.Name = "Decoration"; 118 | this.Decoration.Size = new System.Drawing.Size(100, 13); 119 | this.Decoration.TabIndex = 5; 120 | this.Decoration.Text = "Decoration"; 121 | // 122 | // save_but 123 | // 124 | this.save_but.Location = new System.Drawing.Point(109, 130); 125 | this.save_but.Name = "save_but"; 126 | this.save_but.Size = new System.Drawing.Size(75, 23); 127 | this.save_but.TabIndex = 6; 128 | this.save_but.Text = "Save"; 129 | this.save_but.UseVisualStyleBackColor = true; 130 | this.save_but.Click += new System.EventHandler(this.Save_butClick); 131 | // 132 | // numericUpDown1 133 | // 134 | this.numericUpDown1.Location = new System.Drawing.Point(9, 89); 135 | this.numericUpDown1.Minimum = new decimal(new int[] { 136 | 1, 137 | 0, 138 | 0, 139 | 0}); 140 | this.numericUpDown1.Name = "numericUpDown1"; 141 | this.numericUpDown1.Size = new System.Drawing.Size(120, 20); 142 | this.numericUpDown1.TabIndex = 2; 143 | this.numericUpDown1.Value = new decimal(new int[] { 144 | 1, 145 | 0, 146 | 0, 147 | 0}); 148 | this.numericUpDown1.ValueChanged += new System.EventHandler(this.NumericUpDown1ValueChanged); 149 | // 150 | // add_but 151 | // 152 | this.add_but.Location = new System.Drawing.Point(312, 73); 153 | this.add_but.Name = "add_but"; 154 | this.add_but.Size = new System.Drawing.Size(37, 23); 155 | this.add_but.TabIndex = 7; 156 | this.add_but.Text = "Add"; 157 | this.add_but.UseVisualStyleBackColor = true; 158 | this.add_but.Click += new System.EventHandler(this.Add_butClick); 159 | // 160 | // del_but 161 | // 162 | this.del_but.Location = new System.Drawing.Point(312, 102); 163 | this.del_but.Name = "del_but"; 164 | this.del_but.Size = new System.Drawing.Size(37, 23); 165 | this.del_but.TabIndex = 8; 166 | this.del_but.Text = "Del"; 167 | this.del_but.UseVisualStyleBackColor = true; 168 | this.del_but.Click += new System.EventHandler(this.Del_butClick); 169 | // 170 | // Decor_editor 171 | // 172 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 173 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 174 | this.ClientSize = new System.Drawing.Size(366, 165); 175 | this.Controls.Add(this.del_but); 176 | this.Controls.Add(this.add_but); 177 | this.Controls.Add(this.save_but); 178 | this.Controls.Add(this.Decoration); 179 | this.Controls.Add(this.decorationbox); 180 | this.Controls.Add(this.label2); 181 | this.Controls.Add(this.numericUpDown1); 182 | this.Controls.Add(this.label1); 183 | this.Controls.Add(this.decortypebox); 184 | this.Name = "Decor_editor"; 185 | this.Text = "Decoration Inventory Editor"; 186 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); 187 | this.ResumeLayout(false); 188 | 189 | } 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /WC3Tool/WC3/Decor_editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 03/05/2016 5 | * Time: 17:34 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Windows.Forms; 11 | 12 | 13 | namespace WC3Tool 14 | { 15 | /// 16 | /// Description of Decor_editor. 17 | /// 18 | public partial class Decor_editor : Form 19 | { 20 | byte[] decorbuff; 21 | SAV3 sav3file; 22 | public string savfilter = MainScreen.savfilter; 23 | 24 | public Decor_editor(SAV3 save) 25 | { 26 | // 27 | // The InitializeComponent() call is required for Windows Forms designer support. 28 | // 29 | InitializeComponent(); 30 | sav3file = save; 31 | decorbuff = sav3file.get_decorations(); 32 | 33 | decortypebox.SelectedIndex = 0; 34 | numericUpDown1.Maximum = slots_max[decortypebox.SelectedIndex]; 35 | decorationbox.SelectedIndex = 0; 36 | 37 | load_decor(); 38 | 39 | // 40 | // TODO: Add constructor code after the InitializeComponent() call. 41 | // 42 | } 43 | 44 | void del_item() 45 | { 46 | int i; 47 | int offset = 0; 48 | for (i=0; i 2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECB_editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 09/05/2016 5 | * Time: 0:59 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Windows.Forms; 11 | 12 | namespace WC3Tool 13 | { 14 | /// 15 | /// Description of ECB_editor. 16 | /// 17 | public partial class ECB_editor : Form 18 | { 19 | public ECB_editor() 20 | { 21 | // 22 | // The InitializeComponent() call is required for Windows Forms designer support. 23 | // 24 | InitializeComponent(); 25 | hap200.Minimum = -127; 26 | hap100.Minimum = -127; 27 | happ0.Minimum = -127; 28 | tr6_val.Minimum = 0; 29 | tr6_val.Maximum = 255; 30 | 31 | // 32 | // TODO: Add constructor code after the InitializeComponent() call. 33 | // 34 | } 35 | public string berryfilter = "e-card Berry file|*.ecb|All Files (*.*)|*.*"; 36 | public string berry_sp_filter = "All Files (*.*)|*.*"; 37 | public byte[] ecbbuffer; 38 | public byte[] spritebuf; 39 | public byte[] paletebuf; 40 | public static ECB ecbfile; 41 | 42 | void Load_ECB(string path) 43 | { 44 | int filesize = FileIO.load_file(ref ecbbuffer, ref path, berryfilter); 45 | if( filesize == ECB.SIZE_ECB ) 46 | { 47 | ecb_path.Text = path; 48 | ecbfile = new ECB(ecbbuffer); 49 | 50 | update_ecbData(); 51 | 52 | save_ecb_but.Enabled = true; 53 | palette_export_but.Enabled = true; 54 | palette_import_but.Enabled = true; 55 | sprite_export_but.Enabled = true; 56 | sprite_import_but.Enabled = true; 57 | 58 | }else{ 59 | MessageBox.Show("Invalid file size."); 60 | } 61 | } 62 | 63 | void Load_ecb_butClick(object sender, EventArgs e) 64 | { 65 | Load_ECB(null); 66 | } 67 | void Save_ecb_butClick(object sender, EventArgs e) 68 | { 69 | set_ecbData(); 70 | ecbfile.fix_berry_checksum(); 71 | //if (ecbfile.Edited) 72 | FileIO.save_data(ecbfile.Data, berryfilter); 73 | //else MessageBox.Show("Save has not been edited"); 74 | } 75 | void update_ecbData() 76 | { 77 | name.Text = ecbfile.NAME; 78 | firm_box.SelectedIndex = ecbfile.FIRMNESS-1; 79 | size.Value = ecbfile.SIZE; 80 | yield_max.Value = ecbfile.YIELD_MAX; 81 | yield_min.Value = ecbfile.YIELD_MIN; 82 | growth.Value = ecbfile.GROWTH; 83 | spicy.Value = ecbfile.SPICY; 84 | dry.Value = ecbfile.DRY; 85 | sweet.Value = ecbfile.SWEET; 86 | bitter.Value = ecbfile.BITTER; 87 | sour.Value = ecbfile.SOUR; 88 | smooth.Value = ecbfile.SMOOTH; 89 | 90 | desc1.Text = ecbfile.DESC_1; 91 | desc2.Text = ecbfile.DESC_2; 92 | 93 | held.Value = ecbfile.HITEM; 94 | 95 | heal_burn.Checked = ecbfile.TR_3_clearBurn; 96 | heal_confu.Checked = ecbfile.TR_3_clearConf; 97 | heal_ice.Checked = ecbfile.TR_3_clearIce; 98 | heal_inf.Checked = ecbfile.TR_0_healinfatuation; 99 | heal_para.Checked = ecbfile.TR_3_clearPar; 100 | heal_poison.Checked = ecbfile.TR_3_clearPoison; 101 | heal_sleep.Checked = ecbfile.TR_3_clearSleep; 102 | 103 | guard.Checked = ecbfile.TR_3_guardspec; 104 | lvlup.Checked = ecbfile.TR_3_lvlUP; 105 | 106 | firstpoke.Checked = ecbfile.TR_0_firstpkm; 107 | 108 | direhit.Value = ecbfile.TR_0_direhit; 109 | atkup.Value = ecbfile.TR_0_attackUP; 110 | defup.Value = ecbfile.TR_1_defUP; 111 | speedup.Value = ecbfile.TR_1_speedUP; 112 | spatkup.Value = ecbfile.TR_2_espUP; 113 | accurup.Value = ecbfile.TR_2_accUP; 114 | 115 | ev_hp.Checked = ecbfile.TR_4_hpEVUP; 116 | ev_atk.Checked = ecbfile.TR_4_atkEVUP; 117 | ev_def.Checked = ecbfile.TR_5_defEVUP; 118 | ev_speed.Checked = ecbfile.TR_5_spEVUP; 119 | ev_speatk.Checked = ecbfile.TR_5_spatkEVUP; 120 | ev_spedef.Checked = ecbfile.TR_5_spdefEVUP; 121 | 122 | if (ecbfile.HPRecovery != 0) 123 | tr6_val.Value = ecbfile.HPRecovery; 124 | else if (ecbfile.PPRecovery != 0) 125 | tr6_val.Value = ecbfile.PPRecovery; 126 | else if (ecbfile.EVchange != 0) 127 | tr6_val.Value = ecbfile.EVchange; 128 | //else if (ecbfile.HPRecovery == 0 && ecbfile.EVchange == 0 && ecbfile.PPRecovery == 0) 129 | // tr6_val.Enabled = false; 130 | 131 | heal_hp.Checked = ecbfile.TR_4_healHP; 132 | heal_pp.Checked = ecbfile.TR_4_healPP; 133 | selectedatk.Checked = ecbfile.TR_4_onlyatack; 134 | maxppUP.Checked = ecbfile.TR_4_maxPPUP; 135 | revive.Checked = ecbfile.TR_4_revive; 136 | stone.Checked = ecbfile.TR_4_stone; 137 | ppup.Checked = ecbfile.TR_5_ppMax; 138 | 139 | happy200.Checked = ecbfile.TR_5_happy200; 140 | happy100.Checked = ecbfile.TR_5_happy100; 141 | happy0.Checked = ecbfile.TR_5_happy0; 142 | 143 | if (happy200.Checked) 144 | hap200.Value = ecbfile.Happy200; 145 | else 146 | hap200.Value = 0; 147 | if (happy100.Checked) 148 | hap100.Value = ecbfile.Happy100; 149 | else 150 | hap100.Value = 0; 151 | if (happy0.Checked) 152 | happ0.Value = ecbfile.Happy0; 153 | else 154 | happ0.Value = 0; 155 | 156 | } 157 | 158 | void set_ecbData() 159 | { 160 | ecbfile.NAME = name.Text; 161 | ecbfile.FIRMNESS = (byte)(firm_box.SelectedIndex+1); 162 | ecbfile.SIZE = (UInt16) size.Value; 163 | ecbfile.YIELD_MAX = (byte)yield_max.Value; 164 | ecbfile.YIELD_MIN = (byte)yield_min.Value; 165 | ecbfile.GROWTH = (byte)growth.Value; 166 | ecbfile.SPICY = (byte)spicy.Value; 167 | ecbfile.DRY = (byte)dry.Value; 168 | ecbfile.SWEET = (byte)sweet.Value; 169 | ecbfile.BITTER = (byte)bitter.Value; 170 | ecbfile.SOUR = (byte)sour.Value; 171 | ecbfile.SMOOTH = (byte)smooth.Value; 172 | 173 | ecbfile.DESC_1 = desc1.Text; 174 | ecbfile.DESC_2 = desc2.Text; 175 | 176 | ecbfile.HITEM = (byte) held.Value; 177 | 178 | ecbfile.TR_3_clearBurn = heal_burn.Checked; 179 | ecbfile.TR_3_clearConf = heal_confu.Checked ; 180 | ecbfile.TR_3_clearIce = heal_ice.Checked; 181 | ecbfile.TR_0_healinfatuation = heal_inf.Checked; 182 | ecbfile.TR_3_clearPar = heal_para.Checked; 183 | ecbfile.TR_3_clearPoison = heal_poison.Checked; 184 | ecbfile.TR_3_clearSleep = heal_sleep.Checked; 185 | 186 | ecbfile.TR_3_guardspec = guard.Checked; 187 | ecbfile.TR_3_lvlUP = lvlup.Checked; 188 | 189 | ecbfile.TR_0_firstpkm = firstpoke.Checked; 190 | 191 | ecbfile.TR_0_direhit = (int)direhit.Value; 192 | ecbfile.TR_0_attackUP = (int)atkup.Value; 193 | ecbfile.TR_1_defUP = (int)defup.Value; 194 | ecbfile.TR_1_speedUP = (int)speedup.Value; 195 | ecbfile.TR_2_espUP = (int)spatkup.Value; 196 | ecbfile.TR_2_accUP = (int)accurup.Value; 197 | 198 | ecbfile.TR_4_hpEVUP = ev_hp.Checked; 199 | ecbfile.TR_4_atkEVUP = ev_atk.Checked; 200 | ecbfile.TR_5_defEVUP = ev_def.Checked; 201 | ecbfile.TR_5_spEVUP = ev_speed.Checked; 202 | ecbfile.TR_5_spatkEVUP = ev_speatk.Checked; 203 | ecbfile.TR_5_spdefEVUP = ev_spedef.Checked; 204 | 205 | ecbfile.TR_4_healHP = heal_hp.Checked; 206 | ecbfile.TR_4_healPP = heal_pp.Checked; 207 | ecbfile.TR_4_onlyatack = selectedatk.Checked; 208 | ecbfile.TR_4_maxPPUP = maxppUP.Checked; 209 | ecbfile.TR_4_revive = revive.Checked; 210 | ecbfile.TR_4_stone = stone.Checked; 211 | ecbfile.TR_5_ppMax = ppup.Checked; 212 | 213 | //Only put the first value found 214 | if (heal_hp.Checked) 215 | ecbfile.HPRecovery = (byte)tr6_val.Value; 216 | else if (heal_pp.Checked) 217 | ecbfile.PPRecovery = (byte)tr6_val.Value; 218 | else if (ev_hp.Checked || ev_atk.Checked || ev_def.Checked || ev_speed.Checked || ev_speatk.Checked || ev_spedef.Checked) 219 | ecbfile.EVchange = (sbyte)tr6_val.Value; 220 | 221 | ecbfile.TR_5_happy200 = happy200.Checked; 222 | ecbfile.TR_5_happy100 = happy100.Checked; 223 | ecbfile.TR_5_happy0 = happy0.Checked; 224 | 225 | ecbfile.Happy200 = (sbyte)hap200.Value; 226 | ecbfile.Happy100 = (sbyte)hap100.Value; 227 | ecbfile.Happy0 = (sbyte)happ0.Value; 228 | } 229 | void Held_helpClick(object sender, EventArgs e) 230 | { 231 | MessageBox.Show("Known values:\n00: No effect\n04: Cures poison (Drash Berry)\n05: Cures burn (Japanese Yago Berry)\n06: Cures freeze (Pumkin Berry)\n08: Cures confusion (Japanese Touga Berry)\n23: Restores a lowered stat (Japanese Ginema Berry)\n28: Cures infatuation (Eggant Berry)"); 232 | } 233 | void Sprite_export_butClick(object sender, EventArgs e) 234 | { 235 | FileIO.save_data(ecbfile.get_full_sprite(), berry_sp_filter); 236 | } 237 | void Sprite_import_butClick(object sender, EventArgs e) 238 | { 239 | string path = null; 240 | int filesize = FileIO.load_file(ref spritebuf, ref path, berry_sp_filter); 241 | if( filesize == ECB.SIZE_SPRITE+ECB.SIZE_PALETTE) 242 | { 243 | ecbfile.set_full_sprite(spritebuf); 244 | MessageBox.Show("Berry sprite injected."); 245 | 246 | }else if (filesize == -1){ 247 | ; 248 | }else{ 249 | MessageBox.Show("Invalid file size."); 250 | } 251 | } 252 | void Palette_import_butClick(object sender, EventArgs e) 253 | { 254 | string path = null; 255 | int filesize = FileIO.load_file(ref paletebuf, ref path, berry_sp_filter); 256 | if( filesize == ECB.SIZE_PALETTE) 257 | { 258 | ecbfile.set_palette(paletebuf); 259 | MessageBox.Show("Berry palette injected."); 260 | 261 | }else if (filesize == -1){ 262 | ; 263 | }else{ 264 | MessageBox.Show("Invalid file size."); 265 | } 266 | } 267 | void Palette_export_butClick(object sender, EventArgs e) 268 | { 269 | FileIO.save_data(ecbfile.get_palette(), berry_sp_filter); 270 | } 271 | void Sprite_helpClick(object sender, EventArgs e) 272 | { 273 | MessageBox.Show("To edit the berry sprite you may use \"Nameless Sprite Editor (NSE) 2.1 beta\".\nSave the berry sprite as \".gba\" file and open in NSE with \"Load ROM\" option, then click navigate and input this values:\n\tImage offset: 20\n\tPalette ofsset: 0\n\tWidth: 6\n\tHeight: 6\n\nThen click open and edit the sprite. To save it simply use file->save or control+S (palette can be edited too, use the palette editor's save button to save it).\n\nTo inject the berry sprite you can simply import the modified berry \".gba\" file"); 274 | } 275 | void Jap_encodingCheckedChanged(object sender, EventArgs e) 276 | { 277 | ecbfile.isjap = jap_encoding.Checked; 278 | name.Text = ecbfile.NAME; 279 | desc1.Text = ecbfile.DESC_1; 280 | desc2.Text = ecbfile.DESC_2; 281 | } 282 | void PphelpClick(object sender, EventArgs e) 283 | { 284 | MessageBox.Show("Healing HP and PP are mutually exclusive, you cannot heal PP and HP at the same time. HP takes precedence over PP if both are set. "); 285 | } 286 | void Modifier_helpClick(object sender, EventArgs e) 287 | { 288 | MessageBox.Show("PP restoring items have a maximum of 127.\nFor health restoration, 255 means max health, 254 means half max health, 253 is used by rare candy (only increase with level up).\nFor EV items, 0-127 increases EV, 128-255 decreases EV (128 is -1, 255 is -127)."); 289 | } 290 | void NoteClick(object sender, EventArgs e) 291 | { 292 | MessageBox.Show("Keep in mind that there are incompatibilities between flags. For example you can't make an HP restoring berry that also levels up a pokémon and expect it to be usable in battle, since a level up item can only be used from the bag."); 293 | } 294 | 295 | void ECB_editorDragEnter(object sender, DragEventArgs e) 296 | { 297 | e.Effect = DragDropEffects.All; 298 | } 299 | void ECB_editorDragDrop(object sender, DragEventArgs e) 300 | { 301 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); 302 | Load_ECB(files[0]); 303 | } 304 | } 305 | } 306 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECB_editor.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECT.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 03/05/2016 5 | * Time: 20:54 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | 12 | namespace WC3Tool 13 | { 14 | /// 15 | /// Description of ECT. 16 | /// 17 | public class ECT 18 | { 19 | public const int SIZE_ECT = 188; 20 | 21 | // Global Settings 22 | // Save Data Attributes 23 | public byte[] Data; 24 | public bool Edited; 25 | public readonly bool Exportable; 26 | public readonly byte[] BAK; 27 | public string FileName, FilePath; 28 | public ECT(byte[] data) 29 | { 30 | Data = (byte[])(data ?? new byte[SIZE_ECT]).Clone(); 31 | BAK = (byte[])Data.Clone(); 32 | Exportable = !Data.SequenceEqual(new byte[Data.Length]); 33 | } 34 | public byte[] getData(int Offset, int Length) 35 | { 36 | return Data.Skip(Offset).Take(Length).ToArray(); 37 | } 38 | public void setData(byte[] input, int Offset) 39 | { 40 | input.CopyTo(Data, Offset); 41 | Edited = true; 42 | } 43 | public static UInt32 ect_checksum(int length, byte[] Data) 44 | { 45 | UInt32 Chk = 0; 46 | int i; 47 | length = length>>2; 48 | Chk=0; 49 | for(i=0; i', 76 | ':', 'Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#' 77 | }; 78 | public string gba2text(byte[] input) 79 | { 80 | string texto; 81 | texto = ""; 82 | foreach (byte value in input) 83 | { 84 | if (value == 0xFF) 85 | break; 86 | string newtext = texto + SYMBOL[value]; 87 | texto = newtext; 88 | } 89 | return texto; 90 | } 91 | public byte[] text2gba(string input, int len) 92 | { 93 | byte[] gbatext = new byte[len]; 94 | byte i = 0; 95 | int count = 0; 96 | foreach (char value in input) 97 | { 98 | 99 | for(i=0;i<0xFF;i++) 100 | { 101 | if (value == SYMBOL[i]) 102 | { 103 | if (i==0) 104 | { 105 | gbatext[count] = 0; 106 | break; 107 | } 108 | 109 | gbatext[count] = i; 110 | break; 111 | } 112 | 113 | } 114 | 115 | //MessageBox.Show(gbatext[count].ToString("X")); 116 | count++; 117 | } 118 | if (count < len) 119 | gbatext[count] = 0xFF; 120 | return gbatext; 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECT_editor.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECT_pkedit.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 04/05/2016 5 | * Time: 13:42 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | using System.Windows.Forms; 12 | 13 | namespace WC3Tool 14 | { 15 | /// 16 | /// Description of ECT_pkedit. 17 | /// 18 | public partial class ECT_pkedit : Form 19 | { 20 | public ECT_pkedit(int index) 21 | { 22 | // 23 | // The InitializeComponent() call is required for Windows Forms designer support. 24 | // 25 | InitializeComponent(); 26 | pid.Maximum = 0xFFFFFFFF; 27 | pk = 0x34+index*44; 28 | populate(); 29 | 30 | // 31 | // TODO: Add constructor code after the InitializeComponent() call. 32 | // 33 | } 34 | int pk; 35 | //byte nickname; 36 | 37 | public UInt32 IV32 { get { return BitConverter.ToUInt32(ECT_editor.ectfile.Data, pk+0x18); } set { BitConverter.GetBytes((UInt32)value).CopyTo(ECT_editor.ectfile.Data, 0x18); } } 38 | public int IV_HP { get { return (int)(IV32 >> 00) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 00)) | (uint)((value > 31 ? 31 : value) << 00)); } } 39 | public int IV_ATK { get { return (int)(IV32 >> 05) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 05)) | (uint)((value > 31 ? 31 : value) << 05)); } } 40 | public int IV_DEF { get { return (int)(IV32 >> 10) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 10)) | (uint)((value > 31 ? 31 : value) << 10)); } } 41 | public int IV_SPE { get { return (int)(IV32 >> 15) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 15)) | (uint)((value > 31 ? 31 : value) << 15)); } } 42 | public int IV_SPA { get { return (int)(IV32 >> 20) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 20)) | (uint)((value > 31 ? 31 : value) << 20)); } } 43 | public int IV_SPD { get { return (int)(IV32 >> 25) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 25)) | (uint)((value > 31 ? 31 : value) << 25)); } } 44 | public int IV_Ability { get { return (int)((IV32 >> 31) & 1); } set { IV32 = (IV32 & 0x7FFFFFFF) | (value == 1 ? 0x80000000 : 0); } } 45 | 46 | public byte PPUP { get { return ECT_editor.ectfile.Data[pk+0xD]; } set { ECT_editor.ectfile.Data[pk+0xD] = value; } } 47 | public int PPUP_1 { get { return (int)(PPUP >> 00) & 0x03; } set { PPUP = (byte)((PPUP & ~(0x03 << 00)) | (byte)((value > 3 ? 3 : value) << 00)); } } 48 | public int PPUP_2 { get { return (int)(PPUP >> 02) & 0x03; } set { PPUP = (byte)((PPUP & ~(0x03 << 02)) | (byte)((value > 3 ? 3 : value) << 02)); } } 49 | public int PPUP_3 { get { return (int)(PPUP >> 04) & 0x03; } set { PPUP = (byte)((PPUP & ~(0x03 << 04)) | (byte)((value > 3 ? 3 : value) << 04)); } } 50 | public int PPUP_4 { get { return (int)(PPUP >> 06) & 0x03; } set { PPUP = (byte)((PPUP & ~(0x03 << 06)) | (byte)((value > 3 ? 3 : value) << 06)); } } 51 | 52 | void populate() 53 | { 54 | item_box.SelectedIndex = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x2, 2), 0); 55 | namebox.Text = StringConverter.GetG3Str(ECT_editor.ectfile.getData(pk+0x20, 11), jap_check.Checked); 56 | 57 | move1.SelectedIndex = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x4, 2), 0); 58 | move2.SelectedIndex = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x6, 2), 0); 59 | move3.SelectedIndex = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x8, 2), 0); 60 | move4.SelectedIndex = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0xA, 2), 0); 61 | 62 | pp1.Value = PPUP_1; 63 | pp2.Value = PPUP_2; 64 | pp3.Value = PPUP_3; 65 | pp4.Value = PPUP_4; 66 | 67 | level.Value = ECT_editor.ectfile.Data[pk+0x0C]; 68 | friendship.Value = ECT_editor.ectfile.Data[pk+0x2B]; 69 | 70 | otid.Value = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x14, 2), 0); 71 | otsid.Value = BitConverter.ToUInt16( ECT_editor.ectfile.getData(pk+0x16, 2), 0); 72 | 73 | pid.Value = BitConverter.ToUInt32( ECT_editor.ectfile.getData(pk+0x1c, 4), 0); 74 | 75 | ev1.Value = ECT_editor.ectfile.Data[pk+0x0E]; 76 | ev2.Value = ECT_editor.ectfile.Data[pk+0x0F]; 77 | ev3.Value = ECT_editor.ectfile.Data[pk+0x10]; 78 | ev4.Value = ECT_editor.ectfile.Data[pk+0x11]; 79 | ev5.Value = ECT_editor.ectfile.Data[pk+0x12]; 80 | ev6.Value = ECT_editor.ectfile.Data[pk+0x13]; 81 | 82 | iv1.Value = IV_HP; 83 | iv2.Value = IV_ATK; 84 | iv3.Value = IV_DEF; 85 | iv4.Value = IV_SPE; 86 | iv5.Value = IV_SPA; 87 | iv6.Value = IV_SPD; 88 | 89 | ability.Value = IV_Ability; 90 | 91 | } 92 | 93 | void save_edits() 94 | { 95 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)item_box.SelectedIndex).ToArray(),pk+0x2); 96 | 97 | ECT_editor.ectfile.setData(StringConverter.SetG3Str(namebox.Text, jap_check.Checked), pk+0x20); 98 | 99 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)move1.SelectedIndex).ToArray(),pk+0x4); 100 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)move2.SelectedIndex).ToArray(),pk+0x6); 101 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)move3.SelectedIndex).ToArray(),pk+0x8); 102 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)move4.SelectedIndex).ToArray(),pk+0xA); 103 | 104 | PPUP_1 = (int)pp1.Value; 105 | PPUP_2 = (int)pp1.Value; 106 | PPUP_3 = (int)pp1.Value; 107 | PPUP_4 = (int)pp1.Value; 108 | 109 | ECT_editor.ectfile.Data[pk+0x0C] = (byte) level.Value; 110 | ECT_editor.ectfile.Data[pk+0x2B] = (byte) friendship.Value; 111 | 112 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)otid.Value).ToArray(), pk+0x14); 113 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt16)otsid.Value).ToArray(), pk+0x16); 114 | 115 | ECT_editor.ectfile.setData(BitConverter.GetBytes((UInt32)pid.Value).ToArray(), pk+0x1c); 116 | 117 | 118 | ECT_editor.ectfile.Data[pk+0x0E] = (byte) ev1.Value; 119 | ECT_editor.ectfile.Data[pk+0x0F] = (byte) ev2.Value; 120 | ECT_editor.ectfile.Data[pk+0x10] = (byte) ev3.Value; 121 | ECT_editor.ectfile.Data[pk+0x11] = (byte) ev4.Value; 122 | ECT_editor.ectfile.Data[pk+0x12] = (byte) ev5.Value; 123 | ECT_editor.ectfile.Data[pk+0x13] = (byte) ev6.Value; 124 | 125 | 126 | IV_HP = (int)iv1.Value; 127 | IV_ATK = (int)iv1.Value; 128 | IV_DEF = (int)iv3.Value; 129 | IV_SPE = (int)iv4.Value; 130 | IV_SPA = (int)iv5.Value; 131 | IV_SPD = (int)iv6.Value; 132 | 133 | IV_Ability = (int)ability.Value; 134 | 135 | } 136 | 137 | void CancelClick(object sender, EventArgs e) 138 | { 139 | Close(); 140 | } 141 | void SaveClick(object sender, EventArgs e) 142 | { 143 | save_edits(); 144 | Close(); 145 | } 146 | void Jap_checkCheckedChanged(object sender, EventArgs e) 147 | { 148 | namebox.Text = StringConverter.GetG3Str(ECT_editor.ectfile.getData(pk+0x20, 11), jap_check.Checked); 149 | } 150 | 151 | } 152 | 153 | } 154 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ECT_pkedit.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/FILEIO.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 28/04/2016 5 | * Time: 21:23 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using System.IO; 13 | 14 | namespace WC3Tool 15 | { 16 | /// 17 | /// Description of FILEIO. 18 | /// 19 | public class FileIO 20 | { 21 | /// 22 | /// Reads data into a complete array, throwing an EndOfStreamException 23 | /// if the stream runs out of data first, or if an IOException 24 | /// naturally occurs. 25 | /// 26 | /// The stream to read data from 27 | /// The array to read bytes into. The array 28 | /// will be completely filled from the stream, so an appropriate 29 | /// size must be given. 30 | private static void ReadWholeArray(Stream stream, ref byte[] data) 31 | { 32 | int offset = 0; 33 | int remaining = data.Length; 34 | while (remaining > 0) 35 | { 36 | int read = stream.Read(data, offset, remaining); 37 | if (read <= 0) 38 | throw new EndOfStreamException 39 | ($"End of stream reached with {remaining} bytes left to read"); 40 | remaining -= read; 41 | offset += read; 42 | } 43 | } 44 | 45 | private static void _read_data(ref byte[] buffer, string path) 46 | { 47 | FileStream saveFile; 48 | saveFile = new FileStream(path, FileMode.Open); 49 | if (saveFile.Length < 1) 50 | { 51 | MessageBox.Show("Invalid file length", "Error"); 52 | return; 53 | } 54 | 55 | buffer = new byte[saveFile.Length]; 56 | //MessageBox.Show(buffer.Length.ToString()); 57 | ReadWholeArray(saveFile, ref buffer); 58 | saveFile.Close(); 59 | } 60 | 61 | public static int load_file(ref byte[] buffer, ref string path, string filter) 62 | { 63 | if (path == null) 64 | { 65 | OpenFileDialog openFD = new OpenFileDialog(); 66 | //openFD.InitialDirectory = "c:\\"; 67 | openFD.Filter = filter; 68 | DialogResult result = openFD.ShowDialog(); 69 | if (result == DialogResult.OK) 70 | { 71 | #region filename 72 | 73 | path = openFD.FileName; 74 | //MessageBox.Show(path.ToString()); 75 | 76 | #endregion 77 | 78 | _read_data(ref buffer, path); 79 | //MessageBox.Show(buffer.Length.ToString()); 80 | return buffer.Length; 81 | } 82 | 83 | return -1; 84 | } 85 | 86 | _read_data(ref buffer, path); 87 | //MessageBox.Show(buffer.Length.ToString()); 88 | return buffer.Length; 89 | } 90 | 91 | public static void save_data(byte[] buffer, string filter) 92 | { 93 | //if (savegamename.Text.Length < 1) return; 94 | if (buffer == null) return; 95 | SaveFileDialog saveFD = new SaveFileDialog(); 96 | //saveFD.InitialDirectory = "c:\\"; 97 | saveFD.Filter = filter; 98 | if (saveFD.ShowDialog() == DialogResult.OK) 99 | { 100 | FileStream saveFile = new FileStream(saveFD.FileName, FileMode.Create); 101 | //Write file 102 | saveFile.Write(buffer, 0, buffer.Length); 103 | saveFile.Close(); 104 | MessageBox.Show("File Saved.", "Save file"); 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ME3.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 02/05/2016 5 | * Time: 23:22 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | using System.Windows.Forms; 12 | 13 | namespace WC3Tool 14 | { 15 | /// 16 | /// Description of ME3. 17 | /// 18 | public class ME3 19 | { 20 | 21 | public int isemerald = -1; 22 | 23 | // Global Settings 24 | // Save Data Attributes 25 | public byte[] Data; 26 | public bool Edited; 27 | public readonly bool Exportable; 28 | public readonly byte[] BAK; 29 | public string FileName, FilePath; 30 | private int me3_size; 31 | 32 | public ME3(byte[] data, int size) 33 | { 34 | me3_size = size; 35 | Data = (byte[])(data ?? new byte[me3_size]).Clone(); 36 | BAK = (byte[])Data.Clone(); 37 | Exportable = !Data.SequenceEqual(new byte[Data.Length]); 38 | 39 | isEmerald(); 40 | } 41 | 42 | public int isEmerald() 43 | { 44 | //Get checksum in script 45 | UInt32 chk_scr = BitConverter.ToUInt32(getData(0, 4), 0); 46 | 47 | //RS checksum 48 | UInt32 chk_RS = me3_checksum(getData(4, me3_size-4-8), me3_size-4-8); 49 | 50 | //E checksum 51 | UInt32 chk_E = (UInt32) wc3.wc_checksum(getData(4, me3_size-4-8), me3_size-4-8, 0); 52 | 53 | if (chk_scr == chk_RS) 54 | { 55 | isemerald = 0; 56 | return isemerald; 57 | } 58 | if (chk_scr == chk_E) 59 | { 60 | isemerald = 1; 61 | return isemerald; 62 | } 63 | DialogResult dialogResult = MessageBox.Show("ME3 file script has wrong checksum. Is this a Ruby/Sapphire mystery event?", "Wrong checksum", MessageBoxButtons.YesNo); 64 | if(dialogResult == DialogResult.Yes) 65 | { 66 | isemerald = 0; 67 | } 68 | else if (dialogResult == DialogResult.No) 69 | { 70 | isemerald = 1; 71 | } 72 | return isemerald; 73 | } 74 | 75 | public byte[] getData(int Offset, int Length) 76 | { 77 | return Data.Skip(Offset).Take(Length).ToArray(); 78 | } 79 | public void setData(byte[] input, int Offset) 80 | { 81 | input.CopyTo(Data, Offset); 82 | Edited = true; 83 | } 84 | 85 | public byte MAP_BANK { get { return Data[0x05]; } set { Data[0x05] = (byte) value; } } 86 | public byte MAP_MAP { get { return Data[0x06]; } set { Data[0x06] = (byte) value; } } 87 | public byte MAP_PERSON { get { return Data[0x07]; } set { Data[0x07] = (byte) value; } } 88 | 89 | public byte[] get_script() 90 | { 91 | 92 | int scriptsize=0; 93 | int i = 0; 94 | for (i=0; i 3) 112 | BitConverter.GetBytes(address).CopyTo(xse_export, 0); 113 | MessageBox.Show("Open script in XSE at address 0x"+address.ToString("X")); 114 | //Set script to buffer 115 | getData(0x8, 996).CopyTo(xse_export, address); 116 | return xse_export; 117 | } 118 | public void set_script(byte[] newscript) 119 | { 120 | //Clear existing script 121 | int i = 0; 122 | for (i=8; i<996+8; i++) 123 | { 124 | Data[i] = 0x00; 125 | } 126 | UInt32 header = 0x01010833; 127 | setData(BitConverter.GetBytes(header).ToArray(), 4); 128 | setData(newscript, 8); 129 | } 130 | 131 | public void set_script_XSE(byte[] newscript) 132 | { 133 | //Clear existing script 134 | int i = 0; 135 | for (i=8; i<996+8; i++) 136 | { 137 | Data[i] = 0x00; 138 | } 139 | //Get address to script 140 | UInt32 address = BitConverter.ToUInt32(newscript, 4); 141 | 142 | UInt32 header = 0x01010833; 143 | setData(BitConverter.GetBytes(header).ToArray(), 4); 144 | setData(newscript.Skip((int)address).ToArray(), 8); 145 | } 146 | 147 | public byte get_item_amount() 148 | { 149 | return getData(me3_size-4, 1)[0]; 150 | } 151 | public byte get_item_counter() 152 | { 153 | return getData(me3_size-3, 1)[0]; 154 | } 155 | public UInt16 get_item() 156 | { 157 | return BitConverter.ToUInt16(getData(me3_size-2, 2), 0); 158 | } 159 | public void set_item_amount(byte amount) 160 | { 161 | Data[me3_size-4] = amount; 162 | } 163 | public void set_item_counter(byte counter) 164 | { 165 | Data[me3_size-3] = counter; 166 | } 167 | public void set_item(UInt16 item) 168 | { 169 | setData( BitConverter.GetBytes(item).ToArray(), me3_size-2); 170 | } 171 | 172 | public static UInt32 me3_checksum(byte[] buffer, int length) 173 | { 174 | int i=0; 175 | UInt32 Chk = 0; 176 | for(i=0; i 15 | /// Description of ME3_editor. 16 | /// 17 | public partial class ME3_editor : Form 18 | { 19 | public ME3_editor() 20 | { 21 | // 22 | // The InitializeComponent() call is required for Windows Forms designer support. 23 | // 24 | InitializeComponent(); 25 | 26 | // 27 | // TODO: Add constructor code after the InitializeComponent() call. 28 | // 29 | } 30 | 31 | public string me3filter = "Mystery Event file|*.me3|All Files (*.*)|*.*"; 32 | public string scriptfilter = "Script file|*.script|All Files (*.*)|*.*"; 33 | public string xsescriptfilter = "XSE padded script file|*.gba"; 34 | public byte[] me3buffer; 35 | public byte[] me3script_new; 36 | public static ME3 me3file; 37 | 38 | //private int me3size; 39 | 40 | void get_me3data() 41 | { 42 | amountbox.Value = me3file.get_item_amount(); 43 | counterbox.Value = me3file.get_item_counter(); 44 | itembox.SelectedIndex = me3file.get_item(); 45 | 46 | if(me3file.isemerald == 0)//These items aren't in emerald 47 | { 48 | if (itembox.SelectedIndex > 348) 49 | itembox.SelectedIndex = 348; 50 | }else{ 51 | if (itembox.SelectedIndex > 376) 52 | itembox.SelectedIndex = 376; 53 | } 54 | 55 | map_bank.Value = me3file.MAP_BANK; 56 | map_num.Value = me3file.MAP_MAP; 57 | map_npc.Value = me3file.MAP_PERSON; 58 | 59 | } 60 | 61 | void set_me3data() 62 | { 63 | me3file.set_item( (UInt16)itembox.SelectedIndex); 64 | me3file.set_item_amount( (byte) amountbox.Value); 65 | me3file.set_item_counter( (byte) counterbox.Value); 66 | 67 | me3file.MAP_BANK = (byte)map_bank.Value; 68 | me3file.MAP_MAP = (byte)map_num.Value; 69 | me3file.MAP_PERSON = (byte)map_npc.Value; 70 | 71 | if (radio_E.Checked) 72 | me3file.isemerald = 1; 73 | else if (radio_RS.Checked) 74 | me3file.isemerald = 0; 75 | } 76 | 77 | void Load_me3(string path) 78 | { 79 | int filesize = FileIO.load_file(ref me3buffer, ref path, me3filter); 80 | if( filesize == SAV3.ME3_SIZE_E || filesize == SAV3.ME3_SIZE_RS ) 81 | { 82 | 83 | radio_RS.Checked = false; 84 | radio_E.Checked = false; 85 | 86 | me3_path.Text = path; 87 | me3file = new ME3(me3buffer, filesize); 88 | 89 | switch (me3file.isemerald) 90 | { 91 | case 0: 92 | radio_RS.Checked = true; 93 | break; 94 | case 1: 95 | radio_E.Checked = true; 96 | break; 97 | } 98 | 99 | get_me3data(); 100 | 101 | save_me3_but.Enabled = true; 102 | removescript_but.Enabled = true; 103 | export_script_but.Enabled = true; 104 | import_script_but.Enabled = true; 105 | custom_script.Checked = false; 106 | script_check.Checked = true; 107 | 108 | }else{ 109 | MessageBox.Show("Invalid file size."); 110 | } 111 | } 112 | 113 | void Load_me3_butClick(object sender, EventArgs e) 114 | { 115 | Load_me3(null); 116 | 117 | } 118 | void ItemboxSelectedIndexChanged(object sender, EventArgs e) 119 | { 120 | if(me3file.isemerald == 0)//These items aren't in RS 121 | { 122 | if (itembox.SelectedIndex > 348){ 123 | itembox.SelectedIndex = 348; 124 | MessageBox.Show("Selected item is not available in Ruby/Sapphire."); 125 | } 126 | }else{ 127 | if (itembox.SelectedIndex > 376) 128 | itembox.SelectedIndex = 376; 129 | } 130 | } 131 | void Save_me3_butClick(object sender, EventArgs e) 132 | { 133 | set_me3data(); 134 | me3file.fix_me_script_checksum(); 135 | me3file.fix_me_item_checksum(); 136 | 137 | if (me3file.Edited) 138 | FileIO.save_data(me3file.Data, me3filter); 139 | else MessageBox.Show("Save has not been edited"); 140 | } 141 | void Export_script_butClick(object sender, EventArgs e) 142 | { 143 | FileIO.save_data(me3file.get_script(), scriptfilter); 144 | } 145 | void Import_script_butClick(object sender, EventArgs e) 146 | { 147 | string path = null; 148 | int filesize = FileIO.load_file(ref me3script_new, ref path, scriptfilter); 149 | if( filesize <= 996 ) 150 | { 151 | me3file.set_script(me3script_new); 152 | custom_script.Checked = true; 153 | script_check.Checked = me3file.has_script(); 154 | MessageBox.Show("Custom script imported."); 155 | 156 | }else{ 157 | MessageBox.Show("Invalid file size."); 158 | } 159 | } 160 | void CounterboxValueChanged(object sender, EventArgs e) 161 | { 162 | //Not sure about this anymore 163 | /*if (counterbox.Value > amountbox.Value) 164 | { 165 | MessageBox.Show("Counter can't be bigger than total amount"); 166 | counterbox.Value = amountbox.Value; 167 | }*/ 168 | } 169 | void Removescript_butClick(object sender, EventArgs e) 170 | { 171 | me3file.removeScript(); 172 | script_check.Checked = me3file.has_script(); 173 | } 174 | void Help_npcClick(object sender, EventArgs e) 175 | { 176 | MessageBox.Show("These values are used to associate the script to a NPC character in the game.\n\nYou can use Advance Map to locate the values for all NPC in the game.\n\nFather at petalburg Gym is Bank 08, Map 01, NPC 01."); 177 | } 178 | void Counter_helpClick(object sender, EventArgs e) 179 | { 180 | MessageBox.Show("Every time you mix records, this number decreases by 1, even if the item isn't transfered due to the other person already having it."); 181 | } 182 | void Amount_helpClick(object sender, EventArgs e) 183 | { 184 | MessageBox.Show("Should always be 1? Changing it has no apparent effect."); 185 | } 186 | void Item_helpClick(object sender, EventArgs e) 187 | { 188 | MessageBox.Show("The item will only be transfered via record mixing if receiver doesn't own the item."); 189 | } 190 | void Xse_exportClick(object sender, EventArgs e) 191 | { 192 | FileIO.save_data(me3file.get_script_XSE(), xsescriptfilter); 193 | } 194 | void Xse_importClick(object sender, EventArgs e) 195 | { 196 | string path = null; 197 | int filesize = FileIO.load_file(ref me3script_new, ref path, xsescriptfilter); 198 | if( filesize <= 1000 ) 199 | { 200 | me3file.set_script_XSE(me3script_new); 201 | custom_script.Checked = true; 202 | MessageBox.Show("Custom script imported."); 203 | 204 | }else{ 205 | MessageBox.Show("Invalid file size."); 206 | } 207 | } 208 | void Xse_helpClick(object sender, EventArgs e) 209 | { 210 | MessageBox.Show("XSE Export: exports the script with padding corresponding to base address of the script and *.gba extension. You can directly load (and edit) the script in XSE, script offset will be shown when using the export button.\nXSE Import: imports a *.gba script generated by this tool after editing (or not) with XSE (importing anything else will not correctly work).\n\nThese options are just for convenience, the scripts are in no way gba roms, but it's the more convenient way to edit them in XSE."); 211 | } 212 | 213 | void ME3_editorDragEnter(object sender, DragEventArgs e) 214 | { 215 | e.Effect = DragDropEffects.All; 216 | } 217 | void ME3_editorDragDrop(object sender, DragEventArgs e) 218 | { 219 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); 220 | Load_me3(files[0]); 221 | } 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /WC3Tool/WC3/ME3_editor.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/PKHEX/SpeciesConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WC3Tool 4 | { 5 | /// 6 | /// This class is loaned from PKHeX.Core with permission. 7 | /// PKHeX's current license (GPLv3 as of 2019) applies if any of this class's contents are used outside of WC3Tool. 8 | /// 9 | public static class SpeciesConverter 10 | { 11 | internal static int GetG4Species(int g3index) 12 | { 13 | int index = Array.IndexOf(oldindex, g3index); 14 | return newindex[index > -1 ? index : 0]; 15 | } 16 | 17 | internal static readonly int[] newindex = 18 | { 19 | 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30, 20 | 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58, 21 | 59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,77,79,80,81,82,83,84,85,86, 22 | 87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110, 23 | 111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131, 24 | 132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152, 25 | 153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173, 26 | 174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194, 27 | 195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215, 28 | 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236, 29 | 237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257, 30 | 258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,290,291,292, 31 | 276,277,285,286,327,278,279,283,284,320,321,300,301,352,343,344,299,324,302,339,340, 32 | 370,341,342,349,350,318,319,328,329,330,296,297,309,310,322,323,363,364,365,331,332, 33 | 361,362,337,338,298,325,326,311,312,303,307,308,333,334,360,355,356,315,287,288,289, 34 | 316,317,357,293,294,295,366,367,368,359,353,354,336,335,369,304,305,306,351,313,314, 35 | 345,346,347,348,280,281,282,371,372,373,374,375,376,377,378,379,382,383,384,380,381, 36 | 385,386,358, 37 | }; 38 | 39 | internal static readonly int[] oldindex = 40 | { 41 | 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30, 42 | 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58, 43 | 59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86, 44 | 87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110, 45 | 111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131, 46 | 132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152, 47 | 153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173, 48 | 174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194, 49 | 195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215, 50 | 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236, 51 | 237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,277,278,279,280,281,282, 52 | 283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303, 53 | 304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324, 54 | 325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345, 55 | 346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366, 56 | 367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387, 57 | 388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408, 58 | 409,410,411, 59 | }; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /WC3Tool/WC3/PKHEX/StringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace WC3Tool 5 | { 6 | /// 7 | /// This class is loaned from PKHeX.Core with permission. 8 | /// PKHeX's current license (GPLv3 as of 2019) applies if any of this class's contents are used outside of WC3Tool. 9 | /// 10 | public static class StringConverter 11 | { 12 | /// 13 | /// Decodes a character from a Generation 3 encoded value. 14 | /// 15 | /// Generation 4 decoded character. 16 | /// Character destination is Japanese font. 17 | /// Generation 3 encoded value. 18 | private static char GetG3Char(byte chr, bool jp) 19 | { 20 | var table = jp ? G3_JP : G3_EN; 21 | if (chr >= table.Length) 22 | return (char)0xFF; 23 | return table[chr]; 24 | } 25 | 26 | /// 27 | /// Encodes a character to a Generation 3 encoded value. 28 | /// 29 | /// Generation 4 decoded character. 30 | /// Character destination is Japanese font. 31 | /// Generation 3 encoded value. 32 | private static byte SetG3Char(char chr, bool jp) 33 | { 34 | var table = jp ? G3_JP : G3_EN; 35 | var index = Array.IndexOf(table, chr); 36 | return (byte)(index > -1 ? index : 0xFF); 37 | } 38 | 39 | internal static string GetG3Str(byte[] strdata, bool jp) 40 | { 41 | return strdata 42 | .TakeWhile(val => val < 247) // Take valid values 43 | .Select(val => GetG3Char(val, jp)) // Convert to Unicode 44 | .TakeWhile(chr => chr != 0xFF) // Stop if Terminator 45 | .Aggregate("", (current, chr) => current + chr); 46 | } 47 | 48 | internal static byte[] SetG3Str(string str, bool jp) 49 | { 50 | byte[] strdata = new byte[str.Length + 1]; // +1 for 0xFF 51 | for (int i = 0; i < str.Length; i++) 52 | { 53 | var chr = str[i]; 54 | byte val = SetG3Char(chr, jp); 55 | if (val == 0xFF || chr == 0xFF) 56 | { Array.Resize(ref strdata, i); break; } 57 | strdata[i] = val; 58 | } 59 | strdata[str.Length] = 0xFF; 60 | return strdata; 61 | } 62 | 63 | internal static byte[] SetG3Str_WONDER(string str, bool jp) => SetG3Str(str, jp); 64 | 65 | private static readonly char[] G3_EN = 66 | { 67 | ' ', 'À', 'Á', 'Â', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'こ', 'Î', 'Ï', 'Ò', 'Ó', 'Ô', // 0 68 | 'Œ', 'Ù', 'Ú', 'Û', 'Ñ', 'ß', 'à', 'á', 'ね', 'Ç', 'È', 'é', 'ê', 'ë', 'ì', 'í', // 1 69 | 'î', 'ï', 'ò', 'ó', 'ô', 'œ', 'ù', 'ú', 'û', 'ñ', 'º', 'ª', '⒅', '&', '+', 'あ', // 2 70 | 'ぃ', 'ぅ', 'ぇ', 'ぉ', 'ゃ', '=', 'ょ', 'が', 'ぎ', 'ぐ', 'げ', 'ご', 'ざ', 'じ', 'ず', 'ぜ', // 3 71 | 'ぞ', 'だ', 'ぢ', 'づ', 'で', 'ど', 'ば', 'び', 'ぶ', 'べ', 'ぼ', 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ', // 4 72 | 'っ', '¿', '¡', '⒆', '⒇', 'オ', 'カ', 'キ', 'ク', 'ケ', 'Í', 'コ', 'サ', 'ス', 'セ', 'ソ', // 5 73 | 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'â', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'í', // 6 74 | 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ヲ', 'ン', 'ァ', // 7 75 | 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ガ', 'ギ', 'グ', 'ゲ', 'ゴ', 'ザ', 'ジ', 'ズ', 'ゼ', // 8 76 | 'ゾ', 'ダ', 'ヂ', 'ヅ', 'デ', 'ド', 'バ', 'ビ', 'ブ', 'ベ', 'ボ', 'パ', 'ピ', 'プ', 'ペ', 'ポ', // 9 77 | 'ッ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', '-', '・',// A 78 | '⑬', '“', '”', '‘', '’', '♂', '♀', '$', ',', '⑧', '/', 'A', 'B', 'C', 'D', 'E', // B 79 | 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', // C 80 | 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', // D 81 | 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', // E 82 | ':', 'Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', // F 83 | }; 84 | 85 | private static readonly char[] G3_JP = 86 | { 87 | ' ', 'あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ', 'さ', 'し', 'す', 'せ', 'そ', // 0 88 | 'た', 'ち', 'つ', 'て', 'と', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'へ', 'ほ', 'ま', // 1 89 | 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ', 'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'を', 'ん', 'ぁ', // 2 90 | 'ぃ', 'ぅ', 'ぇ', 'ぉ', 'ゃ', 'ゅ', 'ょ', 'が', 'ぎ', 'ぐ', 'げ', 'ご', 'ざ', 'じ', 'ず', 'ぜ', // 3 91 | 'ぞ', 'だ', 'ぢ', 'づ', 'で', 'ど', 'ば', 'び', 'ぶ', 'べ', 'ぼ', 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ', // 4 92 | 'っ', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', // 5 93 | 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', // 6 94 | 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ヲ', 'ン', 'ァ', // 7 95 | 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ガ', 'ギ', 'グ', 'ゲ', 'ゴ', 'ザ', 'ジ', 'ズ', 'ゼ', // 8 96 | 'ゾ', 'ダ', 'ヂ', 'ヅ', 'デ', 'ド', 'バ', 'ビ', 'ブ', 'ベ', 'ボ', 'パ', 'ピ', 'プ', 'ペ', 'ポ', // 9 97 | 'ッ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '。', 'ー', '・', // A 98 | '⋯', '『', '』', '「', '」', '♂', '♀', '$', '.', '⑧', '/', 'A', 'B', 'C', 'D', 'E', // B 99 | 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', // C 100 | 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', // D 101 | 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', // E 102 | ':', 'Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', // F 103 | }; 104 | } 105 | } -------------------------------------------------------------------------------- /WC3Tool/WC3/TV.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 13/05/2016 5 | * Time: 14:03 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | 12 | namespace WC3Tool 13 | { 14 | public class TV_EVENTS 15 | { 16 | private int tv_event_size = 0x4*16; 17 | 18 | public byte[] Data; 19 | 20 | public TV_EVENTS(byte[] data) 21 | { 22 | Data = (byte[])(data ?? new byte[tv_event_size]).Clone(); 23 | 24 | load_events(); 25 | } 26 | public byte[] getData(int Offset, int Length) 27 | { 28 | return Data.Skip(Offset).Take(Length).ToArray(); 29 | } 30 | public void setData(byte[] input, int Offset) 31 | { 32 | input.CopyTo(Data, Offset); 33 | } 34 | 35 | public EVENT[] events = new EVENT[16]; 36 | public void load_events() 37 | { 38 | int i=0; 39 | for(i=0;i<16;i++) 40 | { 41 | events[i] = new EVENT(getData(EVENT.event_size*i, EVENT.event_size)); 42 | } 43 | } 44 | public void set_events() 45 | { 46 | int i=0; 47 | for(i=0;i<16;i++) 48 | { 49 | setData(events[i].Data, EVENT.event_size*i); 50 | } 51 | } 52 | } 53 | public class TV_SHOWS 54 | { 55 | private int tv_size = 0x24*7; 56 | 57 | public byte[] Data; 58 | 59 | public TV_SHOWS(byte[] data) 60 | { 61 | Data = (byte[])(data ?? new byte[tv_size]).Clone(); 62 | 63 | load_shows(); 64 | } 65 | public byte[] getData(int Offset, int Length) 66 | { 67 | return Data.Skip(Offset).Take(Length).ToArray(); 68 | } 69 | public void setData(byte[] input, int Offset) 70 | { 71 | input.CopyTo(Data, Offset); 72 | } 73 | 74 | public SHOW[] shows = new SHOW[7]; 75 | public void load_shows() 76 | { 77 | int i=0; 78 | for(i=0;i<7;i++) 79 | { 80 | shows[i] = new SHOW(getData(SHOW.show_size*i, SHOW.show_size)); 81 | } 82 | } 83 | public void set_shows() 84 | { 85 | int i=0; 86 | for(i=0;i<7;i++) 87 | { 88 | setData(shows[i].Data, SHOW.show_size*i); 89 | } 90 | } 91 | } 92 | public class EVENT 93 | { 94 | public static int event_size = 0x4; 95 | 96 | public byte[] Data; 97 | public EVENT(byte[] data) 98 | { 99 | Data = (byte[])(data ?? new byte[event_size]).Clone(); 100 | } 101 | public byte[] getData(int Offset, int Length) 102 | { 103 | return Data.Skip(Offset).Take(Length).ToArray(); 104 | } 105 | public void setData(byte[] input, int Offset) 106 | { 107 | input.CopyTo(Data, Offset); 108 | } 109 | public byte ID 110 | { 111 | get{ return Data[0x0];} 112 | set{ Data[0x0] = (byte)value;} 113 | } 114 | public byte status 115 | { 116 | 117 | get{ return Data[0x1];} 118 | set{ Data[0x1] = (byte)value;} 119 | } 120 | public UInt16 days_to_tv 121 | { 122 | get{ return BitConverter.ToUInt16(getData(0x2, 2), 0);} 123 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x2);} 124 | } 125 | } 126 | /* 127 | Offsets 128 | RAM 0x281F0 - 0x2822F (RS) 129 | 0x28550 - 0x2858F (E) 130 | 131 | Save Section 3 0xBBC - 0xBFB (RS) 132 | Section 3 0xC50 - 0xC8F (E) 133 | 134 | 135 | Structure 136 | 0x01 Event ID 137 | 0x02 Status (0 - seen, 1 - not yet seen, 2 - seen + event active) 138 | 0x03 - 0x04 Days remaining until event is active (announcement starts 2 days before) 139 | 140 | Event ID 141 | 1 Big Sale (Slateport Energy Guru) 142 | 2 Service Day (Mauville Game Corner) 143 | 3 Clear-Out-Sale (Lilycove Department Store) 144 | 4 Blend Master (Lilycove Contest Hall) (Emerald only!) 145 | */ 146 | public class SHOW 147 | { 148 | public static int show_size = 0x24; 149 | 150 | public byte[] Data; 151 | public SHOW(byte[] data) 152 | { 153 | Data = (byte[])(data ?? new byte[show_size]).Clone(); 154 | } 155 | public byte[] getData(int Offset, int Length) 156 | { 157 | return Data.Skip(Offset).Take(Length).ToArray(); 158 | } 159 | public void setData(byte[] input, int Offset) 160 | { 161 | input.CopyTo(Data, Offset); 162 | } 163 | 164 | //Data common to all shows 165 | public byte ID 166 | { 167 | get{ return Data[0x0];} 168 | set{ Data[0x0] = (byte)value;} 169 | } 170 | public byte status 171 | { 172 | 173 | get{ return Data[0x1];} 174 | set{ Data[0x1] = (byte)value;} 175 | } 176 | /* 177 | public bool status 178 | { 179 | 180 | get{ if(Data[0x1] == 1) return true; else return false;} 181 | set{ if (value == true) Data[0x1] = 0x01; else Data[0x1] = 0;} 182 | } 183 | */ 184 | public UInt16 TID_own 185 | { 186 | get{ return BitConverter.ToUInt16(getData(0x20, 2), 0);} 187 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x20);} 188 | } 189 | public UInt16 TID_mixed 190 | { 191 | get{ return BitConverter.ToUInt16(getData(0x22, 2), 0);} 192 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x22);} 193 | } 194 | 195 | //Data dependent of show 196 | 197 | //ID 0x29 (Outbreak) 198 | 199 | public UInt16 outbreak_move1 200 | { 201 | get{ return BitConverter.ToUInt16(getData(0x04, 2), 0);} 202 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x04);} 203 | } 204 | public UInt16 outbreak_move2 205 | { 206 | get{ return BitConverter.ToUInt16(getData(0x06, 2), 0);} 207 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x06);} 208 | } 209 | public UInt16 outbreak_move3 210 | { 211 | get{ return BitConverter.ToUInt16(getData(0x08, 2), 0);} 212 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x08);} 213 | } 214 | public UInt16 outbreak_move4 215 | { 216 | get{ return BitConverter.ToUInt16(getData(0x0A, 2), 0);} 217 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x0A);} 218 | } 219 | public UInt16 outbreak_species 220 | { 221 | get{ return BitConverter.ToUInt16(getData(0xC, 2), 0);} 222 | set{ setData(BitConverter.GetBytes((UInt16)value), 0xC);} 223 | } 224 | public UInt16 outbreak_map 225 | { 226 | get{ return BitConverter.ToUInt16(getData(0x10, 2), 0);} 227 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x10);} 228 | } 229 | public byte outbreak_level 230 | { 231 | get{ return Data[0x14];} 232 | set{ Data[0x14] = (byte)value;} 233 | } 234 | public byte outbreak_appearance 235 | { 236 | get{ return Data[0x13];} 237 | set{ Data[0x13] = (byte)value;} 238 | } 239 | public UInt16 outbreak_days_to_tv 240 | { 241 | get{ return BitConverter.ToUInt16(getData(0x16, 2), 0);} 242 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x16);} 243 | } 244 | public UInt16 outbreak_remaining_days 245 | { 246 | get{ return BitConverter.ToUInt16(getData(0x18, 2), 0);} 247 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x18);} 248 | } 249 | //End of outbreak data 250 | } 251 | /* 252 | Outbreak TV Show 253 | When you watched the Outbreak announcement, data gets written to the Extra Data (see below). 254 | 255 | Offsets 256 | RAM 0x27E6C - 0x281CB (RS) 257 | 0x281CC - 0x2852B (E) 258 | Save Section 3 0x838 - 0xB97 (RS) 259 | Section 3 0x8CC - 0xC2B (E) 260 | 261 | Structure 262 | 0x00 Show ID (0x29 for Outbreak) 263 | 0x01 Status (0 - seen, 1 - not yet seen; you can't see the announcement if you already have an active outbreak) 264 | 0x02 - 0x03 00 00 265 | 0x04 - 0x05 Move 1 266 | 0x06 - 0x07 Move 2 267 | 0x08 - 0x09 Move 3 268 | 0x0A - 0x0B Move 4 269 | 0x0C - 0x0D Species ID 270 | 0x0E - 0x0F 00 00 271 | 0x10 - 0x11 Location Map Index (use Advance Map to see them) 272 | 0x12 00 273 | 0x13 Appearance rate (50% (0x32) by default) 274 | 0x14 Level 275 | 0x15 00 276 | 0x16 - 0x17 Days remaining until show is on TV (set to 1 if received via record mixing) 277 | 0x18 - 0x19 Days the outbreak will last (2 by default) 278 | 0x1A - 0x1F 00 00 00 00 00 00 279 | 0x20 - 0x21 Own Trainer ID 280 | 0x22 - 0x23 Trainer ID of the game from which the data was received via record mixing 281 | */ 282 | public class SWARM 283 | { 284 | public static int swarm_size = 0x14; 285 | 286 | public byte[] Data; 287 | public SWARM(byte[] data) 288 | { 289 | Data = (byte[])(data ?? new byte[swarm_size]).Clone(); 290 | } 291 | public byte[] getData(int Offset, int Length) 292 | { 293 | return Data.Skip(Offset).Take(Length).ToArray(); 294 | } 295 | public void setData(byte[] input, int Offset) 296 | { 297 | input.CopyTo(Data, Offset); 298 | } 299 | 300 | public UInt16 species 301 | { 302 | get{ return BitConverter.ToUInt16(getData(0, 2), 0);} 303 | set{ setData(BitConverter.GetBytes((UInt16)value), 0);} 304 | } 305 | public UInt16 map 306 | { 307 | get{ return BitConverter.ToUInt16(getData(2, 2), 0);} 308 | set{ setData(BitConverter.GetBytes((UInt16)value), 2);} 309 | } 310 | public byte level 311 | { 312 | get{ return Data[0x4];} 313 | set{ Data[0x4] = (byte)value;} 314 | } 315 | public UInt16 move1 316 | { 317 | get{ return BitConverter.ToUInt16(getData(0x08, 2), 0);} 318 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x08);} 319 | } 320 | public UInt16 move2 321 | { 322 | get{ return BitConverter.ToUInt16(getData(0x0A, 2), 0);} 323 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x0A);} 324 | } 325 | public UInt16 move3 326 | { 327 | get{ return BitConverter.ToUInt16(getData(0x0C, 2), 0);} 328 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x0C);} 329 | } 330 | public UInt16 move4 331 | { 332 | get{ return BitConverter.ToUInt16(getData(0x0E, 2), 0);} 333 | set{ setData(BitConverter.GetBytes((UInt16)value), 0x0E);} 334 | } 335 | public byte appearance 336 | { 337 | get{ return Data[0x11];} 338 | set{ Data[0x11] = (byte)value;} 339 | } 340 | public byte remaining_days 341 | { 342 | get{ return Data[0x12];} 343 | set{ Data[0x12] = (byte)value;} 344 | } 345 | } 346 | } 347 | 348 | /* 349 | Outbreak Extra Data 350 | When you watched the Outbreak announcement, data gets written here. 351 | It's stored here until the counter at 0x12 reaches 0. 352 | 353 | Offsets 354 | RAM 0x28230 - 0x28243 (RS) 355 | 0x28590 - 0x285A3 (E) 356 | Save Section 3 0xBFC - 0xC0F (RS) 357 | Section 3 0xC90 - 0xCA3 (E) 358 | 359 | Structure 360 | 0x00 - 0x01 Species ID 361 | 0x02 - 0x03 Location Map Index (use Advance Map to see them) 362 | 0x04 Level 363 | 0x05 - 0x07 00 00 00 364 | 0x08 - 0x09 Move 1 365 | 0x0A - 0x0B Move 2 366 | 0x0C - 0x0D Move 3 367 | 0x0E - 0x0F Move 4 368 | 0x10 00 369 | 0x11 Appearance rate (50% (0x32) by default) 370 | 0x12 Days the outbreak will last (2 by default; counts down daily) 371 | */ -------------------------------------------------------------------------------- /WC3Tool/WC3/TV_editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 13/05/2016 5 | * Time: 14:03 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Windows.Forms; 11 | 12 | namespace WC3Tool 13 | { 14 | /// 15 | /// Description of TV_editor. 16 | /// 17 | public partial class TV_editor : Form 18 | { 19 | 20 | SAV3 sav3file; 21 | public string savfilter = MainScreen.savfilter; 22 | 23 | //TV data 24 | TV_EVENTS events; 25 | SHOW ingame_swarm; 26 | TV_SHOWS shows; 27 | SWARM swarm; 28 | 29 | public TV_editor(SAV3 save) 30 | { 31 | InitializeComponent(); 32 | 33 | sav3file = save; 34 | 35 | events = new TV_EVENTS (sav3file.get_TV_EVENT()); 36 | ingame_swarm = new SHOW(sav3file.get_TV_OUTBREAK()); 37 | shows = new TV_SHOWS(sav3file.get_TV_SHOWS()); 38 | swarm = new SWARM(sav3file.get_TV_OUTBREAK_EXTRA()); 39 | 40 | load_data(); 41 | 42 | } 43 | 44 | void load_data() 45 | { 46 | load_event(); 47 | load_swarm(); 48 | load_show(); 49 | } 50 | 51 | void load_event() 52 | { 53 | event_id.SelectedIndex = events.events[(int)event_slot.Value].ID; 54 | event_status.SelectedIndex = events.events[(int)event_slot.Value].status; 55 | event_days.Value = events.events[(int)event_slot.Value].days_to_tv; 56 | } 57 | void set_event() 58 | { 59 | events.events[(int)event_slot.Value].ID = (byte)event_id.SelectedIndex; 60 | events.events[(int)event_slot.Value].status = (byte)event_status.SelectedIndex; 61 | events.events[(int)event_slot.Value].days_to_tv = (UInt16)event_days.Value; 62 | } 63 | 64 | void load_swarm() 65 | { 66 | current_species.SelectedIndex = swarm.species; 67 | current_level.Value = swarm.level; 68 | current_move1.SelectedIndex = swarm.move1; 69 | current_move2.SelectedIndex = swarm.move2; 70 | current_move3.SelectedIndex = swarm.move3; 71 | current_move4.SelectedIndex = swarm.move4; 72 | current_map.Value = swarm.map; 73 | current_appearance.Value = swarm.appearance; 74 | current_remaining.Value = swarm.remaining_days; 75 | } 76 | void set_swarm() 77 | { 78 | swarm.species = (UInt16)current_species.SelectedIndex; 79 | swarm.level = (byte)current_level.Value; 80 | swarm.move1 = (UInt16)current_move1.SelectedIndex; 81 | swarm.move2 = (UInt16)current_move2.SelectedIndex; 82 | swarm.move3 = (UInt16)current_move3.SelectedIndex; 83 | swarm.move4 = (UInt16)current_move4.SelectedIndex; 84 | swarm.map = (UInt16)current_map.Value; 85 | swarm.appearance = (byte)current_appearance.Value; 86 | swarm.remaining_days = (byte)current_remaining.Value; 87 | } 88 | void load_show() 89 | { 90 | 91 | if (tv_slot.Value == 0) 92 | { 93 | tv_id.Value = ingame_swarm.ID; 94 | tv_status.SelectedIndex = ingame_swarm.status; 95 | tv_tid.Value = ingame_swarm.TID_own; 96 | tv_mix_tid.Value = ingame_swarm.TID_mixed; 97 | 98 | }else 99 | { 100 | tv_id.Value = shows.shows[(int)(tv_slot.Value-1)].ID; 101 | tv_status.SelectedIndex = shows.shows[(int)(tv_slot.Value-1)].status; 102 | tv_tid.Value = shows.shows[(int)(tv_slot.Value-1)].TID_own; 103 | tv_mix_tid.Value = shows.shows[(int)(tv_slot.Value-1)].TID_mixed; 104 | } 105 | 106 | load_outbreak(); 107 | } 108 | 109 | void Save_butClick(object sender, EventArgs e) 110 | { 111 | events.set_events(); 112 | shows.set_shows(); 113 | 114 | sav3file.set_TV_EVENT(events.Data); 115 | sav3file.set_TV_OUTBREAK(ingame_swarm.Data); 116 | sav3file.set_TV_SHOWS(shows.Data); 117 | sav3file.set_TV_OUTBREAK_EXTRA(swarm.Data); 118 | sav3file.update_section_chk(3); 119 | FileIO.save_data(sav3file.Data, savfilter); 120 | } 121 | void Event_slotValueChanged(object sender, EventArgs e) 122 | { 123 | load_event(); 124 | } 125 | void Swarm_deleteClick(object sender, EventArgs e) 126 | { 127 | delete_current_swarm(); 128 | load_swarm(); 129 | } 130 | void delete_current_swarm() 131 | { 132 | int i = 0; 133 | for (i=0; i 2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 28/04/2016 5 | * Time: 21:22 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Drawing; 11 | using System.Windows.Forms; 12 | using System.Reflection; 13 | using System.Resources; 14 | 15 | namespace WC3Tool 16 | { 17 | /// 18 | /// Description of MainForm. 19 | /// 20 | public partial class WC3_editor : Form 21 | { 22 | public WC3_editor() 23 | { 24 | // 25 | // The InitializeComponent() call is required for Windows Forms designer support. 26 | // 27 | InitializeComponent(); 28 | faketoogle.Checked = true; 29 | regionlab.Text = ""; 30 | GFX = CreateGraphics(); 31 | colorbox.SelectedIndex = 0; 32 | icon_num.Value = 0; 33 | 34 | // 35 | // TODO: Add constructor code after the InitializeComponent() call. 36 | // 37 | } 38 | public string wc3filter = "Wonder Card file|*.wc3|All Files (*.*)|*.*"; 39 | public string scriptfilter = "Script file|*.script|All Files (*.*)|*.*"; 40 | public string xsescriptfilter = "XSE padded script file|*.gba"; 41 | public byte[] wc3buffer; 42 | public byte[] wc3script_new; 43 | public static wc3 wc3file; 44 | 45 | public bool japanese; 46 | public static bool script_injected; 47 | 48 | private Graphics GFX; 49 | 50 | void update_iconbox() 51 | { 52 | iconbox.Enabled = true; 53 | if (icon_num.Value >= 1 && icon_num.Value <= 251){ 54 | iconbox.SelectedIndex = (UInt16)icon_num.Value; 55 | }/*else if (icon_num.Value >= 252 && icon_num.Value <= 276){ 56 | iconbox.Enabled = false; 57 | iconbox.SelectedIndex = 440; 58 | }*/else if (icon_num.Value >= 251 && icon_num.Value <= 440){ 59 | iconbox.SelectedIndex = (UInt16)icon_num.Value; 60 | }else if (icon_num.Value == 0xFFFF){ 61 | iconbox.SelectedIndex = 0; 62 | }else{ 63 | iconbox.Enabled = false; 64 | iconbox.SelectedIndex = 440; 65 | } 66 | } 67 | string fill_line(string line, int index) //Fills string with spaces to "erase" old content. 68 | { 69 | if (japanese) 70 | { 71 | switch (index) 72 | { 73 | case 0: 74 | while(line.Length < 18) 75 | { 76 | line = line + " "; 77 | } 78 | break; 79 | case 1: 80 | while(line.Length < 13) 81 | { 82 | line = line + " "; 83 | } 84 | break; 85 | default: 86 | while(line.Length < 20) 87 | { 88 | line = line + " "; 89 | } 90 | break; 91 | } 92 | 93 | }else 94 | { 95 | while(line.Length < 40) 96 | { 97 | line = line + " "; 98 | } 99 | } 100 | 101 | return line; 102 | 103 | } 104 | void update_wcdata() 105 | { 106 | switch (wc3file.distributable) 107 | { 108 | case 0: 109 | distro_but_no.Checked = true; 110 | break; 111 | case 1: 112 | distro_but_always.Checked = true; 113 | break; 114 | case 2: 115 | distro_but_one.Checked = true; 116 | break; 117 | default: 118 | distro_but_no.Checked = true; 119 | break; 120 | } 121 | icon_num.Value = wc3file.get_wc_icon(); 122 | update_iconbox(); 123 | colorbox.SelectedIndex = wc3file.get_wc_color(); 124 | 125 | 126 | header1.Text = wc3file.get_wc_text_2(0); 127 | header2.Text = wc3file.get_wc_text_2(1); 128 | body1.Text = wc3file.get_wc_text_2(2); 129 | body2.Text = wc3file.get_wc_text_2(3); 130 | body3.Text = wc3file.get_wc_text_2(4); 131 | body4.Text = wc3file.get_wc_text_2(5); 132 | footer1.Text = wc3file.get_wc_text_2(6); 133 | footer2.Text = wc3file.get_wc_text_2(7); 134 | /* 135 | header1.Text = wc3file.get_wc_text(0); 136 | header2.Text = wc3file.get_wc_text(1); 137 | body1.Text = wc3file.get_wc_text(2); 138 | body2.Text = wc3file.get_wc_text(3); 139 | body3.Text = wc3file.get_wc_text(4); 140 | body4.Text = wc3file.get_wc_text(5); 141 | footer1.Text = wc3file.get_wc_text(6); 142 | footer2.Text = wc3file.get_wc_text(7); 143 | */ 144 | 145 | map_bank.Value = wc3file.MAP_BANK; 146 | map_map.Value = wc3file.MAP_MAP; 147 | map_npc.Value = wc3file.MAP_NPC; 148 | } 149 | void set_wcdata() 150 | { 151 | wc3file.clear_wc_text(); //instead of clearing line, clear all text 152 | wc3file.insert_wc_text_2(header1.Text, 0); 153 | wc3file.insert_wc_text_2(header2.Text, 1); 154 | wc3file.insert_wc_text_2(body1.Text, 2); 155 | wc3file.insert_wc_text_2(body2.Text, 3); 156 | wc3file.insert_wc_text_2(body3.Text, 4); 157 | wc3file.insert_wc_text_2(body4.Text, 5); 158 | wc3file.insert_wc_text_2(footer1.Text, 6); 159 | wc3file.insert_wc_text_2(footer2.Text, 7); 160 | /* 161 | wc3file.insert_wc_text(header1.Text, 0); 162 | wc3file.insert_wc_text(header2.Text, 1); 163 | wc3file.insert_wc_text(body1.Text, 2); 164 | wc3file.insert_wc_text(body2.Text, 3); 165 | wc3file.insert_wc_text(body3.Text, 4); 166 | wc3file.insert_wc_text(body4.Text, 5); 167 | wc3file.insert_wc_text(footer1.Text, 6); 168 | wc3file.insert_wc_text(footer2.Text, 7); 169 | */ 170 | wc3file.ID = 0x33; 171 | wc3file.MAP_BANK = (byte)map_bank.Value; 172 | wc3file.MAP_MAP = (byte)map_map.Value; 173 | wc3file.MAP_NPC = (byte)map_npc.Value; 174 | } 175 | 176 | void Load_WC3(string path) 177 | { 178 | int filesize = FileIO.load_file(ref wc3buffer, ref path, wc3filter); 179 | if( filesize == wc3.SIZE_WC3 || filesize == wc3.SIZE_WC3_jap) 180 | { 181 | if (filesize == wc3.SIZE_WC3_jap) 182 | { 183 | japanese = true; 184 | regionlab.Text = "JAP"; 185 | header1.MaxLength = 18; 186 | header2.MaxLength = 13; 187 | body1.MaxLength = 20; 188 | body2.MaxLength = 20; 189 | body3.MaxLength = 20; 190 | body4.MaxLength = 20; 191 | footer1.MaxLength = 20; 192 | footer2.MaxLength = 20; 193 | }else{ 194 | japanese = false; 195 | regionlab.Text = "USA/EUR"; 196 | header1.MaxLength = 40; 197 | header2.MaxLength = 40; 198 | body1.MaxLength = 40; 199 | body2.MaxLength = 40; 200 | body3.MaxLength = 40; 201 | body4.MaxLength = 40; 202 | footer1.MaxLength = 40; 203 | footer2.MaxLength = 40; 204 | } 205 | 206 | wc3_path.Text = path; 207 | wc3file = new wc3(wc3buffer); 208 | 209 | update_wcdata(); 210 | 211 | save_wc3_but.Enabled = true; 212 | export_script_but.Enabled = true; 213 | import_script_but.Enabled = true; 214 | xse_export.Enabled = true; 215 | xse_import.Enabled = true; 216 | custom_script.Checked = false; 217 | 218 | drawCard(); 219 | 220 | }else{ 221 | MessageBox.Show("Invalid file size."); 222 | } 223 | } 224 | 225 | void Load_wc3_butClick(object sender, EventArgs e) 226 | { 227 | Load_WC3(null); 228 | } 229 | void Save_wc3_butClick(object sender, EventArgs e) 230 | { 231 | if (faketoogle.Checked) 232 | wc3file.fakeWC(); 233 | //wc3file.fakeSCript(); 234 | //wc3file.clean_trash(); 235 | wc3file.set_wc_icon((UInt16)icon_num.Value); 236 | int distro = 0; 237 | if (distro_but_always.Checked) 238 | distro = 1; 239 | else if (distro_but_one.Checked) 240 | distro = 2; 241 | else 242 | distro = 0; 243 | wc3file.set_wc_color_distro(colorbox.SelectedIndex , distro); 244 | set_wcdata(); 245 | wc3file.fix_script_checksum(); 246 | wc3file.fix_wc_checksum(); 247 | if (wc3file.Edited) 248 | FileIO.save_data(wc3file.Data, wc3filter); 249 | else MessageBox.Show("Save has not been edited"); 250 | } 251 | void Export_script_butClick(object sender, EventArgs e) 252 | { 253 | FileIO.save_data(wc3file.get_script(), scriptfilter); 254 | } 255 | void Import_script_butClick(object sender, EventArgs e) 256 | { 257 | string path = null; 258 | int filesize = FileIO.load_file(ref wc3script_new, ref path, scriptfilter); 259 | if( filesize <= 996 ) 260 | { 261 | wc3file.set_script(wc3script_new); 262 | custom_script.Checked = true; 263 | MessageBox.Show("Custom script imported."); 264 | 265 | }else{ 266 | MessageBox.Show("Invalid file size."); 267 | } 268 | } 269 | void IconboxSelectedIndexChanged(object sender, EventArgs e) 270 | { 271 | if (iconbox.SelectedIndex == 0) 272 | icon_num.Value = 0xFFFF; 273 | else if(iconbox.SelectedIndex > 251) 274 | icon_num.Value = iconbox.SelectedIndex; 275 | else 276 | icon_num.Value = iconbox.SelectedIndex; 277 | } 278 | void Icon_numValueChanged(object sender, EventArgs e) 279 | { 280 | update_iconbox(); 281 | drawCard(); 282 | } 283 | void WC3_editorLoad(object sender, EventArgs e) 284 | { 285 | 286 | } 287 | void GiveEgg_butClick(object sender, EventArgs e) 288 | { 289 | Form giveEeg = new WC3_editor_givegg(); 290 | giveEeg.ShowDialog(); 291 | if (script_injected) 292 | { 293 | script_injected = false; 294 | custom_script.Checked = true; 295 | MessageBox.Show("Give Egg script injected."); 296 | } 297 | } 298 | void ColorboxSelectedIndexChanged(object sender, EventArgs e) 299 | { 300 | drawCard(); 301 | } 302 | ResourceManager resources = new ResourceManager("WC3Tool.WC3.Image.Cards", Assembly.GetExecutingAssembly()); 303 | ResourceManager resources2 = new ResourceManager("WC3Tool.WC3.Image.Icons", Assembly.GetExecutingAssembly()); 304 | Image bitmap2; 305 | Image bitmap; 306 | void drawCard() 307 | { 308 | bitmap = (Image)resources.GetObject("Card_"+colorbox.SelectedIndex); 309 | GFX.DrawImage(bitmap, 501, 141, 238, 158); 310 | 311 | if (icon_num.Value <= 251 || icon_num.Value >= 277 && icon_num.Value <= 411) 312 | { 313 | bitmap2 = (Image)resources2.GetObject(SpeciesConverter.GetG4Species((int)icon_num.Value).ToString()); 314 | GFX.DrawImage(bitmap2, 700, 140, 40, 40); 315 | }else if (icon_num.Value >= 412 && icon_num.Value <= 439) // Egg and unown forms 316 | { 317 | bitmap2 = (Bitmap)resources2.GetObject(icon_num.Value.ToString()); 318 | GFX.DrawImage(bitmap2, 700, 140, 40, 40); 319 | }else 320 | { 321 | bitmap2 = (Bitmap)resources2.GetObject("0"); 322 | GFX.DrawImage(bitmap2, 700, 140, 40, 40); 323 | } 324 | 325 | 326 | GFX.DrawString(header1.Text, new Font("Calibri", 8), Brushes.Black, 500+10+1, 140+12); 327 | GFX.DrawString(header2.Text, new Font("Calibri", 8), Brushes.Black, 500+10+1, 140+28); 328 | GFX.DrawString(body1.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+50); 329 | GFX.DrawString(body2.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+66); 330 | GFX.DrawString(body3.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+82); 331 | GFX.DrawString(body4.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+98); 332 | GFX.DrawString(footer1.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+122); 333 | GFX.DrawString(footer2.Text, new Font("Calibri", 8), Brushes.Black, 500+5+1, 140+138); 334 | 335 | } 336 | void Header1TextChanged(object sender, EventArgs e) 337 | { 338 | drawCard(); 339 | } 340 | void Header2TextChanged(object sender, EventArgs e) 341 | { 342 | drawCard(); 343 | } 344 | void Body1TextChanged(object sender, EventArgs e) 345 | { 346 | drawCard(); 347 | } 348 | void Body2TextChanged(object sender, EventArgs e) 349 | { 350 | drawCard(); 351 | } 352 | void Body3TextChanged(object sender, EventArgs e) 353 | { 354 | drawCard(); 355 | } 356 | void Body4TextChanged(object sender, EventArgs e) 357 | { 358 | drawCard(); 359 | } 360 | void Footer1TextChanged(object sender, EventArgs e) 361 | { 362 | drawCard(); 363 | } 364 | void Footer2TextChanged(object sender, EventArgs e) 365 | { 366 | drawCard(); 367 | } 368 | void Map_helpClick(object sender, EventArgs e) 369 | { 370 | MessageBox.Show("These values are used to associate the script to a NPC character in the game.\n\nYou can use Advance Map to locate the values for all NPC in the game.\n\nIn Emerald, father at petalburg Gym is Bank 08, Map 01, NPC 01.\n\n For Wondercard Deliveryman set all to 255"); 371 | } 372 | void Xse_helpClick(object sender, EventArgs e) 373 | { 374 | MessageBox.Show("XSE Export: exports the script with padding corresponding to base address of the script and *.gba extension. You can directly load (and edit) the script in XSE, script offset will be shown when using the export button.\nXSE Import: imports a *.gba script generated by this tool after editing (or not) with XSE (importing anything else will not correctly work).\n\nThese options are just for convenience, the scripts are in no way gba roms, but it's the more convenient way to edit them in XSE."); 375 | } 376 | void Xse_exportClick(object sender, EventArgs e) 377 | { 378 | FileIO.save_data(wc3file.get_script_XSE(), xsescriptfilter); 379 | } 380 | void Xse_importClick(object sender, EventArgs e) 381 | { 382 | string path = null; 383 | int filesize = FileIO.load_file(ref wc3script_new, ref path, xsescriptfilter); 384 | if( filesize <= 1000 ) 385 | { 386 | wc3file.set_script_XSE(wc3script_new); 387 | custom_script.Checked = true; 388 | MessageBox.Show("Custom script imported."); 389 | 390 | }else{ 391 | MessageBox.Show("Invalid file size."); 392 | } 393 | } 394 | void GiveEggExt_butClick(object sender, EventArgs e) 395 | { 396 | Form giveEegExt = new WC3_editor_giveggExt(); 397 | giveEegExt.ShowDialog(); 398 | if (script_injected) 399 | { 400 | script_injected = false; 401 | custom_script.Checked = true; 402 | MessageBox.Show("Give Egg script injected."); 403 | } 404 | } 405 | 406 | void WC3_editorDragEnter(object sender, DragEventArgs e) 407 | { 408 | e.Effect = DragDropEffects.All; 409 | } 410 | void WC3_editorDragDrop(object sender, DragEventArgs e) 411 | { 412 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); 413 | Load_WC3(files[0]); 414 | } 415 | 416 | } 417 | } 418 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor_givegg.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 07/05/2016 5 | * Time: 21:27 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | using System.Windows.Forms; 12 | using System.Reflection; 13 | using System.Resources; 14 | 15 | namespace WC3Tool 16 | { 17 | /// 18 | /// Description of WC3_editor_givegg. 19 | /// 20 | public partial class WC3_editor_givegg : Form 21 | { 22 | public WC3_editor_givegg() 23 | { 24 | // 25 | // The InitializeComponent() call is required for Windows Forms designer support. 26 | // 27 | InitializeComponent(); 28 | game_box.SelectedIndex = 0; 29 | lang_box.SelectedIndex = 1; 30 | species_box.SelectedIndex = 172; 31 | move_box.SelectedIndex = 0x39; 32 | /* 33 | ResourceManager resources = new ResourceManager("Namespace.ResourceFile", Assembly.GetExecutingAssembly()); 34 | byte[] fileData = (byte[])ResourceManager.GetObject("Test.dat"); 35 | Bitmap bitmap = (Bitmap)ResourceManager.GetObject("Image"); 36 | */ 37 | //byte[] fileData = (byte[]) EggScripts.GetObject("ROM"+game+"GiveEgg"+lang); 38 | // 39 | // TODO: Add constructor code after the InitializeComponent() call. 40 | // 41 | } 42 | void Save_butClick(object sender, EventArgs e) 43 | { 44 | string game; 45 | if (game_box.SelectedIndex == 1) 46 | game = "FR"; 47 | else 48 | game = "E"; 49 | 50 | string lang = "Eng"; 51 | switch (lang_box.SelectedIndex) 52 | { 53 | case 0: 54 | lang = "Jap"; 55 | break; 56 | case 1: 57 | lang = "Eng"; 58 | break; 59 | case 2: 60 | lang = "Fre"; 61 | break; 62 | case 3: 63 | lang = "Ita"; 64 | break; 65 | case 4: 66 | lang = "Deu"; 67 | break; 68 | case 5: 69 | lang = "Esp"; 70 | break; 71 | } 72 | //MessageBox.Show("ROM_"+game+"_GiveEgg_"+lang); 73 | ResourceManager EggScripts = new ResourceManager("WC3Tool.WC3.GiveEggOrg", Assembly.GetExecutingAssembly()); 74 | byte[] egg_script = (byte[]) EggScripts.GetObject("ROM_"+game+"_GiveEgg_"+lang); 75 | //byte[] egg_script = (byte[]) EggScripts.GetObject("ROM_FR_GiveEgg_Esp"); 76 | 77 | UInt16 move; 78 | move = (UInt16)move_box.SelectedIndex; 79 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x86); 80 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x8C); 81 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x92); 82 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x98); 83 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x9E); 84 | 85 | UInt16 species; 86 | species = (UInt16)species_box.SelectedIndex; 87 | BitConverter.GetBytes(species).ToArray().CopyTo(egg_script, 0x42); 88 | 89 | WC3_editor.wc3file.set_script(egg_script); 90 | WC3_editor.script_injected = true; 91 | 92 | Close(); 93 | } 94 | void Cancel_butClick(object sender, EventArgs e) 95 | { 96 | Close(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor_givegg.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor_giveggExt.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 07/05/2016 5 | * Time: 21:27 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Linq; 11 | using System.Windows.Forms; 12 | using System.Reflection; 13 | using System.Resources; 14 | 15 | namespace WC3Tool 16 | { 17 | /// 18 | /// Description of WC3_editor_givegg. 19 | /// 20 | public partial class WC3_editor_giveggExt : Form 21 | { 22 | public WC3_editor_giveggExt() 23 | { 24 | // 25 | // The InitializeComponent() call is required for Windows Forms designer support. 26 | // 27 | InitializeComponent(); 28 | game_box.SelectedIndex = 0; 29 | lang_box.SelectedIndex = 1; 30 | species_box.SelectedIndex = 172; 31 | move_box.SelectedIndex = 0x39; 32 | move2.SelectedIndex = 0x39; 33 | move3.SelectedIndex = 0x39; 34 | move4.SelectedIndex = 0x39; 35 | /* 36 | ResourceManager resources = new ResourceManager("Namespace.ResourceFile", Assembly.GetExecutingAssembly()); 37 | byte[] fileData = (byte[])ResourceManager.GetObject("Test.dat"); 38 | Bitmap bitmap = (Bitmap)ResourceManager.GetObject("Image"); 39 | */ 40 | //byte[] fileData = (byte[]) EggScripts.GetObject("ROM"+game+"GiveEgg"+lang); 41 | // 42 | // TODO: Add constructor code after the InitializeComponent() call. 43 | // 44 | } 45 | void Save_butClick(object sender, EventArgs e) 46 | { 47 | string game; 48 | if (game_box.SelectedIndex == 1) 49 | game = "FR"; 50 | else 51 | game = "E"; 52 | 53 | string lang = "Eng"; 54 | switch (lang_box.SelectedIndex) 55 | { 56 | case 0: 57 | lang = "Jap"; 58 | break; 59 | case 1: 60 | lang = "Eng"; 61 | break; 62 | case 2: 63 | lang = "Fre"; 64 | break; 65 | case 3: 66 | lang = "Ita"; 67 | break; 68 | case 4: 69 | lang = "Deu"; 70 | break; 71 | case 5: 72 | lang = "Esp"; 73 | break; 74 | } 75 | //MessageBox.Show("ROM_"+game+"_GiveEgg_"+lang); 76 | ResourceManager EggScripts = new ResourceManager("WC3Tool.WC3.GiveEggOrg", Assembly.GetExecutingAssembly()); 77 | byte[] egg_script; 78 | 79 | if (killscript.Checked) 80 | egg_script =(byte[]) EggScripts.GetObject("ROM_"+game+"_GiveEgg_"+lang+"_4moves_kill"); 81 | else 82 | egg_script = (byte[]) EggScripts.GetObject("ROM_"+game+"_GiveEgg_"+lang+"_4moves"); 83 | 84 | UInt16 move; 85 | UInt16 move_2; 86 | UInt16 move_3; 87 | UInt16 move_4; 88 | 89 | int offset = 4;//Embedded scripts have a 4 byte padding 90 | if (killscript.Checked) 91 | { 92 | egg_script[0x5+offset] = 0x00; //Remove jumpram command, I should technically update the embedded script files instead of doing this... 93 | offset -= 0xF;//Killscript version is 0xF bytes shorter 94 | } 95 | move = (UInt16)move_box.SelectedIndex; 96 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0xB1+offset); 97 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0xC7+offset); 98 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0xDD+offset); 99 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0xF3+offset); 100 | BitConverter.GetBytes(move).ToArray().CopyTo(egg_script, 0x109+offset); 101 | 102 | offset+=5; 103 | move_2 = (UInt16)move2.SelectedIndex; 104 | BitConverter.GetBytes(move_2).ToArray().CopyTo(egg_script, 0xB1+offset); 105 | BitConverter.GetBytes(move_2).ToArray().CopyTo(egg_script, 0xC7+offset); 106 | BitConverter.GetBytes(move_2).ToArray().CopyTo(egg_script, 0xDD+offset); 107 | BitConverter.GetBytes(move_2).ToArray().CopyTo(egg_script, 0xF3+offset); 108 | BitConverter.GetBytes(move_2).ToArray().CopyTo(egg_script, 0x109+offset); 109 | 110 | offset+=5; 111 | move_3 = (UInt16)move3.SelectedIndex; 112 | BitConverter.GetBytes(move_3).ToArray().CopyTo(egg_script, 0xB1+offset); 113 | BitConverter.GetBytes(move_3).ToArray().CopyTo(egg_script, 0xC7+offset); 114 | BitConverter.GetBytes(move_3).ToArray().CopyTo(egg_script, 0xDD+offset); 115 | BitConverter.GetBytes(move_3).ToArray().CopyTo(egg_script, 0xF3+offset); 116 | BitConverter.GetBytes(move_3).ToArray().CopyTo(egg_script, 0x109+offset); 117 | 118 | offset+=5; 119 | move_4 = (UInt16)move4.SelectedIndex; 120 | BitConverter.GetBytes(move_4).ToArray().CopyTo(egg_script, 0xB1+offset); 121 | BitConverter.GetBytes(move_4).ToArray().CopyTo(egg_script, 0xC7+offset); 122 | BitConverter.GetBytes(move_4).ToArray().CopyTo(egg_script, 0xDD+offset); 123 | BitConverter.GetBytes(move_4).ToArray().CopyTo(egg_script, 0xF3+offset); 124 | BitConverter.GetBytes(move_4).ToArray().CopyTo(egg_script, 0x109+offset); 125 | 126 | UInt16 species; 127 | species = (UInt16)species_box.SelectedIndex; 128 | if (killscript.Checked) 129 | BitConverter.GetBytes(species).ToArray().CopyTo(egg_script, 0x5D+4); 130 | else 131 | BitConverter.GetBytes(species).ToArray().CopyTo(egg_script, 0x6C+4); 132 | 133 | //Because script files embedded have a 4 byte padding for XSE editing...and I'm lazy to strip those 4 bytes 134 | WC3_editor.wc3file.set_script(egg_script.Skip(4).Take(996).ToArray()); 135 | WC3_editor.script_injected = true; 136 | 137 | Close(); 138 | } 139 | void Cancel_butClick(object sender, EventArgs e) 140 | { 141 | Close(); 142 | } 143 | void Script_helpClick(object sender, EventArgs e) 144 | { 145 | MessageBox.Show("Use rom event flag: the script will use the flag that the Egg event found in the ROM uses to mark the EGG as received. The wondercard will be able to be sent and the receiver will be able to receive an egg (if the savegame still has the flag unset).\n\nKillscript: no flags are set in the savegame, so the only outcome is that the egg is received. The script gets erased from the savegame, so sharing the wondercard won't allow receiver to get an egg."); 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WC3_editor_giveggExt.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WCN_editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: suloku 4 | * Date: 28/04/2016 5 | * Time: 21:22 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Drawing; 11 | using System.Windows.Forms; 12 | using System.Reflection; 13 | using System.Resources; 14 | 15 | namespace WC3Tool 16 | { 17 | /// 18 | /// Description of MainForm. 19 | /// 20 | public partial class WCN_editor : Form 21 | { 22 | public WCN_editor() 23 | { 24 | // 25 | // The InitializeComponent() call is required for Windows Forms designer support. 26 | // 27 | InitializeComponent(); 28 | regionlab.Text = ""; 29 | GFX = CreateGraphics(); 30 | colorbox.SelectedIndex = 0; 31 | 32 | // 33 | // TODO: Add constructor code after the InitializeComponent() call. 34 | // 35 | } 36 | public string wcnfilter = "Wonder News file|*.wn3|All Files (*.*)|*.*"; 37 | public byte[] wcnbuffer = new byte[SAV3.WCN_SIZE]; 38 | public static wc3 wcnfile; 39 | 40 | public bool japanese; 41 | 42 | private Graphics GFX; 43 | 44 | void update_wcdata() 45 | { 46 | switch (wcnfile.distributable) 47 | { 48 | case 0: 49 | distrocheck.Checked = false; 50 | break; 51 | case 1: 52 | distrocheck.Checked = true; 53 | break; 54 | default: 55 | distrocheck.Checked = false; 56 | break; 57 | } 58 | 59 | colorbox.SelectedIndex = wcnfile.cardcolor; 60 | 61 | header1.Text = wcnfile.get_wn_text_2(0); 62 | body1.Text = wcnfile.get_wn_text_2(1); 63 | body2.Text = wcnfile.get_wn_text_2(2); 64 | body3.Text = wcnfile.get_wn_text_2(3); 65 | body4.Text = wcnfile.get_wn_text_2(4); 66 | body5.Text = wcnfile.get_wn_text_2(5); 67 | body6.Text = wcnfile.get_wn_text_2(6); 68 | body7.Text = wcnfile.get_wn_text_2(7); 69 | body8.Text = wcnfile.get_wn_text_2(8); 70 | body9.Text = wcnfile.get_wn_text_2(9); 71 | body10.Text = wcnfile.get_wn_text_2(10); 72 | } 73 | void set_wcndata() 74 | { 75 | wcnfile.clear_wn_text(); 76 | wcnfile.insert_wn_text_2(header1.Text, 0); 77 | wcnfile.insert_wn_text_2(body1.Text, 1); 78 | wcnfile.insert_wn_text_2(body2.Text, 2); 79 | wcnfile.insert_wn_text_2(body3.Text, 3); 80 | wcnfile.insert_wn_text_2(body4.Text, 4); 81 | wcnfile.insert_wn_text_2(body5.Text, 5); 82 | wcnfile.insert_wn_text_2(body6.Text, 6); 83 | wcnfile.insert_wn_text_2(body7.Text, 7); 84 | wcnfile.insert_wn_text_2(body8.Text, 8); 85 | wcnfile.insert_wn_text_2(body9.Text, 9); 86 | wcnfile.insert_wn_text_2(body10.Text,10); 87 | } 88 | 89 | void Load_WCN(string path) 90 | { 91 | int filesize = FileIO.load_file(ref wcnbuffer, ref path, wcnfilter); 92 | if( filesize == SAV3.WCN_SIZE || filesize == SAV3.WCN_SIZE_jap) 93 | { 94 | if (filesize == SAV3.WCN_SIZE_jap) 95 | { 96 | japanese = true; 97 | regionlab.Text = "JAP"; 98 | header1.MaxLength = 20; 99 | body1.MaxLength = 20; 100 | body2.MaxLength = 20; 101 | body3.MaxLength = 20; 102 | body4.MaxLength = 20; 103 | body5.MaxLength = 20; 104 | body6.MaxLength = 20; 105 | body7.MaxLength = 20; 106 | body8.MaxLength = 20; 107 | body9.MaxLength = 20; 108 | body10.MaxLength = 20; 109 | }else 110 | { 111 | japanese = false; 112 | regionlab.Text = "USA/EUR"; 113 | header1.MaxLength = 40; 114 | body1.MaxLength = 40; 115 | body2.MaxLength = 40; 116 | body3.MaxLength = 40; 117 | body4.MaxLength = 40; 118 | body5.MaxLength = 40; 119 | body6.MaxLength = 40; 120 | body7.MaxLength = 40; 121 | body8.MaxLength = 40; 122 | body9.MaxLength = 40; 123 | body10.MaxLength = 40; 124 | } 125 | 126 | wc3_path.Text = path; 127 | wcnfile = new wc3(wcnbuffer); 128 | 129 | update_wcdata(); 130 | 131 | save_wc3_but.Enabled = true; 132 | 133 | }else{ 134 | MessageBox.Show("Invalid file size."); 135 | } 136 | } 137 | void Load_wc3_butClick(object sender, EventArgs e) 138 | { 139 | Load_WCN(null); 140 | } 141 | void Save_wc3_butClick(object sender, EventArgs e) 142 | { 143 | int distro = 0; 144 | if(distrocheck.Checked) 145 | distro = 1; 146 | wcnfile.set_wcn_color_distro(colorbox.SelectedIndex , distro); 147 | set_wcndata(); 148 | wcnfile.fix_wcn_checksum(); 149 | //if (wcnfile.Edited) 150 | FileIO.save_data(wcnfile.Data, wcnfilter); 151 | //else MessageBox.Show("Save has not been edited"); 152 | } 153 | 154 | void WCN_editorLoad(object sender, EventArgs e) 155 | { 156 | 157 | } 158 | ResourceManager resources = new ResourceManager("WC3Tool.WC3.Image.Cards", Assembly.GetExecutingAssembly()); 159 | Image bitmap; 160 | void drawCard() 161 | { 162 | //ResourceManager resources = new ResourceManager("WC3Tool.WC3.Image.Cards", Assembly.GetExecutingAssembly()); 163 | bitmap = (Image)resources.GetObject("News_"+colorbox.SelectedIndex); 164 | GFX.DrawImage(bitmap, 500, 140+26, 260, 140); 165 | GFX.DrawImage(bitmap, 500, 140, 260, 140); 166 | 167 | 168 | GFX.DrawString(header1.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+4); 169 | GFX.DrawString(body1.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21); 170 | GFX.DrawString(body2.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*1); 171 | GFX.DrawString(body3.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*2); 172 | GFX.DrawString(body4.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*3); 173 | GFX.DrawString(body5.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*4); 174 | GFX.DrawString(body6.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*5); 175 | GFX.DrawString(body7.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*6); 176 | GFX.DrawString(body8.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*7); 177 | GFX.DrawString(body9.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*8); 178 | GFX.DrawString(body10.Text, new Font("Calibri", 8), Brushes.Black, 500+7, 140+21+14*9); 179 | 180 | } 181 | void ColorboxSelectedIndexChanged(object sender, EventArgs e) 182 | { 183 | drawCard(); 184 | } 185 | void Header1TextChanged(object sender, EventArgs e) 186 | { 187 | drawCard(); 188 | } 189 | void Body1TextChanged(object sender, EventArgs e) 190 | { 191 | drawCard(); 192 | } 193 | void Body2TextChanged(object sender, EventArgs e) 194 | { 195 | drawCard(); 196 | } 197 | void Body3TextChanged(object sender, EventArgs e) 198 | { 199 | drawCard(); 200 | } 201 | void Body4TextChanged(object sender, EventArgs e) 202 | { 203 | drawCard(); 204 | } 205 | void Body5TextChanged(object sender, EventArgs e) 206 | { 207 | drawCard(); 208 | } 209 | void Body6TextChanged(object sender, EventArgs e) 210 | { 211 | drawCard(); 212 | } 213 | void Body7TextChanged(object sender, EventArgs e) 214 | { 215 | drawCard(); 216 | } 217 | void Body8TextChanged(object sender, EventArgs e) 218 | { 219 | drawCard(); 220 | } 221 | void Body9TextChanged(object sender, EventArgs e) 222 | { 223 | drawCard(); 224 | } 225 | void Body10TextChanged(object sender, EventArgs e) 226 | { 227 | drawCard(); 228 | } 229 | 230 | void WCN_editorDragEnter(object sender, DragEventArgs e) 231 | { 232 | e.Effect = DragDropEffects.All; 233 | } 234 | void WCN_editorDragDrop(object sender, DragEventArgs e) 235 | { 236 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); 237 | Load_WCN(files[0]); 238 | } 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /WC3Tool/WC3/WCN_editor.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | text/microsoft-resx 111 | 112 | 113 | 2.0 114 | 115 | 116 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 117 | PublicKeyToken=b77a5c561934e089 118 | 119 | 120 | 121 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 122 | PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /WC3Tool/WC3Tool.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {1E65C335-2DE3-410B-B713-5F7B023106CD} 5 | {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 6 | Debug 7 | AnyCPU 8 | WinExe 9 | WC3Tool 10 | WC3Tool 11 | v4.7.2 12 | Properties 13 | 8.0.30703 14 | 2.0 15 | 16 | 17 | 18 | x86 19 | 20 | 21 | bin\Debug\ 22 | True 23 | Full 24 | False 25 | True 26 | DEBUG;TRACE 27 | 28 | 29 | bin\Release\ 30 | False 31 | None 32 | True 33 | False 34 | TRACE 35 | 36 | 37 | 7.1 38 | 39 | 40 | 7.1 41 | x64 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Form 61 | 62 | 63 | EventTool.cs 64 | 65 | 66 | Form 67 | 68 | 69 | MainScreen.cs 70 | 71 | 72 | Form 73 | 74 | 75 | Decor_editor.cs 76 | 77 | 78 | 79 | Form 80 | 81 | 82 | ECB_editor.cs 83 | 84 | 85 | 86 | Form 87 | 88 | 89 | ECT_editor.cs 90 | 91 | 92 | 93 | Form 94 | 95 | 96 | ECT_pkedit.cs 97 | 98 | 99 | 100 | Form 101 | 102 | 103 | ME3_editor.cs 104 | 105 | 106 | 107 | 108 | 109 | 110 | Form 111 | 112 | 113 | TV_editor.cs 114 | 115 | 116 | Form 117 | 118 | 119 | WC3_editor.cs 120 | 121 | 122 | 123 | 124 | 125 | 126 | Form 127 | 128 | 129 | WC3_editor_givegg.cs 130 | 131 | 132 | Form 133 | 134 | 135 | WC3_editor_giveggExt.cs 136 | 137 | 138 | Form 139 | 140 | 141 | WCN_editor.cs 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | EventTool.cs 151 | 152 | 153 | MainScreen.cs 154 | 155 | 156 | Decor_editor.cs 157 | 158 | 159 | ECB_editor.cs 160 | 161 | 162 | ECT_editor.cs 163 | 164 | 165 | ECT_pkedit.cs 166 | 167 | 168 | 169 | 170 | 171 | ME3_editor.cs 172 | 173 | 174 | 175 | TV_editor.cs 176 | 177 | 178 | WC3_editor.cs 179 | 180 | 181 | WC3_editor_givegg.cs 182 | 183 | 184 | WC3_editor_giveggExt.cs 185 | 186 | 187 | WCN_editor.cs 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /WC3Tool/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------