├── .gitignore ├── PalEditor.sln ├── PalEditor ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── FormAbout.Designer.cs ├── FormAbout.cs ├── FormAbout.resx ├── FormMagic.Designer.cs ├── FormMagic.cs ├── FormMagic.resx ├── PalEditor.csproj ├── PalExp.cs ├── PalGoods.cs ├── PalMagic.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── RPGData.cs ├── sdlpal.ico └── 法术列表.txt ├── README.md └── changelog.md /.gitignore: -------------------------------------------------------------------------------- 1 | /PalEditor.sln.DotSettings.user 2 | /PalEditor/bin 3 | /PalEditor/obj 4 | /.idea/ -------------------------------------------------------------------------------- /PalEditor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PalEditor", "PalEditor\PalEditor.csproj", "{8B2960CF-B76C-465F-A246-E9B7CEB1C395}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {8B2960CF-B76C-465F-A246-E9B7CEB1C395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {8B2960CF-B76C-465F-A246-E9B7CEB1C395}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {8B2960CF-B76C-465F-A246-E9B7CEB1C395}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {8B2960CF-B76C-465F-A246-E9B7CEB1C395}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /PalEditor/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PalEditor/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PalEditor 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | private System.Windows.Forms.MainMenu mainMenu1; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); 33 | this.mainMenu1 = new System.Windows.Forms.MainMenu(); 34 | this.menuItemMain = new System.Windows.Forms.MenuItem(); 35 | this.menuItemOpen = new System.Windows.Forms.MenuItem(); 36 | this.menuItem1 = new System.Windows.Forms.MenuItem(); 37 | this.menuItem2 = new System.Windows.Forms.MenuItem(); 38 | this.menuItem3 = new System.Windows.Forms.MenuItem(); 39 | this.menuItem4 = new System.Windows.Forms.MenuItem(); 40 | this.menuItem6 = new System.Windows.Forms.MenuItem(); 41 | this.menuItemSave = new System.Windows.Forms.MenuItem(); 42 | this.menuItem5 = new System.Windows.Forms.MenuItem(); 43 | this.menuItemExit = new System.Windows.Forms.MenuItem(); 44 | this.menuItemAbout = new System.Windows.Forms.MenuItem(); 45 | this.tabControl1 = new System.Windows.Forms.TabControl(); 46 | this.tabPage1 = new System.Windows.Forms.TabPage(); 47 | this.buttonMagic = new System.Windows.Forms.Button(); 48 | this.textBoxExp = new System.Windows.Forms.TextBox(); 49 | this.textBoxNowRank = new System.Windows.Forms.TextBox(); 50 | this.label15 = new System.Windows.Forms.Label(); 51 | this.label7 = new System.Windows.Forms.Label(); 52 | this.textBoxLuck = new System.Windows.Forms.TextBox(); 53 | this.textBoxSpeed = new System.Windows.Forms.TextBox(); 54 | this.textBoxDefence = new System.Windows.Forms.TextBox(); 55 | this.textBoxWakan = new System.Windows.Forms.TextBox(); 56 | this.textBoxPower = new System.Windows.Forms.TextBox(); 57 | this.textBoxMaxMp = new System.Windows.Forms.TextBox(); 58 | this.textBoxMp = new System.Windows.Forms.TextBox(); 59 | this.textBoxMaxHp = new System.Windows.Forms.TextBox(); 60 | this.textBoxHp = new System.Windows.Forms.TextBox(); 61 | this.label14 = new System.Windows.Forms.Label(); 62 | this.label13 = new System.Windows.Forms.Label(); 63 | this.label12 = new System.Windows.Forms.Label(); 64 | this.label11 = new System.Windows.Forms.Label(); 65 | this.label10 = new System.Windows.Forms.Label(); 66 | this.label9 = new System.Windows.Forms.Label(); 67 | this.label8 = new System.Windows.Forms.Label(); 68 | this.label6 = new System.Windows.Forms.Label(); 69 | this.label5 = new System.Windows.Forms.Label(); 70 | this.label4 = new System.Windows.Forms.Label(); 71 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 72 | this.tabPage2 = new System.Windows.Forms.TabPage(); 73 | this.buttonGoods = new System.Windows.Forms.Button(); 74 | this.labelGoods = new System.Windows.Forms.Label(); 75 | this.textBoxGoods = new System.Windows.Forms.TextBox(); 76 | this.checkBoxGoods = new System.Windows.Forms.CheckBox(); 77 | this.dataGridGoods = new System.Windows.Forms.DataGrid(); 78 | this.tabPage3 = new System.Windows.Forms.TabPage(); 79 | this.checkBoxSaveTime = new System.Windows.Forms.CheckBox(); 80 | this.textBoxSaveTime = new System.Windows.Forms.TextBox(); 81 | this.label3 = new System.Windows.Forms.Label(); 82 | this.textBoxCalabash = new System.Windows.Forms.TextBox(); 83 | this.label2 = new System.Windows.Forms.Label(); 84 | this.textBoxMoney = new System.Windows.Forms.TextBox(); 85 | this.label1 = new System.Windows.Forms.Label(); 86 | this.tabControl1.SuspendLayout(); 87 | this.tabPage1.SuspendLayout(); 88 | this.tabPage2.SuspendLayout(); 89 | this.tabPage3.SuspendLayout(); 90 | this.SuspendLayout(); 91 | // 92 | // mainMenu1 93 | // 94 | this.mainMenu1.MenuItems.Add(this.menuItemMain); 95 | this.mainMenu1.MenuItems.Add(this.menuItemAbout); 96 | // 97 | // menuItemMain 98 | // 99 | this.menuItemMain.MenuItems.Add(this.menuItemOpen); 100 | this.menuItemMain.MenuItems.Add(this.menuItemSave); 101 | this.menuItemMain.MenuItems.Add(this.menuItem5); 102 | this.menuItemMain.MenuItems.Add(this.menuItemExit); 103 | this.menuItemMain.Text = "菜单(&M)"; 104 | // 105 | // menuItemOpen 106 | // 107 | this.menuItemOpen.MenuItems.Add(this.menuItem1); 108 | this.menuItemOpen.MenuItems.Add(this.menuItem2); 109 | this.menuItemOpen.MenuItems.Add(this.menuItem3); 110 | this.menuItemOpen.MenuItems.Add(this.menuItem4); 111 | this.menuItemOpen.MenuItems.Add(this.menuItem6); 112 | this.menuItemOpen.Text = "打开(&O)"; 113 | // 114 | // menuItem1 115 | // 116 | this.menuItem1.Text = "进度 1"; 117 | this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); 118 | // 119 | // menuItem2 120 | // 121 | this.menuItem2.Text = "进度 2"; 122 | this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); 123 | // 124 | // menuItem3 125 | // 126 | this.menuItem3.Text = "进度 3"; 127 | this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); 128 | // 129 | // menuItem4 130 | // 131 | this.menuItem4.Text = "进度 4"; 132 | this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click); 133 | // 134 | // menuItem6 135 | // 136 | this.menuItem6.Text = "进度 5"; 137 | this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click); 138 | // 139 | // menuItemSave 140 | // 141 | this.menuItemSave.Text = "保存(&S)"; 142 | this.menuItemSave.Click += new System.EventHandler(this.menuItemSave_Click); 143 | // 144 | // menuItem5 145 | // 146 | this.menuItem5.Text = "-"; 147 | // 148 | // menuItemExit 149 | // 150 | this.menuItemExit.Text = "退出(&X)"; 151 | this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click); 152 | // 153 | // menuItemAbout 154 | // 155 | this.menuItemAbout.Text = "关于(&A)"; 156 | this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click); 157 | // 158 | // tabControl1 159 | // 160 | this.tabControl1.Controls.Add(this.tabPage1); 161 | this.tabControl1.Controls.Add(this.tabPage2); 162 | this.tabControl1.Controls.Add(this.tabPage3); 163 | this.tabControl1.Location = new System.Drawing.Point(0, 0); 164 | this.tabControl1.Name = "tabControl1"; 165 | this.tabControl1.SelectedIndex = 0; 166 | this.tabControl1.Size = new System.Drawing.Size(240, 268); 167 | this.tabControl1.TabIndex = 0; 168 | this.tabControl1.Tag = ""; 169 | this.tabControl1.Visible = false; 170 | // 171 | // tabPage1 172 | // 173 | this.tabPage1.Controls.Add(this.buttonMagic); 174 | this.tabPage1.Controls.Add(this.textBoxExp); 175 | this.tabPage1.Controls.Add(this.textBoxNowRank); 176 | this.tabPage1.Controls.Add(this.label15); 177 | this.tabPage1.Controls.Add(this.label7); 178 | this.tabPage1.Controls.Add(this.textBoxLuck); 179 | this.tabPage1.Controls.Add(this.textBoxSpeed); 180 | this.tabPage1.Controls.Add(this.textBoxDefence); 181 | this.tabPage1.Controls.Add(this.textBoxWakan); 182 | this.tabPage1.Controls.Add(this.textBoxPower); 183 | this.tabPage1.Controls.Add(this.textBoxMaxMp); 184 | this.tabPage1.Controls.Add(this.textBoxMp); 185 | this.tabPage1.Controls.Add(this.textBoxMaxHp); 186 | this.tabPage1.Controls.Add(this.textBoxHp); 187 | this.tabPage1.Controls.Add(this.label14); 188 | this.tabPage1.Controls.Add(this.label13); 189 | this.tabPage1.Controls.Add(this.label12); 190 | this.tabPage1.Controls.Add(this.label11); 191 | this.tabPage1.Controls.Add(this.label10); 192 | this.tabPage1.Controls.Add(this.label9); 193 | this.tabPage1.Controls.Add(this.label8); 194 | this.tabPage1.Controls.Add(this.label6); 195 | this.tabPage1.Controls.Add(this.label5); 196 | this.tabPage1.Controls.Add(this.label4); 197 | this.tabPage1.Controls.Add(this.comboBox1); 198 | this.tabPage1.Location = new System.Drawing.Point(0, 0); 199 | this.tabPage1.Name = "tabPage1"; 200 | this.tabPage1.Size = new System.Drawing.Size(240, 245); 201 | this.tabPage1.Text = "人物"; 202 | // 203 | // buttonMagic 204 | // 205 | this.buttonMagic.Location = new System.Drawing.Point(143, 209); 206 | this.buttonMagic.Name = "buttonMagic"; 207 | this.buttonMagic.Size = new System.Drawing.Size(69, 22); 208 | this.buttonMagic.TabIndex = 46; 209 | this.buttonMagic.Text = "仙术"; 210 | this.buttonMagic.Click += new System.EventHandler(this.buttonMagic_Click); 211 | // 212 | // textBoxExp 213 | // 214 | this.textBoxExp.Location = new System.Drawing.Point(143, 43); 215 | this.textBoxExp.Name = "textBoxExp"; 216 | this.textBoxExp.Size = new System.Drawing.Size(68, 21); 217 | this.textBoxExp.TabIndex = 33; 218 | this.textBoxExp.TextChanged += new System.EventHandler(this.textBoxExp_TextChanged); 219 | this.textBoxExp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 220 | this.textBoxExp.LostFocus += new System.EventHandler(this.textBox_LostFocus); 221 | // 222 | // textBoxNowRank 223 | // 224 | this.textBoxNowRank.Location = new System.Drawing.Point(69, 43); 225 | this.textBoxNowRank.Name = "textBoxNowRank"; 226 | this.textBoxNowRank.Size = new System.Drawing.Size(25, 21); 227 | this.textBoxNowRank.TabIndex = 32; 228 | this.textBoxNowRank.TextChanged += new System.EventHandler(this.textBoxNowRank_TextChanged); 229 | this.textBoxNowRank.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 230 | this.textBoxNowRank.LostFocus += new System.EventHandler(this.textBox_LostFocus); 231 | // 232 | // label15 233 | // 234 | this.label15.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular); 235 | this.label15.Location = new System.Drawing.Point(127, 111); 236 | this.label15.Name = "label15"; 237 | this.label15.Size = new System.Drawing.Size(11, 19); 238 | this.label15.Text = "/"; 239 | // 240 | // label7 241 | // 242 | this.label7.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular); 243 | this.label7.Location = new System.Drawing.Point(126, 82); 244 | this.label7.Name = "label7"; 245 | this.label7.Size = new System.Drawing.Size(11, 19); 246 | this.label7.Text = "/"; 247 | // 248 | // textBoxLuck 249 | // 250 | this.textBoxLuck.Location = new System.Drawing.Point(173, 179); 251 | this.textBoxLuck.Name = "textBoxLuck"; 252 | this.textBoxLuck.Size = new System.Drawing.Size(40, 21); 253 | this.textBoxLuck.TabIndex = 28; 254 | this.textBoxLuck.TextChanged += new System.EventHandler(this.textBoxLuck_TextChanged); 255 | this.textBoxLuck.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 256 | this.textBoxLuck.LostFocus += new System.EventHandler(this.textBox_LostFocus); 257 | // 258 | // textBoxSpeed 259 | // 260 | this.textBoxSpeed.Location = new System.Drawing.Point(173, 152); 261 | this.textBoxSpeed.Name = "textBoxSpeed"; 262 | this.textBoxSpeed.Size = new System.Drawing.Size(40, 21); 263 | this.textBoxSpeed.TabIndex = 17; 264 | this.textBoxSpeed.TextChanged += new System.EventHandler(this.textBoxSpeed_TextChanged); 265 | this.textBoxSpeed.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 266 | this.textBoxSpeed.LostFocus += new System.EventHandler(this.textBox_LostFocus); 267 | // 268 | // textBoxDefence 269 | // 270 | this.textBoxDefence.Location = new System.Drawing.Point(71, 206); 271 | this.textBoxDefence.Name = "textBoxDefence"; 272 | this.textBoxDefence.Size = new System.Drawing.Size(40, 21); 273 | this.textBoxDefence.TabIndex = 16; 274 | this.textBoxDefence.TextChanged += new System.EventHandler(this.textBoxDefence_TextChanged); 275 | this.textBoxDefence.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 276 | this.textBoxDefence.LostFocus += new System.EventHandler(this.textBox_LostFocus); 277 | // 278 | // textBoxWakan 279 | // 280 | this.textBoxWakan.Location = new System.Drawing.Point(71, 179); 281 | this.textBoxWakan.Name = "textBoxWakan"; 282 | this.textBoxWakan.Size = new System.Drawing.Size(40, 21); 283 | this.textBoxWakan.TabIndex = 15; 284 | this.textBoxWakan.TextChanged += new System.EventHandler(this.textBoxWakan_TextChanged); 285 | this.textBoxWakan.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 286 | this.textBoxWakan.LostFocus += new System.EventHandler(this.textBox_LostFocus); 287 | // 288 | // textBoxPower 289 | // 290 | this.textBoxPower.Location = new System.Drawing.Point(71, 152); 291 | this.textBoxPower.Name = "textBoxPower"; 292 | this.textBoxPower.Size = new System.Drawing.Size(40, 21); 293 | this.textBoxPower.TabIndex = 14; 294 | this.textBoxPower.TextChanged += new System.EventHandler(this.textBoxPower_TextChanged); 295 | this.textBoxPower.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 296 | this.textBoxPower.LostFocus += new System.EventHandler(this.textBox_LostFocus); 297 | // 298 | // textBoxMaxMp 299 | // 300 | this.textBoxMaxMp.Location = new System.Drawing.Point(142, 111); 301 | this.textBoxMaxMp.Name = "textBoxMaxMp"; 302 | this.textBoxMaxMp.Size = new System.Drawing.Size(40, 21); 303 | this.textBoxMaxMp.TabIndex = 13; 304 | this.textBoxMaxMp.TextChanged += new System.EventHandler(this.textBoxMaxMp_TextChanged); 305 | this.textBoxMaxMp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 306 | this.textBoxMaxMp.LostFocus += new System.EventHandler(this.textBox_LostFocus); 307 | // 308 | // textBoxMp 309 | // 310 | this.textBoxMp.Location = new System.Drawing.Point(82, 111); 311 | this.textBoxMp.Name = "textBoxMp"; 312 | this.textBoxMp.Size = new System.Drawing.Size(40, 21); 313 | this.textBoxMp.TabIndex = 12; 314 | this.textBoxMp.TextChanged += new System.EventHandler(this.textBoxMp_TextChanged); 315 | this.textBoxMp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 316 | this.textBoxMp.LostFocus += new System.EventHandler(this.textBox_LostFocus); 317 | // 318 | // textBoxMaxHp 319 | // 320 | this.textBoxMaxHp.Location = new System.Drawing.Point(142, 83); 321 | this.textBoxMaxHp.Name = "textBoxMaxHp"; 322 | this.textBoxMaxHp.Size = new System.Drawing.Size(40, 21); 323 | this.textBoxMaxHp.TabIndex = 11; 324 | this.textBoxMaxHp.TextChanged += new System.EventHandler(this.textBoxMaxHp_TextChanged); 325 | this.textBoxMaxHp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 326 | this.textBoxMaxHp.LostFocus += new System.EventHandler(this.textBox_LostFocus); 327 | // 328 | // textBoxHp 329 | // 330 | this.textBoxHp.Location = new System.Drawing.Point(82, 84); 331 | this.textBoxHp.Name = "textBoxHp"; 332 | this.textBoxHp.Size = new System.Drawing.Size(40, 21); 333 | this.textBoxHp.TabIndex = 10; 334 | this.textBoxHp.TextChanged += new System.EventHandler(this.textBoxHp_TextChanged); 335 | this.textBoxHp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 336 | this.textBoxHp.LostFocus += new System.EventHandler(this.textBox_LostFocus); 337 | // 338 | // label14 339 | // 340 | this.label14.Location = new System.Drawing.Point(27, 116); 341 | this.label14.Name = "label14"; 342 | this.label14.Size = new System.Drawing.Size(49, 20); 343 | this.label14.Text = "真气:"; 344 | // 345 | // label13 346 | // 347 | this.label13.Location = new System.Drawing.Point(27, 88); 348 | this.label13.Name = "label13"; 349 | this.label13.Size = new System.Drawing.Size(49, 20); 350 | this.label13.Text = "体力:"; 351 | // 352 | // label12 353 | // 354 | this.label12.Location = new System.Drawing.Point(127, 182); 355 | this.label12.Name = "label12"; 356 | this.label12.Size = new System.Drawing.Size(49, 20); 357 | this.label12.Text = "吉运:"; 358 | // 359 | // label11 360 | // 361 | this.label11.Location = new System.Drawing.Point(127, 156); 362 | this.label11.Name = "label11"; 363 | this.label11.Size = new System.Drawing.Size(49, 20); 364 | this.label11.Text = "身法:"; 365 | // 366 | // label10 367 | // 368 | this.label10.Location = new System.Drawing.Point(18, 209); 369 | this.label10.Name = "label10"; 370 | this.label10.Size = new System.Drawing.Size(49, 20); 371 | this.label10.Text = "防御:"; 372 | // 373 | // label9 374 | // 375 | this.label9.Location = new System.Drawing.Point(18, 182); 376 | this.label9.Name = "label9"; 377 | this.label9.Size = new System.Drawing.Size(49, 20); 378 | this.label9.Text = "灵力:"; 379 | // 380 | // label8 381 | // 382 | this.label8.Location = new System.Drawing.Point(18, 155); 383 | this.label8.Name = "label8"; 384 | this.label8.Size = new System.Drawing.Size(49, 20); 385 | this.label8.Text = "武力:"; 386 | // 387 | // label6 388 | // 389 | this.label6.Location = new System.Drawing.Point(107, 45); 390 | this.label6.Name = "label6"; 391 | this.label6.Size = new System.Drawing.Size(49, 20); 392 | this.label6.Text = "经验:"; 393 | // 394 | // label5 395 | // 396 | this.label5.Location = new System.Drawing.Point(27, 45); 397 | this.label5.Name = "label5"; 398 | this.label5.Size = new System.Drawing.Size(49, 20); 399 | this.label5.Text = "修行:"; 400 | // 401 | // label4 402 | // 403 | this.label4.Location = new System.Drawing.Point(39, 9); 404 | this.label4.Name = "label4"; 405 | this.label4.Size = new System.Drawing.Size(47, 20); 406 | this.label4.Text = "人物:"; 407 | // 408 | // comboBox1 409 | // 410 | this.comboBox1.Items.Add("李逍遥"); 411 | this.comboBox1.Items.Add("赵灵儿"); 412 | this.comboBox1.Items.Add("林月如"); 413 | this.comboBox1.Items.Add("巫后"); 414 | this.comboBox1.Items.Add("阿奴"); 415 | this.comboBox1.Location = new System.Drawing.Point(92, 7); 416 | this.comboBox1.Name = "comboBox1"; 417 | this.comboBox1.Size = new System.Drawing.Size(90, 22); 418 | this.comboBox1.TabIndex = 0; 419 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); 420 | this.comboBox1.GotFocus += new System.EventHandler(this.comboBox1_GotFocus); 421 | // 422 | // tabPage2 423 | // 424 | this.tabPage2.Controls.Add(this.buttonGoods); 425 | this.tabPage2.Controls.Add(this.labelGoods); 426 | this.tabPage2.Controls.Add(this.textBoxGoods); 427 | this.tabPage2.Controls.Add(this.checkBoxGoods); 428 | this.tabPage2.Controls.Add(this.dataGridGoods); 429 | this.tabPage2.Location = new System.Drawing.Point(0, 0); 430 | this.tabPage2.Name = "tabPage2"; 431 | this.tabPage2.Size = new System.Drawing.Size(240, 245); 432 | this.tabPage2.Text = "物品"; 433 | // 434 | // buttonGoods 435 | // 436 | this.buttonGoods.Location = new System.Drawing.Point(98, 10); 437 | this.buttonGoods.Name = "buttonGoods"; 438 | this.buttonGoods.Size = new System.Drawing.Size(38, 25); 439 | this.buttonGoods.TabIndex = 16; 440 | this.buttonGoods.Text = "修改"; 441 | this.buttonGoods.Click += new System.EventHandler(this.buttonGoods_Click); 442 | // 443 | // labelGoods 444 | // 445 | this.labelGoods.Location = new System.Drawing.Point(4, 15); 446 | this.labelGoods.Name = "labelGoods"; 447 | this.labelGoods.Size = new System.Drawing.Size(68, 20); 448 | // 449 | // textBoxGoods 450 | // 451 | this.textBoxGoods.Location = new System.Drawing.Point(73, 12); 452 | this.textBoxGoods.MaxLength = 2; 453 | this.textBoxGoods.Name = "textBoxGoods"; 454 | this.textBoxGoods.Size = new System.Drawing.Size(24, 21); 455 | this.textBoxGoods.TabIndex = 14; 456 | this.textBoxGoods.TextChanged += new System.EventHandler(this.textBoxGoods_TextChanged); 457 | this.textBoxGoods.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 458 | // 459 | // checkBoxGoods 460 | // 461 | this.checkBoxGoods.Location = new System.Drawing.Point(140, 13); 462 | this.checkBoxGoods.Name = "checkBoxGoods"; 463 | this.checkBoxGoods.Size = new System.Drawing.Size(95, 20); 464 | this.checkBoxGoods.TabIndex = 13; 465 | this.checkBoxGoods.Text = "全物品99个"; 466 | this.checkBoxGoods.CheckStateChanged += new System.EventHandler(this.checkBoxGoods_CheckStateChanged); 467 | // 468 | // dataGridGoods 469 | // 470 | this.dataGridGoods.BackgroundColor = System.Drawing.Color.White; 471 | this.dataGridGoods.ColumnHeadersVisible = false; 472 | this.dataGridGoods.Dock = System.Windows.Forms.DockStyle.Bottom; 473 | this.dataGridGoods.Location = new System.Drawing.Point(0, 45); 474 | this.dataGridGoods.Name = "dataGridGoods"; 475 | this.dataGridGoods.RowHeadersVisible = false; 476 | this.dataGridGoods.Size = new System.Drawing.Size(240, 200); 477 | this.dataGridGoods.TabIndex = 0; 478 | // 479 | // tabPage3 480 | // 481 | this.tabPage3.Controls.Add(this.checkBoxSaveTime); 482 | this.tabPage3.Controls.Add(this.textBoxSaveTime); 483 | this.tabPage3.Controls.Add(this.label3); 484 | this.tabPage3.Controls.Add(this.textBoxCalabash); 485 | this.tabPage3.Controls.Add(this.label2); 486 | this.tabPage3.Controls.Add(this.textBoxMoney); 487 | this.tabPage3.Controls.Add(this.label1); 488 | this.tabPage3.Location = new System.Drawing.Point(0, 0); 489 | this.tabPage3.Name = "tabPage3"; 490 | this.tabPage3.Size = new System.Drawing.Size(240, 245); 491 | this.tabPage3.Text = "其他"; 492 | // 493 | // checkBoxSaveTime 494 | // 495 | this.checkBoxSaveTime.Location = new System.Drawing.Point(128, 61); 496 | this.checkBoxSaveTime.Name = "checkBoxSaveTime"; 497 | this.checkBoxSaveTime.Size = new System.Drawing.Size(69, 20); 498 | this.checkBoxSaveTime.TabIndex = 7; 499 | this.checkBoxSaveTime.Text = "清零"; 500 | // 501 | // textBoxSaveTime 502 | // 503 | this.textBoxSaveTime.Location = new System.Drawing.Point(97, 62); 504 | this.textBoxSaveTime.Name = "textBoxSaveTime"; 505 | this.textBoxSaveTime.Size = new System.Drawing.Size(26, 21); 506 | this.textBoxSaveTime.TabIndex = 6; 507 | this.textBoxSaveTime.TextChanged += new System.EventHandler(this.textBoxSaveTime_TextChanged); 508 | this.textBoxSaveTime.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 509 | this.textBoxSaveTime.LostFocus += new System.EventHandler(this.textBox_LostFocus); 510 | // 511 | // label3 512 | // 513 | this.label3.Location = new System.Drawing.Point(41, 61); 514 | this.label3.Name = "label3"; 515 | this.label3.Size = new System.Drawing.Size(50, 20); 516 | this.label3.Text = "存盘数:"; 517 | // 518 | // textBoxCalabash 519 | // 520 | this.textBoxCalabash.Location = new System.Drawing.Point(96, 39); 521 | this.textBoxCalabash.Name = "textBoxCalabash"; 522 | this.textBoxCalabash.Size = new System.Drawing.Size(76, 21); 523 | this.textBoxCalabash.TabIndex = 4; 524 | this.textBoxCalabash.TextChanged += new System.EventHandler(this.textBoxCalabash_TextChanged); 525 | this.textBoxCalabash.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 526 | this.textBoxCalabash.LostFocus += new System.EventHandler(this.textBox_LostFocus); 527 | // 528 | // label2 529 | // 530 | this.label2.Location = new System.Drawing.Point(41, 42); 531 | this.label2.Name = "label2"; 532 | this.label2.Size = new System.Drawing.Size(57, 17); 533 | this.label2.Text = "灵葫值:"; 534 | // 535 | // textBoxMoney 536 | // 537 | this.textBoxMoney.Location = new System.Drawing.Point(96, 14); 538 | this.textBoxMoney.MaxLength = 9; 539 | this.textBoxMoney.Name = "textBoxMoney"; 540 | this.textBoxMoney.Size = new System.Drawing.Size(76, 21); 541 | this.textBoxMoney.TabIndex = 1; 542 | this.textBoxMoney.Text = "99999999999999999"; 543 | this.textBoxMoney.TextChanged += new System.EventHandler(this.textBoxMoney_TextChanged); 544 | this.textBoxMoney.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.digit_Handle); 545 | this.textBoxMoney.LostFocus += new System.EventHandler(this.textBox_LostFocus); 546 | // 547 | // label1 548 | // 549 | this.label1.Location = new System.Drawing.Point(41, 17); 550 | this.label1.Name = "label1"; 551 | this.label1.Size = new System.Drawing.Size(37, 20); 552 | this.label1.Text = "金钱:"; 553 | // 554 | // Form1 555 | // 556 | this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 557 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 558 | this.AutoScroll = true; 559 | this.ClientSize = new System.Drawing.Size(240, 268); 560 | this.Controls.Add(this.tabControl1); 561 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 562 | this.Menu = this.mainMenu1; 563 | this.MinimizeBox = false; 564 | this.Name = "Form1"; 565 | this.Text = "仙剑存档修改器"; 566 | this.Load += new System.EventHandler(this.Form1_Load); 567 | this.tabControl1.ResumeLayout(false); 568 | this.tabPage1.ResumeLayout(false); 569 | this.tabPage2.ResumeLayout(false); 570 | this.tabPage3.ResumeLayout(false); 571 | this.ResumeLayout(false); 572 | 573 | } 574 | 575 | #endregion 576 | 577 | private System.Windows.Forms.MenuItem menuItemMain; 578 | private System.Windows.Forms.MenuItem menuItemOpen; 579 | private System.Windows.Forms.MenuItem menuItemAbout; 580 | private System.Windows.Forms.MenuItem menuItem5; 581 | private System.Windows.Forms.MenuItem menuItemExit; 582 | private System.Windows.Forms.TabControl tabControl1; 583 | private System.Windows.Forms.TabPage tabPage1; 584 | private System.Windows.Forms.TabPage tabPage3; 585 | private System.Windows.Forms.MenuItem menuItemSave; 586 | private System.Windows.Forms.TextBox textBoxMoney; 587 | private System.Windows.Forms.Label label1; 588 | private System.Windows.Forms.TextBox textBoxCalabash; 589 | private System.Windows.Forms.Label label2; 590 | private System.Windows.Forms.CheckBox checkBoxSaveTime; 591 | private System.Windows.Forms.TextBox textBoxSaveTime; 592 | private System.Windows.Forms.Label label3; 593 | private System.Windows.Forms.Label label4; 594 | private System.Windows.Forms.ComboBox comboBox1; 595 | private System.Windows.Forms.Label label14; 596 | private System.Windows.Forms.Label label13; 597 | private System.Windows.Forms.Label label12; 598 | private System.Windows.Forms.Label label11; 599 | private System.Windows.Forms.Label label10; 600 | private System.Windows.Forms.Label label9; 601 | private System.Windows.Forms.Label label8; 602 | private System.Windows.Forms.Label label6; 603 | private System.Windows.Forms.Label label5; 604 | private System.Windows.Forms.TextBox textBoxSpeed; 605 | private System.Windows.Forms.TextBox textBoxDefence; 606 | private System.Windows.Forms.TextBox textBoxWakan; 607 | private System.Windows.Forms.TextBox textBoxPower; 608 | private System.Windows.Forms.TextBox textBoxMaxMp; 609 | private System.Windows.Forms.TextBox textBoxMp; 610 | private System.Windows.Forms.TextBox textBoxMaxHp; 611 | private System.Windows.Forms.TextBox textBoxHp; 612 | private System.Windows.Forms.Label label7; 613 | private System.Windows.Forms.TextBox textBoxLuck; 614 | private System.Windows.Forms.TextBox textBoxExp; 615 | private System.Windows.Forms.TextBox textBoxNowRank; 616 | private System.Windows.Forms.Label label15; 617 | private System.Windows.Forms.MenuItem menuItem1; 618 | private System.Windows.Forms.MenuItem menuItem2; 619 | private System.Windows.Forms.MenuItem menuItem3; 620 | private System.Windows.Forms.MenuItem menuItem4; 621 | private System.Windows.Forms.MenuItem menuItem6; 622 | private System.Windows.Forms.TabPage tabPage2; 623 | private System.Windows.Forms.DataGrid dataGridGoods; 624 | private System.Windows.Forms.CheckBox checkBoxGoods; 625 | private System.Windows.Forms.Label labelGoods; 626 | private System.Windows.Forms.TextBox textBoxGoods; 627 | private System.Windows.Forms.Button buttonGoods; 628 | private System.Windows.Forms.Button buttonMagic; 629 | } 630 | } 631 | 632 | -------------------------------------------------------------------------------- /PalEditor/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | 6 | namespace PalEditor 7 | { 8 | public partial class Form1 : Form 9 | { 10 | bool bFileLoaded = false; 11 | System.PlatformID platID; 12 | RPGData rpgData = new RPGData(); 13 | 14 | enum PAL 15 | { 16 | exp = 0x00, 17 | rank, 18 | hp, 19 | maxHp, 20 | mp, 21 | maxMp, 22 | power, 23 | wakan, 24 | defence, 25 | speed, 26 | luck, 27 | money = 0x100, 28 | saveTime, 29 | calabash, 30 | } 31 | 32 | public Form1() 33 | { 34 | InitializeComponent(); 35 | } 36 | 37 | private void menuItemExit_Click(object sender, EventArgs e) 38 | { 39 | Application.Exit(); 40 | } 41 | 42 | private void menuItemAbout_Click(object sender, EventArgs e) 43 | { 44 | FormAbout frmAbout = new FormAbout(); 45 | frmAbout.ShowDialog(); 46 | } 47 | 48 | private void menuItemSave_Click(object sender, EventArgs e) 49 | { 50 | if (this.text2Varibles() == false) 51 | return; 52 | 53 | MessageBoxButtons MBB = MessageBoxButtons.YesNo; 54 | MessageBoxIcon MBI = MessageBoxIcon.Question; 55 | MessageBoxDefaultButton MBDI = MessageBoxDefaultButton.Button1; 56 | switch (MessageBox.Show("是否确定保存修改的内容?", "提示", MBB, MBI, MBDI)) 57 | { 58 | case DialogResult.Yes: 59 | if (checkBoxGoods.Checked) 60 | rpgData.palGoods.allGoods99(); 61 | else 62 | dataGridToGoodsInfo(); 63 | 64 | rpgData.SaveToFile(); 65 | tabControl1.Visible = false; 66 | menuItemSave.Enabled = false; 67 | MessageBox.Show("恭喜您, 存档修改成功!", "信息"); 68 | break; 69 | 70 | case DialogResult.No: 71 | break; 72 | } 73 | } 74 | 75 | private void initialUI() 76 | { 77 | textBoxMoney.Text = rpgData.palMoney.ToString(); 78 | textBoxCalabash.Text = rpgData.palCalabash.ToString(); 79 | textBoxSaveTime.Text = rpgData.palSaveTime.ToString(); 80 | setComboContent(this.comboBox1.SelectedIndex); 81 | initDataGrid(); 82 | } 83 | 84 | private void Form1_Load(object sender, EventArgs e) 85 | { 86 | this.FormBorderStyle = FormBorderStyle.FixedSingle; 87 | 88 | string path; 89 | platID = System.Environment.OSVersion.Platform; 90 | 91 | if (platID == PlatformID.WinCE) 92 | path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName() 93 | .CodeBase); 94 | else 95 | path = System.IO.Directory.GetCurrentDirectory(); 96 | 97 | if (System.IO.File.Exists(path + "\\0.rpg") == false) 98 | { 99 | MessageBoxButtons MBB = MessageBoxButtons.OK; 100 | MessageBoxIcon MBI = MessageBoxIcon.Hand; 101 | MessageBoxDefaultButton MBDB = MessageBoxDefaultButton.Button1; 102 | MessageBox.Show("请将本程序放入仙剑奇侠传Dos版的安装目录中运行, 谢谢! :)", "提示", MBB, MBI, MBDB); 103 | 104 | System.Windows.Forms.Application.Exit(); 105 | return; 106 | } 107 | 108 | checkBoxSaveTime.Checked = false; 109 | checkBoxGoods.Checked = false; 110 | 111 | this.MaximizeBox = false; 112 | tabControl1.Visible = false; 113 | menuItemSave.Enabled = false; 114 | textBoxMoney.MaxLength = 7; 115 | textBoxCalabash.MaxLength = 2; 116 | textBoxSaveTime.MaxLength = 4; 117 | 118 | comboBox1.SelectedIndex = 0; 119 | 120 | textBoxHp.MaxLength = 3; //max hp, mp 999 121 | textBoxMaxHp.MaxLength = 3; 122 | textBoxMp.MaxLength = 3; 123 | textBoxMaxMp.MaxLength = 3; 124 | textBoxExp.MaxLength = 5; //max exp 32000 125 | textBoxNowRank.MaxLength = 2; //max now_rank 99 126 | textBoxPower.MaxLength = 4; // max 5000 127 | textBoxWakan.MaxLength = 4; 128 | textBoxDefence.MaxLength = 4; 129 | textBoxSpeed.MaxLength = 4; 130 | textBoxLuck.MaxLength = 4; 131 | buttonGoods.Enabled = false; 132 | } 133 | 134 | private void setComboContent(int ii) 135 | { 136 | textBoxNowRank.Text = rpgData.palExp[ii].now_rank.ToString(); 137 | textBoxExp.Text = rpgData.palExp[ii].exp.ToString(); 138 | //textBoxRank.Text = rpgData.palExp[ii].rank.ToString(); 139 | textBoxHp.Text = rpgData.palExp[ii].hp.ToString(); 140 | textBoxMaxHp.Text = rpgData.palExp[ii].maxHP.ToString(); 141 | textBoxMp.Text = rpgData.palExp[ii].mp.ToString(); 142 | textBoxMaxMp.Text = rpgData.palExp[ii].maxMP.ToString(); 143 | 144 | textBoxPower.Text = rpgData.palExp[ii].power.ToString(); 145 | textBoxWakan.Text = rpgData.palExp[ii].wakan.ToString(); 146 | textBoxDefence.Text = rpgData.palExp[ii].defence.ToString(); 147 | textBoxSpeed.Text = rpgData.palExp[ii].speed.ToString(); 148 | textBoxLuck.Text = rpgData.palExp[ii].luck.ToString(); 149 | } 150 | 151 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 152 | { 153 | setComboContent(comboBox1.SelectedIndex); 154 | } 155 | 156 | private bool checkComboContent() 157 | { 158 | if (textBoxExp.Text == "") 159 | { 160 | message(PAL.exp); 161 | return false; 162 | } 163 | 164 | if (textBoxNowRank.Text == "") 165 | { 166 | message(PAL.rank); 167 | return false; 168 | } 169 | 170 | if (textBoxHp.Text == "") 171 | { 172 | message(PAL.hp); 173 | return false; 174 | } 175 | 176 | if (textBoxMaxHp.Text == "") 177 | { 178 | message(PAL.maxHp); 179 | return false; 180 | } 181 | 182 | if (textBoxMp.Text == "") 183 | { 184 | message(PAL.mp); 185 | return false; 186 | } 187 | 188 | if (textBoxMaxMp.Text == "") 189 | { 190 | message(PAL.maxMp); 191 | return false; 192 | } 193 | 194 | if (textBoxPower.Text == "") 195 | { 196 | message(PAL.power); 197 | return false; 198 | } 199 | 200 | if (textBoxWakan.Text == "") 201 | { 202 | message(PAL.wakan); 203 | return false; 204 | } 205 | 206 | if (textBoxDefence.Text == "") 207 | { 208 | message(PAL.power); 209 | return false; 210 | } 211 | 212 | if (textBoxSpeed.Text == "") 213 | { 214 | message(PAL.speed); 215 | return false; 216 | } 217 | 218 | if (textBoxLuck.Text == "") 219 | { 220 | message(PAL.luck); 221 | return false; 222 | } 223 | 224 | return true; 225 | } 226 | 227 | private void getComboContent(int ii) 228 | { 229 | rpgData.palExp[ii].now_rank = System.UInt16.Parse(textBoxNowRank.Text); 230 | rpgData.palExp[ii].exp = System.UInt32.Parse(textBoxExp.Text); 231 | //rpgData.palExp[ii].rank = System.UInt32.Parse(textBoxRank.Text); 232 | rpgData.palExp[ii].hp = System.UInt16.Parse(textBoxHp.Text); 233 | rpgData.palExp[ii].maxHP = System.UInt16.Parse(textBoxMaxHp.Text); 234 | rpgData.palExp[ii].mp = System.UInt16.Parse(textBoxMp.Text); 235 | rpgData.palExp[ii].maxMP = System.UInt16.Parse(textBoxMaxMp.Text); 236 | 237 | rpgData.palExp[ii].power = System.UInt16.Parse(textBoxPower.Text); 238 | rpgData.palExp[ii].wakan = System.UInt16.Parse(textBoxWakan.Text); 239 | rpgData.palExp[ii].defence = System.UInt16.Parse(textBoxDefence.Text); 240 | rpgData.palExp[ii].speed = System.UInt16.Parse(textBoxSpeed.Text); 241 | rpgData.palExp[ii].luck = System.UInt16.Parse(textBoxLuck.Text); 242 | } 243 | 244 | private bool text2Varibles() 245 | { 246 | if (textBoxMoney.Text == "") 247 | { 248 | message(PAL.money); 249 | return false; 250 | } 251 | 252 | if (textBoxCalabash.Text == "") 253 | { 254 | message(PAL.calabash); 255 | return false; 256 | } 257 | 258 | if (textBoxSaveTime.Text == "") 259 | { 260 | message(PAL.saveTime); 261 | return false; 262 | } 263 | 264 | rpgData.palMoney = System.UInt32.Parse(textBoxMoney.Text); 265 | rpgData.palCalabash = System.UInt16.Parse(textBoxCalabash.Text); 266 | if (checkBoxSaveTime.Checked) 267 | rpgData.palSaveTime = 0; 268 | else 269 | rpgData.palSaveTime = System.UInt16.Parse(textBoxSaveTime.Text); 270 | 271 | if (checkComboContent() == false) 272 | return false; 273 | getComboContent(comboBox1.SelectedIndex); 274 | 275 | return true; 276 | } 277 | 278 | private void comboBox1_GotFocus(object sender, EventArgs e) 279 | { 280 | getComboContent(comboBox1.SelectedIndex); 281 | } 282 | 283 | //只能输入数字, 通过textBox的keyPress()事件实现 284 | private void digit_Handle(object sender, KeyPressEventArgs e) 285 | { 286 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) 287 | e.Handled = true; 288 | } 289 | 290 | #region textChange 291 | 292 | private void textBoxMoney_TextChanged(object sender, EventArgs e) 293 | { 294 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 295 | return; 296 | 297 | uint money = System.UInt32.Parse(textBoxMoney.Text); 298 | if (money < 0 || money > 9999999) 299 | { 300 | message(PAL.money); 301 | textBoxMoney.Text = rpgData.palMoney.ToString(); 302 | } 303 | 304 | ((TextBox)sender).BackColor = Color.White; 305 | } 306 | 307 | private void textBoxCalabash_TextChanged(object sender, EventArgs e) 308 | { 309 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 310 | return; 311 | 312 | ushort calabash = System.UInt16.Parse(textBoxCalabash.Text); 313 | if (calabash < 0 || calabash > 99) 314 | { 315 | message(PAL.calabash); 316 | textBoxCalabash.Text = rpgData.palCalabash.ToString(); 317 | } 318 | 319 | ((TextBox)sender).BackColor = Color.White; 320 | } 321 | 322 | private void textBoxSaveTime_TextChanged(object sender, EventArgs e) 323 | { 324 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 325 | return; 326 | 327 | ushort saveTime; 328 | saveTime = System.UInt16.Parse(textBoxSaveTime.Text); 329 | if (saveTime < 0 || saveTime > 9999) 330 | { 331 | message(PAL.saveTime); 332 | textBoxSaveTime.Text = rpgData.palSaveTime.ToString(); 333 | } 334 | 335 | ((TextBox)sender).BackColor = Color.White; 336 | } 337 | 338 | private void textBoxExp_TextChanged(object sender, EventArgs e) 339 | { 340 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 341 | return; 342 | 343 | int exp = System.Int32.Parse(textBoxExp.Text); 344 | if (exp < 0 || exp > 32000) 345 | { 346 | message(PAL.exp); 347 | textBoxExp.Text = rpgData.palExp[comboBox1.SelectedIndex].exp.ToString(); 348 | } 349 | 350 | ((TextBox)sender).BackColor = Color.White; 351 | } 352 | 353 | private void textBoxNowRank_TextChanged(object sender, EventArgs e) 354 | { 355 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 356 | return; 357 | 358 | int now_rank = System.Int32.Parse(textBoxNowRank.Text); 359 | if (now_rank < 1 || now_rank > 99) 360 | { 361 | message(PAL.rank); 362 | textBoxNowRank.Text = rpgData.palExp[comboBox1.SelectedIndex].now_rank.ToString(); 363 | } 364 | 365 | ((TextBox)sender).BackColor = Color.White; 366 | } 367 | 368 | private void textBoxHp_TextChanged(object sender, EventArgs e) 369 | { 370 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 371 | return; 372 | 373 | int hp = System.Int32.Parse(textBoxHp.Text); 374 | if (hp < 0 || hp > 999) 375 | { 376 | message(PAL.hp); 377 | textBoxHp.Text = rpgData.palExp[comboBox1.SelectedIndex].hp.ToString(); 378 | } 379 | 380 | ((TextBox)sender).BackColor = Color.White; 381 | } 382 | 383 | private void textBoxMaxHp_TextChanged(object sender, EventArgs e) 384 | { 385 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 386 | return; 387 | 388 | int maxHp = System.Int32.Parse(textBoxMaxHp.Text); 389 | if (maxHp < 0 || maxHp > 999) 390 | { 391 | message(PAL.maxHp); 392 | textBoxMaxHp.Text = rpgData.palExp[comboBox1.SelectedIndex].maxHP.ToString(); 393 | } 394 | 395 | ((TextBox)sender).BackColor = Color.White; 396 | } 397 | 398 | private void textBoxMp_TextChanged(object sender, EventArgs e) 399 | { 400 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 401 | return; 402 | 403 | int mp = System.Int32.Parse(textBoxMp.Text); 404 | if (mp < 0 || mp > 999) 405 | { 406 | message(PAL.mp); 407 | textBoxMp.Text = rpgData.palExp[comboBox1.SelectedIndex].mp.ToString(); 408 | } 409 | 410 | ((TextBox)sender).BackColor = Color.White; 411 | } 412 | 413 | private void textBoxMaxMp_TextChanged(object sender, EventArgs e) 414 | { 415 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 416 | return; 417 | 418 | int maxMp = System.Int32.Parse(textBoxMaxMp.Text); 419 | if (maxMp < 0 || maxMp > 999) 420 | { 421 | message(PAL.maxMp); 422 | textBoxMaxMp.Text = rpgData.palExp[comboBox1.SelectedIndex].maxMP.ToString(); 423 | } 424 | 425 | ((TextBox)sender).BackColor = Color.White; 426 | } 427 | 428 | private void textBoxPower_TextChanged(object sender, EventArgs e) 429 | { 430 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 431 | return; 432 | 433 | int power = System.Int32.Parse(textBoxPower.Text); 434 | if (power < 1 || power > 5000) 435 | { 436 | message(PAL.power); 437 | textBoxPower.Text = rpgData.palExp[comboBox1.SelectedIndex].power.ToString(); 438 | } 439 | 440 | ((TextBox)sender).BackColor = Color.White; 441 | } 442 | 443 | private void textBoxWakan_TextChanged(object sender, EventArgs e) 444 | { 445 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 446 | return; 447 | 448 | int wakan = System.Int32.Parse(textBoxWakan.Text); 449 | if (wakan < 1 || wakan > 5000) 450 | { 451 | message(PAL.wakan); 452 | textBoxWakan.Text = rpgData.palExp[comboBox1.SelectedIndex].wakan.ToString(); 453 | } 454 | 455 | ((TextBox)sender).BackColor = Color.White; 456 | } 457 | 458 | private void textBoxDefence_TextChanged(object sender, EventArgs e) 459 | { 460 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 461 | return; 462 | 463 | int defence = System.Int32.Parse(textBoxDefence.Text); 464 | if (defence < 1 || defence > 5000) 465 | { 466 | message(PAL.defence); 467 | textBoxDefence.Text = rpgData.palExp[comboBox1.SelectedIndex].defence.ToString(); 468 | } 469 | 470 | ((TextBox)sender).BackColor = Color.White; 471 | } 472 | 473 | private void textBoxSpeed_TextChanged(object sender, EventArgs e) 474 | { 475 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 476 | return; 477 | 478 | int speed = System.Int32.Parse(textBoxSpeed.Text); 479 | if (speed < 1 || speed > 5000) 480 | { 481 | message(PAL.speed); 482 | textBoxSpeed.Text = rpgData.palExp[comboBox1.SelectedIndex].speed.ToString(); 483 | } 484 | 485 | ((TextBox)sender).BackColor = Color.White; 486 | } 487 | 488 | private void textBoxLuck_TextChanged(object sender, EventArgs e) 489 | { 490 | if (bFileLoaded == false || ((TextBox)sender).Text == "") 491 | return; 492 | 493 | int luck = System.Int32.Parse(textBoxLuck.Text); 494 | if (luck < 1 || luck > 5000) 495 | { 496 | message(PAL.luck); 497 | textBoxLuck.Text = rpgData.palExp[comboBox1.SelectedIndex].luck.ToString(); 498 | } 499 | 500 | ((TextBox)sender).BackColor = Color.White; 501 | } 502 | 503 | #endregion 504 | 505 | //打开对应的存档, 并读取数据 506 | private void OpenSaveFile(uint index) 507 | { 508 | string path; 509 | if (platID == PlatformID.WinCE) 510 | path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName() 511 | .CodeBase); 512 | else 513 | path = System.IO.Directory.GetCurrentDirectory(); 514 | 515 | string filename = path + "\\" + index + ".rpg"; 516 | 517 | rpgData.OpenPalSave(filename); 518 | 519 | initialUI(); 520 | 521 | tabControl1.Visible = true; 522 | menuItemSave.Enabled = true; 523 | bFileLoaded = true; 524 | labelGoods.Text = ""; 525 | textBoxGoods.Text = ""; 526 | buttonGoods.Enabled = false; 527 | } 528 | 529 | private void menuItem1_Click(object sender, EventArgs e) 530 | { 531 | OpenSaveFile(1); 532 | } 533 | 534 | private void menuItem2_Click(object sender, EventArgs e) 535 | { 536 | OpenSaveFile(2); 537 | } 538 | 539 | private void menuItem3_Click(object sender, EventArgs e) 540 | { 541 | OpenSaveFile(3); 542 | } 543 | 544 | private void menuItem4_Click(object sender, EventArgs e) 545 | { 546 | OpenSaveFile(4); 547 | } 548 | 549 | private void menuItem6_Click(object sender, EventArgs e) 550 | { 551 | OpenSaveFile(5); 552 | } 553 | 554 | private void initDataGrid() 555 | { 556 | DataTable dt = new DataTable(); 557 | DataColumn dcName = new DataColumn(); 558 | DataColumn dcCnt = new DataColumn(); 559 | dcName.ColumnName = "名称"; 560 | dcCnt.ColumnName = "数量"; 561 | dt.Columns.Add(dcName); 562 | dt.Columns.Add(dcCnt); 563 | 564 | DataGridTableStyle ts = new DataGridTableStyle(); 565 | DataGridColumnStyle dgName = new DataGridTextBoxColumn(); 566 | dgName.MappingName = dcName.ColumnName; 567 | dgName.HeaderText = dcName.ColumnName; 568 | dgName.Width = 100; 569 | ts.GridColumnStyles.Add(dgName); 570 | 571 | DataGridColumnStyle dgCnt = new DataGridTextBoxColumn(); 572 | dgCnt.MappingName = dcCnt.ColumnName; 573 | dgCnt.HeaderText = dcCnt.ColumnName; 574 | dgCnt.Width = 40; 575 | ts.GridColumnStyles.Add(dgCnt); 576 | 577 | dataGridGoods.TableStyles.Add(ts); 578 | 579 | 580 | this.dataGridGoods.CurrentCellChanged += 581 | new System.EventHandler(dataGrid_CurrentCellChanged); // // DataGridEditing // 582 | 583 | 584 | const ushort GOODS_CNT = 234; 585 | for (int ii = 0; ii < GOODS_CNT; ii++) 586 | { 587 | DataRow dr = dt.NewRow(); 588 | dr[dcName] = rpgData.palGoods.goodsInfo[ii].goodsDescript; 589 | dr[dcCnt] = rpgData.palGoods.goodsInfo[ii].goodsCnt; 590 | dt.Rows.Add(dr); 591 | } 592 | 593 | dataGridGoods.DataSource = dt; 594 | } 595 | 596 | private void checkBoxGoods_CheckStateChanged(object sender, EventArgs e) 597 | { 598 | if (checkBoxGoods.Checked) 599 | dataGridGoods.Enabled = false; 600 | else 601 | dataGridGoods.Enabled = true; 602 | } 603 | 604 | private void dataGrid_CurrentCellChanged(object o, EventArgs e) 605 | { 606 | DataGridCell currentCell; 607 | 608 | currentCell = dataGridGoods.CurrentCell; 609 | 610 | labelGoods.Text = (string)dataGridGoods[currentCell.RowNumber, 0]; 611 | textBoxGoods.Text = (string)dataGridGoods[currentCell.RowNumber, 1]; 612 | buttonGoods.Enabled = true; 613 | } 614 | 615 | private void textBoxGoods_TextChanged(object sender, EventArgs e) 616 | { 617 | if (bFileLoaded == false) 618 | return; 619 | 620 | if (textBoxGoods.Text == "") 621 | return; 622 | 623 | int goodsCnt = System.Int16.Parse(textBoxGoods.Text); 624 | if (goodsCnt < 0 || goodsCnt > 5000) 625 | { 626 | MessageBox.Show("物品的有效值范围为0-99\n请输入正确的值!", "提示"); 627 | textBoxGoods.Text = (string)dataGridGoods[dataGridGoods.CurrentCell.RowNumber, 1]; 628 | } 629 | } 630 | 631 | private void buttonGoods_Click(object sender, EventArgs e) 632 | { 633 | DataGridCell currentCell = dataGridGoods.CurrentCell; 634 | if (textBoxGoods.Text == "") 635 | textBoxGoods.Text = "0"; 636 | dataGridGoods[currentCell.RowNumber, 1] = textBoxGoods.Text; 637 | } 638 | 639 | private void dataGridToGoodsInfo() 640 | { 641 | const ushort GOODS_CNT = 234; 642 | for (int ii = 0; ii < GOODS_CNT; ii++) 643 | { 644 | rpgData.palGoods.goodsInfo[ii].goodsCnt = System.UInt16.Parse((string)dataGridGoods[ii, 1]); 645 | } 646 | } 647 | 648 | private void buttonMagic_Click(object sender, EventArgs e) 649 | { 650 | FormMagic formMagic = new FormMagic(rpgData.palMagic, comboBox1.SelectedIndex); 651 | formMagic.Owner = this; 652 | formMagic.ShowDialog(); 653 | } 654 | 655 | private void message(PAL index) 656 | { 657 | switch (index) 658 | { 659 | case PAL.exp: 660 | MessageBox.Show("经验值的有效范围为0-32000\n请输入正确的值!", "提示"); 661 | break; 662 | case PAL.rank: 663 | MessageBox.Show("修行的有效值范围为0-99\n请输入正确的值!", "提示"); 664 | break; 665 | case PAL.hp: 666 | MessageBox.Show("体力的有效值范围为0-999\n请输入正确的值!", "提示"); 667 | break; 668 | case PAL.maxHp: 669 | MessageBox.Show("体力上限的有效值范围为0-999\n请输入正确的值!", "提示"); 670 | break; 671 | case PAL.mp: 672 | MessageBox.Show("真气的有效值范围为0-999\n请输入正确的值!", "提示"); 673 | break; 674 | case PAL.maxMp: 675 | MessageBox.Show("真气上限的有效值范围为0-999\n请输入正确的值!", "提示"); 676 | break; 677 | case PAL.power: 678 | MessageBox.Show("武力的有效值范围为1-5000\n请输入正确的值!", "提示"); 679 | break; 680 | case PAL.wakan: 681 | MessageBox.Show("灵力的有效值范围为1-5000\n请输入正确的值!", "提示"); 682 | break; 683 | case PAL.defence: 684 | MessageBox.Show("防御的有效值范围为1-5000\n请输入正确的值!", "提示"); 685 | break; 686 | case PAL.speed: 687 | MessageBox.Show("身法的有效值范围为1-5000\n请输入正确的值!", "提示"); 688 | break; 689 | case PAL.luck: 690 | MessageBox.Show("吉运的有效值范围为1-5000\n请输入正确的值!", "提示"); 691 | break; 692 | case PAL.money: 693 | MessageBox.Show("金钱的有效值范围为0-9999999", "提示"); 694 | break; 695 | case PAL.saveTime: 696 | MessageBox.Show("存盘次数的有效值范围为0-9999", "提示"); 697 | break; 698 | case PAL.calabash: 699 | MessageBox.Show("灵葫值的有效值范围为0-99", "提示"); 700 | break; 701 | } 702 | } 703 | 704 | //private PAL textBoxToEnum(TextBox obj) 705 | //{ 706 | // PAL tmp = new PAL(); 707 | // if (obj.Equals(textBoxExp)) 708 | // tmp = PAL.exp; 709 | // else if (obj.Equals(textBoxNowRank)) 710 | // tmp = PAL.rank; 711 | // else if (obj.Equals(textBoxHp)) 712 | // tmp = PAL.hp; 713 | // else if (obj.Equals(textBoxMaxHp)) 714 | // tmp = PAL.maxHp; 715 | // else if (obj.Equals(textBoxMp)) 716 | // tmp = PAL.mp; 717 | // else if (obj.Equals(textBoxMaxMp)) 718 | // tmp = PAL.maxMp; 719 | // else if (obj.Equals(textBoxPower)) 720 | // tmp = PAL.power; 721 | // else if (obj.Equals(textBoxWakan)) 722 | // tmp = PAL.wakan; 723 | // else if (obj.Equals(textBoxDefence)) 724 | // tmp = PAL.defence; 725 | // else if (obj.Equals(textBoxSpeed)) 726 | // tmp = PAL.speed; 727 | // else if (obj.Equals(textBoxLuck)) 728 | // tmp = PAL.luck; 729 | // else if (obj.Equals(textBoxMoney)) 730 | // tmp = PAL.money; 731 | // else if (obj.Equals(textBoxSaveTime)) 732 | // tmp = PAL.saveTime; 733 | // else if (obj.Equals(textBoxCalabash)) 734 | // tmp = PAL.calabash; 735 | 736 | // return tmp; 737 | //} 738 | 739 | private void textBox_LostFocus(object sender, EventArgs e) 740 | { 741 | TextBox tmp = (TextBox)sender; 742 | 743 | if (tmp.Text == "") 744 | { 745 | //this.message(textBoxToEnum(tmp)); 746 | tmp.Focus(); 747 | tmp.BackColor = Color.Red; 748 | } 749 | } 750 | } 751 | } -------------------------------------------------------------------------------- /PalEditor/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 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 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | 139 | True 140 | 141 | 142 | True 143 | 144 | 145 | True 146 | 147 | 148 | True 149 | 150 | 151 | True 152 | 153 | 154 | True 155 | 156 | 157 | True 158 | 159 | 160 | True 161 | 162 | 163 | True 164 | 165 | 166 | True 167 | 168 | 169 | True 170 | 171 | 172 | True 173 | 174 | 175 | True 176 | 177 | 178 | True 179 | 180 | 181 | True 182 | 183 | 184 | True 185 | 186 | 187 | True 188 | 189 | 190 | True 191 | 192 | 193 | True 194 | 195 | 196 | True 197 | 198 | 199 | True 200 | 201 | 202 | True 203 | 204 | 205 | True 206 | 207 | 208 | True 209 | 210 | 211 | True 212 | 213 | 214 | True 215 | 216 | 217 | True 218 | 219 | 220 | True 221 | 222 | 223 | True 224 | 225 | 226 | True 227 | 228 | 229 | POCKET_PC_2003_PORTRAIT 230 | 231 | 232 | False 233 | 234 | 235 | 236 | 237 | AAABAAEAICAIAAAAAACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAB 238 | AAC8iJkAz8jWdwAAAABY+RIAFwAAAGj7EgCPBNR3sI7Sd/////+rjtJ37I7SdyBDdQAHAAAAcA0bAPyO 239 | 0ncAAAAAAAAAAAAAAAAAAAAA1PkSAGbCRgBaDQMAvIiZALtVQwC8iJkAKbAAAAAAAAAAAAAAAAAAADj7 240 | EgBue0QAAAAAAIAZmQAB+xIA1XtEAJj7EgCAGZkAsINEAHRXQwAQ/BIAmPsSAIAZmQC/gkMAEPwSAJj7 241 | EgCAGZkAhA0EAEcAAAAAAAAAi43Sd0cAAAA0ABgAvPwSAAAAAAAAAAAAAAAAACj6EgC8/BIAFPwSAI8E 242 | 1HeQjdJ3/////4uN0nfTESB3hA0EAEcAAAAAAAAAvPwSAPj7EgBQAyB33hEgdwAAAAAAAAAAAAAAAAAA 243 | AAAAAAAAAAAAAAAAAAC+lNF3DY7SdwIAAAD4+xIA7w+pAEYAAAAAAAAAngIAAIQNBAAAAAAA7w+pAAYA 244 | AAAowtJ3AgAAAOz6EgAowtJ3cA0bAEYAAAAAAAAAvPwSAAEAAAA0+xIA1cHSd3ANGwBGAAAAAAAAAOnB 245 | 0nf4+xIA7w+pAEYAAAAAAAAAAAAAAAAAAAAE+xIASPsSAENlRAD4+xIA1Q+pAIAZmQBZBEEAYPsSAENl 246 | RAAQ/BIA1Q+pAIAZmQBZBEEAXAuZAC3kQQA15EEAgBmZAHwLmQC/fkMAkPsSANZ+QwDefkMALPwSAOh+ 247 | QwCQ+xIAEPwSANUPqQDVD6kAgBmZAKj7EgBuOkQABgAAAAEAAABwDRsAAAAAANT7EgA0h9F3eg0EAAYA 248 | AAABAAAAcA0bANUPqQDNq7rcAAAAABD8EgDVD6kAPPwSABaI0XcA0P1/PPwSAFqI0Xf8+xIAKojRdwAA 249 | AAB6DQQAYNZEABQAAAABAAAAAAAAAAAAAAAQAAAAAAAAAGj8EgAAAAAAAAAAAAAAAADw+xIAoI7Sd4D8 250 | EgCPBNR3MIjRd/////8qiNF3oI7SdwAAAADVD6kAeg0EAAYAAAABAAAAcA0bAKQvdQCrjtJ3AAAAACj9 251 | EgBg1kQAhMRIAFQAAABM6pkAMCFAAJkkRQBWIkAA8PwSANgiQACo/BIAWOqZAAQAAADMSZkA/NOZAHjX 252 | mQAM/RIAmSdAANhJmQCfIkEABAAAAMxJmQB5IEEAzEmZAF4hQQAAAAAAWOqZAMxJmQCg2ZkAJNmZAAAR 253 | AACExEgAFAAAALzZmQAwIUAAKP0SAAQAAACb6pkAFAAAALQiQABo/RIA2CJAAN8iQAAEAAAAm+qZAHz9 254 | EgAwIUAAwNmZAIj9EgAuJ0AAyNmZAJvqmQCcPEAAfP0SAFjqmQAEAAAAPEBAAEQAAAAAAAAAAAAAAPDE 255 | mQAODEIAzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O 256 | zs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzpSUlJSUlJSUlJSUlJSUlJSU 257 | lJSUlM7Ozs7Ozs7Ozs7OlEZGRkZGRkZGRkZoCAgICAgICAgIlM7Ozs7Ozs7Ozs7OVUZGRkZGRkZGRuwI 258 | CAgICAgICAho+87Ozs7Ozs7Ozs77RkZGRkZGRkZGRmgICAgICAgICAiUzs7Ozs7Ozs7Ozs5GRkZGRkZG 259 | RkZG7AgICAgICAgICIbOzs7Ozs7Ozs7OzlVGRkZGRkZGRkZGCAgICAgICAgIaJTOzs7Ozs7Ozs7OlEZG 260 | RkZGRkZGRkYICAgICAgICAgIVc7Ozs7Ozs7Ozs6URkZGRkZGRkZGRmgICAgICAgICAjszs7Ozs7Ozs7O 261 | zvtGRkZGRkZGRkZGhggICAgICAgICIbOzs7Ozs7Ozs7OzkZGRkZGRkZGRkaGCAgICAgICAgIhs7Ozs7O 262 | zs7Ozs7ORkZGRkZGRkZGRoYICAgICAgICAiGzs7Ozs7Ozs7Ozs6URkZGRkZGRkZGhggICAgICAgICIbO 263 | zs7Ozs7Ozs7OzpRGRkZGRkZGRkaGCAgICAgICAgIaPvOzs7Ozs7Ozs7OlEZGRkZGRkZGRuwICAgICAgI 264 | CAgIlM7Ozs7Ozs7Ozs6URkZGRkZGRkZGRggICAgICAgICAiUzs7Ozs7Ozs7OzpRGRkZGRkZGRkZGaAgI 265 | CAgICAgICJTOzs7Ozs7Ozs7O+0ZGRkZGRkZGRkaGCAgICAgICAgI7M7Ozs7Ozs7Ozs7ORkZGRkZGRkZG 266 | RoYICAgICAgICAiGzs7Ozs7Ozs7Ozs5GRkZGRkZGRkZG7AgICAgICAgICAiUzs7Ozs7Ozs7OzpRGRkZG 267 | RkZGRkZGCAgICAgICAgICIbOzs7Ozs7Ozs7OzkZGRkZGRkZGRkZoCAgICAgICAgIaPvOzs7Ozs7Ozs7O 268 | lEZGRkZGRkZGRkYICAgICAgICAgIlM7Ozs7Ozs7Ozs77RkZGRkZGRkZGRmgICAgICAgICAgX+87Ozs7O 269 | zs7Ozs77lJSUlJSUlJSUlJSUlJSUlJSUlJT7VZTOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzvtG 270 | Vc7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O+1WU+87Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O 271 | zs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O 272 | zs7Ozs7Ozs7Ozv///////////////4AAA/+AAAH/wAAA/8AAAP/gAAD/4AAAf+AAAH/gAAB/4AAAf/AA 273 | AH/wAAB/8AAAf/AAAD/wAAA/8AAAP/AAAD/wAAA/+AAAP/gAAB/4AAAf/AAAD/wAAA/8AAAH/gAAAf// 274 | //H////w//////////////// 275 | 276 | 277 | -------------------------------------------------------------------------------- /PalEditor/FormAbout.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PalEditor 2 | { 3 | partial class FormAbout 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | private System.Windows.Forms.MainMenu mainMenu1; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout)); 33 | this.mainMenu1 = new System.Windows.Forms.MainMenu(); 34 | this.menuItem1 = new System.Windows.Forms.MenuItem(); 35 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 36 | this.label1 = new System.Windows.Forms.Label(); 37 | this.label2 = new System.Windows.Forms.Label(); 38 | this.label3 = new System.Windows.Forms.Label(); 39 | this.label4 = new System.Windows.Forms.Label(); 40 | this.label5 = new System.Windows.Forms.Label(); 41 | this.label6 = new System.Windows.Forms.Label(); 42 | this.button1 = new System.Windows.Forms.Button(); 43 | this.SuspendLayout(); 44 | // 45 | // mainMenu1 46 | // 47 | this.mainMenu1.MenuItems.Add(this.menuItem1); 48 | // 49 | // menuItem1 50 | // 51 | this.menuItem1.Text = "确定"; 52 | this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); 53 | // 54 | // pictureBox1 55 | // 56 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 57 | this.pictureBox1.Location = new System.Drawing.Point(12, 25); 58 | this.pictureBox1.Name = "pictureBox1"; 59 | this.pictureBox1.Size = new System.Drawing.Size(35, 35); 60 | // 61 | // label1 62 | // 63 | this.label1.Location = new System.Drawing.Point(64, 26); 64 | this.label1.Name = "label1"; 65 | this.label1.Size = new System.Drawing.Size(159, 20); 66 | this.label1.Text = "仙剑奇侠传 存档修改器"; 67 | // 68 | // label2 69 | // 70 | this.label2.Location = new System.Drawing.Point(64, 46); 71 | this.label2.Name = "label2"; 72 | this.label2.Size = new System.Drawing.Size(100, 20); 73 | this.label2.Text = "v0.5"; 74 | // 75 | // label3 76 | // 77 | this.label3.Location = new System.Drawing.Point(64, 67); 78 | this.label3.Name = "label3"; 79 | this.label3.Size = new System.Drawing.Size(100, 20); 80 | this.label3.Text = "2009.05.29"; 81 | // 82 | // label4 83 | // 84 | this.label4.Location = new System.Drawing.Point(63, 87); 85 | this.label4.Name = "label4"; 86 | this.label4.Size = new System.Drawing.Size(160, 20); 87 | this.label4.Text = "jason (jsfaint@gmail.com)"; 88 | // 89 | // label5 90 | // 91 | this.label5.Location = new System.Drawing.Point(12, 146); 92 | this.label5.Name = "label5"; 93 | this.label5.Size = new System.Drawing.Size(211, 54); 94 | this.label5.Text = "声明:存档格式的所有资料均来源于网络。感谢各位为仙剑所付出劳动的人们!"; 95 | // 96 | // label6 97 | // 98 | this.label6.Location = new System.Drawing.Point(23, 117); 99 | this.label6.Name = "label6"; 100 | this.label6.Size = new System.Drawing.Size(186, 20); 101 | this.label6.Text = "特别感谢诗诺比提供的帮助!"; 102 | // 103 | // button1 104 | // 105 | this.button1.Location = new System.Drawing.Point(151, 228); 106 | this.button1.Name = "button1"; 107 | this.button1.Size = new System.Drawing.Size(72, 30); 108 | this.button1.TabIndex = 7; 109 | this.button1.Text = "关闭(&C)"; 110 | this.button1.Click += new System.EventHandler(this.button1_Click); 111 | // 112 | // FormAbout 113 | // 114 | this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 115 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 116 | this.AutoScroll = true; 117 | this.ClientSize = new System.Drawing.Size(240, 268); 118 | this.Controls.Add(this.button1); 119 | this.Controls.Add(this.label6); 120 | this.Controls.Add(this.label5); 121 | this.Controls.Add(this.label4); 122 | this.Controls.Add(this.label3); 123 | this.Controls.Add(this.label2); 124 | this.Controls.Add(this.label1); 125 | this.Controls.Add(this.pictureBox1); 126 | this.Menu = this.mainMenu1; 127 | this.Name = "FormAbout"; 128 | this.Text = "About PalEditor"; 129 | this.ResumeLayout(false); 130 | 131 | } 132 | 133 | #endregion 134 | 135 | private System.Windows.Forms.PictureBox pictureBox1; 136 | private System.Windows.Forms.Label label1; 137 | private System.Windows.Forms.Label label2; 138 | private System.Windows.Forms.Label label3; 139 | private System.Windows.Forms.Label label4; 140 | private System.Windows.Forms.Label label5; 141 | private System.Windows.Forms.Label label6; 142 | private System.Windows.Forms.MenuItem menuItem1; 143 | private System.Windows.Forms.Button button1; 144 | } 145 | } -------------------------------------------------------------------------------- /PalEditor/FormAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace PalEditor 5 | { 6 | public partial class FormAbout : Form 7 | { 8 | public FormAbout() 9 | { 10 | this.FormBorderStyle = FormBorderStyle.FixedSingle; 11 | InitializeComponent(); 12 | } 13 | 14 | private void menuItem1_Click(object sender, EventArgs e) 15 | { 16 | this.Close(); 17 | } 18 | 19 | private void button1_Click(object sender, EventArgs e) 20 | { 21 | this.Close(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /PalEditor/FormAbout.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 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 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 125 | 126 | iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 127 | YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAPtJREFUWEftls0J 128 | AkEMhYN49WAHYiXCTgs248FSbMSTLViAXrWKuJldPcr3IKOIGxjYQ9i8nyQzZlP8nwLFbXbw+WLnZv33 129 | 56P4anmpIEDtUpFmnsr6pcBbCANScs6nu5Potkcue7AmxSOHxuA7DFqcso883HQt2Hf7Wz77zfpK1R/H 130 | Lln+YEVCYh8+Uf8pgFAKcjdT/KcNKHW/AoDIHzlNADRrQKoA9V+a/2iUbADiBJhlT8CvAcjfAZIC1P+w 131 | ie6AZkuI7gD48hkXZf9SoU1IAIRK0hKixekSkvxXLiHqv8Q+vCIKUPbSBmzR/RL7zGf381/4/p8Sv63A 132 | A3dGus2zSe2DAAAAAElFTkSuQmCC 133 | 134 | 135 | 136 | POCKET_PC_2003_PORTRAIT 137 | 138 | 139 | True 140 | 141 | -------------------------------------------------------------------------------- /PalEditor/FormMagic.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PalEditor 2 | { 3 | partial class FormMagic 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | private System.Windows.Forms.MainMenu mainMenu1; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | this.mainMenu1 = new System.Windows.Forms.MainMenu(); 33 | this.menuItemOK = new System.Windows.Forms.MenuItem(); 34 | this.menuItemCancel = new System.Windows.Forms.MenuItem(); 35 | this.labelMagic = new System.Windows.Forms.Label(); 36 | this.SuspendLayout(); 37 | // 38 | // mainMenu1 39 | // 40 | this.mainMenu1.MenuItems.Add(this.menuItemOK); 41 | this.mainMenu1.MenuItems.Add(this.menuItemCancel); 42 | // 43 | // menuItemOK 44 | // 45 | this.menuItemOK.Text = "确认"; 46 | this.menuItemOK.Click += new System.EventHandler(this.menuItemOK_Click); 47 | // 48 | // menuItemCancel 49 | // 50 | this.menuItemCancel.Text = "取消"; 51 | this.menuItemCancel.Click += new System.EventHandler(this.menuItemCancel_Click); 52 | // 53 | // labelMagic 54 | // 55 | this.labelMagic.Location = new System.Drawing.Point(0, 0); 56 | this.labelMagic.Name = "labelMagic"; 57 | this.labelMagic.Size = new System.Drawing.Size(240, 20); 58 | // 59 | // FormMagic 60 | // 61 | this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 62 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 63 | this.AutoScroll = true; 64 | this.ClientSize = new System.Drawing.Size(480, 268); 65 | this.ControlBox = false; 66 | this.Controls.Add(this.labelMagic); 67 | this.Menu = this.mainMenu1; 68 | this.MinimizeBox = false; 69 | this.Name = "FormMagic"; 70 | this.Text = "仙术修改"; 71 | this.TopMost = true; 72 | this.Load += new System.EventHandler(this.FormMagic_Load); 73 | this.ResumeLayout(false); 74 | 75 | } 76 | 77 | #endregion 78 | 79 | private System.Windows.Forms.MenuItem menuItemOK; 80 | private System.Windows.Forms.MenuItem menuItemCancel; 81 | private System.Windows.Forms.Label labelMagic; 82 | } 83 | } -------------------------------------------------------------------------------- /PalEditor/FormMagic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace PalEditor 6 | { 7 | public partial class FormMagic : Form 8 | { 9 | private const ushort Magic_CNT = 103; 10 | private const ushort Magic_PP_MAX = 32; 11 | private CheckBox[] checkBoxMagic; 12 | private PalMagic palMagic; 13 | private int pIndex; 14 | private ushort mCount = 0; 15 | 16 | public FormMagic() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | public FormMagic(PalMagic palMagic, int pIndex) 22 | { 23 | InitializeComponent(); 24 | this.FormBorderStyle = FormBorderStyle.FixedSingle; 25 | 26 | this.palMagic = palMagic; 27 | this.pIndex = pIndex; 28 | 29 | palMagic.ArrayToDisplay(pIndex); 30 | 31 | checkBoxMagic = new CheckBox[Magic_CNT]; 32 | this.AutoScaleMode = AutoScaleMode.None; 33 | 34 | 35 | if (this.Width >= 480) 36 | { 37 | int top = 30; 38 | int space = 20; 39 | for (int ii = 0; ii < Magic_CNT; ii++) 40 | { 41 | checkBoxMagic[ii] = new CheckBox(); 42 | checkBoxMagic[ii].Font = new Font("Tahoma", 8, FontStyle.Regular); 43 | checkBoxMagic[ii].Text = palMagic.magicList[ii].MagicDesc; 44 | checkBoxMagic[ii].Checked = palMagic.magicList[ii].Enabled; 45 | checkBoxMagic[ii].Width = 150; 46 | checkBoxMagic[ii].Height = 32; 47 | 48 | switch (ii % 3) 49 | { 50 | case 0: 51 | checkBoxMagic[ii].Left = 5; 52 | checkBoxMagic[ii].Top = top + (ii / 3) * checkBoxMagic[ii].Height + space; 53 | break; 54 | case 1: 55 | checkBoxMagic[ii].Left = 155; 56 | checkBoxMagic[ii].Top = top + ((ii - 1) / 3) * checkBoxMagic[ii].Height + space; 57 | break; 58 | 59 | case 2: 60 | checkBoxMagic[ii].Left = 305; 61 | checkBoxMagic[ii].Top = top + ((ii - 2) / 3) * checkBoxMagic[ii].Height + space; 62 | break; 63 | } 64 | 65 | this.Controls.Add(checkBoxMagic[ii]); 66 | checkBoxMagic[ii].CheckStateChanged += new System.EventHandler(this.checkBox_CheckStateChanged); 67 | 68 | if (palMagic.magicList[ii].Enabled) 69 | this.mCount++; 70 | } 71 | } 72 | else if (this.Width < 480) 73 | { 74 | int top = 20; 75 | 76 | for (int ii = 0; ii < Magic_CNT; ii++) 77 | { 78 | checkBoxMagic[ii] = new CheckBox(); 79 | checkBoxMagic[ii].Font = new Font("Tahoma", 8, FontStyle.Regular); 80 | checkBoxMagic[ii].Text = palMagic.magicList[ii].MagicDesc; 81 | checkBoxMagic[ii].Checked = palMagic.magicList[ii].Enabled; 82 | 83 | if (ii % 2 == 0) 84 | { 85 | checkBoxMagic[ii].Left = 5; 86 | checkBoxMagic[ii].Top = top + (ii + 1) / 2 * checkBoxMagic[ii].Height; 87 | } 88 | else 89 | { 90 | checkBoxMagic[ii].Left = 110; 91 | checkBoxMagic[ii].Top = top + ii / 2 * checkBoxMagic[ii].Height; 92 | } 93 | 94 | this.Controls.Add(checkBoxMagic[ii]); 95 | checkBoxMagic[ii].CheckStateChanged += new System.EventHandler(this.checkBox_CheckStateChanged); 96 | 97 | if (palMagic.magicList[ii].Enabled) 98 | this.mCount++; 99 | } 100 | } 101 | 102 | labelMagic.Text = "每人最多拥有32项仙术, 已有 " + mCount + " 项"; 103 | } 104 | 105 | private void FormMagic_Load(object sender, EventArgs e) 106 | { 107 | this.MaximizeBox = false; 108 | this.ControlBox = false; 109 | } 110 | 111 | private void menuItemCancel_Click(object sender, EventArgs e) 112 | { 113 | this.Close(); 114 | } 115 | 116 | private void menuItemOK_Click(object sender, EventArgs e) 117 | { 118 | //保存checkbox选项回magic 119 | for (int ii = 0; ii < Magic_CNT; ii++) 120 | palMagic.magicList[ii].Enabled = checkBoxMagic[ii].Checked; 121 | 122 | palMagic.DisplayToArray(pIndex); 123 | 124 | this.Close(); 125 | } 126 | 127 | private void checkBox_CheckStateChanged(object sender, EventArgs e) 128 | { 129 | this.mCount = 0; 130 | CheckBox cb = (CheckBox)sender; 131 | 132 | for (int ii = 0; ii < Magic_CNT; ii++) 133 | { 134 | if (checkBoxMagic[ii].Checked) 135 | { 136 | mCount++; 137 | } 138 | 139 | if (mCount > Magic_PP_MAX) 140 | { 141 | mCount = Magic_PP_MAX; 142 | System.Windows.Forms.MessageBox.Show("每人最多拥有32项仙术!", "错误"); 143 | cb.Checked = false; 144 | } 145 | } 146 | 147 | labelMagic.Text = "每人最多拥有32项仙术, 已有 " + mCount + " 项"; 148 | } 149 | } 150 | } -------------------------------------------------------------------------------- /PalEditor/FormMagic.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 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 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | POCKET_PC_2003_PORTRAIT 125 | 126 | 127 | False 128 | 129 | -------------------------------------------------------------------------------- /PalEditor/PalEditor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8B2960CF-B76C-465F-A246-E9B7CEB1C395} 8 | WinExe 9 | PalEditor 10 | PalEditor 11 | v4.8.1 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | ResXFileCodeGenerator 70 | Resources.Designer.cs 71 | Designer 72 | 73 | 74 | True 75 | Resources.resx 76 | 77 | 78 | SettingsSingleFileGenerator 79 | Settings.Designer.cs 80 | 81 | 82 | True 83 | Settings.settings 84 | True 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /PalEditor/PalExp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: jason(jsfaint@gmail.com) 4 | * Date: 2009-4-22 5 | * Time: 11:19 6 | * 7 | */ 8 | 9 | using System; 10 | using System.IO; 11 | 12 | namespace PalEditor 13 | { 14 | /// 15 | /// Description of PalExp. 16 | /// 17 | public class PalExp 18 | { 19 | //offset map 20 | private uint exp_offset; 21 | private uint now_rank_offset; 22 | private uint MaxHP_offset; 23 | private uint MaxMP_offset; 24 | private uint HP_offset; 25 | private uint MP_offset; 26 | private uint power_offset; 27 | private uint wakan_offset; 28 | private uint defence_offset; 29 | private uint speed_offset; 30 | private uint luck_offset; 31 | 32 | //variable 33 | public uint exp; //经验 34 | public uint rank; 35 | public ushort now_rank; //现在的等级 36 | public ushort maxHP; 37 | public ushort maxMP; 38 | public ushort hp; 39 | public ushort mp; 40 | public ushort power; //武力 41 | public ushort wakan; //灵力 42 | public ushort defence; //防御 43 | public ushort speed; //身法 44 | public ushort luck; //吉运 45 | 46 | 47 | public PalExp(uint[] offset) 48 | { 49 | exp_offset = offset[0]; 50 | now_rank_offset = offset[1]; 51 | MaxHP_offset = offset[2]; 52 | MaxMP_offset = offset[3]; 53 | HP_offset = offset[4]; 54 | MP_offset = offset[5]; 55 | power_offset = offset[6]; 56 | wakan_offset = offset[7]; 57 | defence_offset = offset[8]; 58 | speed_offset = offset[9]; 59 | luck_offset = offset[10]; 60 | } 61 | 62 | public void LoadPalExp(System.IO.FileStream fStream) 63 | { 64 | try 65 | { 66 | System.IO.BinaryReader br = new BinaryReader(fStream); 67 | fStream.Seek(exp_offset, SeekOrigin.Begin); 68 | exp = br.ReadUInt32(); 69 | rank = br.ReadUInt32(); 70 | 71 | now_rank = Loadushort(br, fStream, now_rank_offset); 72 | maxHP = Loadushort(br, fStream, MaxHP_offset); 73 | maxMP = Loadushort(br, fStream, MaxMP_offset); 74 | hp = Loadushort(br, fStream, HP_offset); 75 | mp = Loadushort(br, fStream, MP_offset); 76 | power = Loadushort(br, fStream, power_offset); 77 | wakan = Loadushort(br, fStream, wakan_offset); 78 | defence = Loadushort(br, fStream, defence_offset); 79 | speed = Loadushort(br, fStream, speed_offset); 80 | luck = Loadushort(br, fStream, luck_offset); 81 | } 82 | catch (Exception e) 83 | { 84 | System.Console.WriteLine("Exception in PalExp.LoadPalExp(): " + e.Message); 85 | System.Windows.Forms.MessageBox.Show("Exception in PalExp.LoadPalExp(): " + e.Message); 86 | } 87 | } 88 | 89 | public void SavePalExp(System.IO.FileStream fStream) 90 | { 91 | try 92 | { 93 | byte[] expTmp = System.BitConverter.GetBytes(exp); 94 | byte[] rankTmp = System.BitConverter.GetBytes(rank); 95 | fStream.Seek(exp_offset, SeekOrigin.Begin); 96 | fStream.Write(expTmp, 0, expTmp.Length); //exp 97 | fStream.Write(rankTmp, 0, rankTmp.Length); // exp rest 98 | 99 | Saveushort(fStream, now_rank_offset, this.now_rank); 100 | Saveushort(fStream, MaxHP_offset, this.maxHP); 101 | Saveushort(fStream, MaxMP_offset, this.maxMP); 102 | Saveushort(fStream, HP_offset, this.hp); 103 | Saveushort(fStream, MP_offset, this.mp); 104 | Saveushort(fStream, power_offset, this.power); 105 | Saveushort(fStream, wakan_offset, this.wakan); 106 | Saveushort(fStream, defence_offset, this.defence); 107 | Saveushort(fStream, speed_offset, this.speed); 108 | Saveushort(fStream, luck_offset, this.luck); 109 | } 110 | catch (Exception e) 111 | { 112 | System.Console.WriteLine("Exception in PalExp.SavePalExp(): " + e.Message); 113 | System.Windows.Forms.MessageBox.Show("Exception in PalExp.SavePalExp(): " + e.Message); 114 | } 115 | } 116 | 117 | public ushort Loadushort(System.IO.BinaryReader br, System.IO.FileStream fStream, uint offset) 118 | { 119 | fStream.Seek(offset, SeekOrigin.Begin); 120 | return br.ReadUInt16(); 121 | } 122 | 123 | public void Saveushort(System.IO.FileStream fStream, uint offset, ushort number) 124 | { 125 | byte[] tmp = System.BitConverter.GetBytes(number); 126 | fStream.Seek(offset, SeekOrigin.Begin); 127 | fStream.Write(tmp, 0, tmp.Length); 128 | } 129 | } 130 | } -------------------------------------------------------------------------------- /PalEditor/PalGoods.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: jason(jsfaint@gmail.com) 4 | * Date: 2009-5-14 5 | * Time: 10:28 6 | * 7 | */ 8 | 9 | using System; 10 | using System.IO; 11 | 12 | namespace PalEditor 13 | { 14 | #region struct 15 | 16 | public struct PALGoods 17 | { 18 | public ushort goodsID; 19 | public ushort goodsCnt; 20 | 21 | public PALGoods(ushort objID, ushort objCnt) 22 | { 23 | this.goodsID = objID; 24 | this.goodsCnt = objCnt; 25 | } 26 | } 27 | 28 | public struct PalGoodsInfo 29 | { 30 | public ushort goodsID; //物品编号 31 | public string goodsDescript; //物品名称 32 | public ushort goodsCnt; 33 | 34 | public PalGoodsInfo(ushort objID, string objDescript) 35 | { 36 | this.goodsID = objID; 37 | this.goodsDescript = objDescript; 38 | this.goodsCnt = 0; 39 | } 40 | } 41 | 42 | #endregion 43 | 44 | public class PalGoods 45 | { 46 | private uint PAL_GOODS_OFFSET = 0x6c0; 47 | private byte[] gBuf; //缓存 48 | private PALGoods[] goods; //内存数组 49 | private const ushort GOODS_CNT = 234; 50 | 51 | #region PalGoodsInfo 52 | 53 | public PalGoodsInfo[] goodsInfo = new PalGoodsInfo[GOODS_CNT] //显示用数组 54 | { 55 | new PalGoodsInfo(0x003d, "观音符"), 56 | new PalGoodsInfo(0x003e, "圣灵符"), 57 | new PalGoodsInfo(0x003f, "金刚符"), 58 | new PalGoodsInfo(0x0040, "净衣符"), 59 | new PalGoodsInfo(0x0041, "灵心符"), 60 | new PalGoodsInfo(0x0042, "天师符"), 61 | new PalGoodsInfo(0x0043, "风灵符"), 62 | new PalGoodsInfo(0x0044, "雷灵符"), 63 | new PalGoodsInfo(0x0045, "水灵符"), 64 | new PalGoodsInfo(0x0046, "火灵符"), 65 | new PalGoodsInfo(0x0047, "土灵符"), 66 | new PalGoodsInfo(0x0048, "舍利子"), 67 | new PalGoodsInfo(0x0049, "玉菩提"), 68 | new PalGoodsInfo(0x004a, "银杏子"), 69 | new PalGoodsInfo(0x004b, "糯米"), 70 | new PalGoodsInfo(0x004c, "糯米糕"), 71 | new PalGoodsInfo(0x004d, "盐巴"), 72 | new PalGoodsInfo(0x004e, "茶叶蛋"), 73 | new PalGoodsInfo(0x004f, "鸡蛋"), 74 | new PalGoodsInfo(0x0050, "糖葫芦"), 75 | new PalGoodsInfo(0x0051, "蜡烛"), 76 | new PalGoodsInfo(0x0052, "符纸"), 77 | new PalGoodsInfo(0x0053, "檀香"), 78 | new PalGoodsInfo(0x0054, "大蒜"), 79 | new PalGoodsInfo(0x0055, "黑狗血"), 80 | new PalGoodsInfo(0x0056, "酒"), 81 | new PalGoodsInfo(0x0057, "雄黄"), 82 | new PalGoodsInfo(0x0058, "雄黄酒"), 83 | new PalGoodsInfo(0x0059, "九节菖蒲"), 84 | new PalGoodsInfo(0x005a, "驱魔香"), 85 | new PalGoodsInfo(0x005b, "十里香"), 86 | new PalGoodsInfo(0x005c, "水果"), 87 | new PalGoodsInfo(0x005d, "烧肉"), 88 | new PalGoodsInfo(0x005e, "腌肉"), 89 | new PalGoodsInfo(0x005f, "还魂香 "), 90 | new PalGoodsInfo(0x0060, "赎魂灯"), 91 | new PalGoodsInfo(0x0061, "孟婆汤"), 92 | new PalGoodsInfo(0x0062, "天香续命露"), 93 | new PalGoodsInfo(0x0063, "止血草"), 94 | new PalGoodsInfo(0x0064, "行军丹"), 95 | new PalGoodsInfo(0x0065, "金创药"), 96 | new PalGoodsInfo(0x0066, "蟠果"), 97 | new PalGoodsInfo(0x0067, "紫青玉容膏"), 98 | new PalGoodsInfo(0x0068, "鼠儿果"), 99 | new PalGoodsInfo(0x0069, "还神丹"), 100 | new PalGoodsInfo(0x006a, "龙涎草"), 101 | new PalGoodsInfo(0x006b, "灵山仙芝"), 102 | new PalGoodsInfo(0x006c, "雪莲子"), 103 | new PalGoodsInfo(0x006d, "天仙玉露"), 104 | new PalGoodsInfo(0x006e, "神仙茶"), 105 | new PalGoodsInfo(0x006f, "灵胡仙丹"), 106 | new PalGoodsInfo(0x0070, "试炼果"), 107 | new PalGoodsInfo(0x0071, "女娲石"), 108 | new PalGoodsInfo(0x0072, "八仙石"), 109 | new PalGoodsInfo(0x0073, "蜂巢"), 110 | new PalGoodsInfo(0x0074, "尸腐肉"), 111 | new PalGoodsInfo(0x0075, "毒蛇卵"), 112 | new PalGoodsInfo(0x0076, "毒蝎卵"), 113 | new PalGoodsInfo(0x0077, "毒蟾卵"), 114 | new PalGoodsInfo(0x0078, "蜘蛛卵"), 115 | new PalGoodsInfo(0x0079, "蜈蚣卵"), 116 | new PalGoodsInfo(0x007a, "鹤顶红"), 117 | new PalGoodsInfo(0x007b, "孔雀胆"), 118 | new PalGoodsInfo(0x007c, "血海棠"), 119 | new PalGoodsInfo(0x007d, "断肠草"), 120 | new PalGoodsInfo(0x007e, "醍醐香"), 121 | new PalGoodsInfo(0x007f, "忘魂花"), 122 | new PalGoodsInfo(0x0080, "紫罂粟"), 123 | new PalGoodsInfo(0x0081, "鬼枯藤"), 124 | new PalGoodsInfo(0x0082, "腹蛇涎"), 125 | new PalGoodsInfo(0x0083, "蜂王蜜"), 126 | new PalGoodsInfo(0x0084, "雪蛤蟆"), 127 | new PalGoodsInfo(0x0085, "赤蝎粉"), 128 | new PalGoodsInfo(0x0086, "化尸水"), 129 | new PalGoodsInfo(0x0087, "迷魂香"), 130 | new PalGoodsInfo(0x0088, "九阴散"), 131 | new PalGoodsInfo(0x0089, "无影毒"), 132 | new PalGoodsInfo(0x008a, "三尸蛊"), 133 | new PalGoodsInfo(0x008b, "金蚕蛊"), 134 | new PalGoodsInfo(0x008c, "幻蛊"), 135 | new PalGoodsInfo(0x008d, "隐蛊"), 136 | new PalGoodsInfo(0x008e, "冰蚕蛊"), 137 | new PalGoodsInfo(0x008f, "火蚕蛊"), 138 | new PalGoodsInfo(0x0090, "食妖蛊"), 139 | new PalGoodsInfo(0x0091, "灵蛊"), 140 | new PalGoodsInfo(0x0092, "爆烈蛊"), 141 | new PalGoodsInfo(0x0093, "碧血蛊"), 142 | new PalGoodsInfo(0x0094, "蛊"), 143 | new PalGoodsInfo(0x0095, "赤血蛊"), 144 | new PalGoodsInfo(0x0096, "金蚕王"), 145 | new PalGoodsInfo(0x0097, "引路蜂"), 146 | new PalGoodsInfo(0x0098, "傀儡蛊"), 147 | new PalGoodsInfo(0x0099, "梅花镖"), 148 | new PalGoodsInfo(0x009a, "袖里剑"), 149 | new PalGoodsInfo(0x009b, "透骨丁"), 150 | new PalGoodsInfo(0x009c, "雷火珠"), 151 | new PalGoodsInfo(0x009d, "毒龙砂"), 152 | new PalGoodsInfo(0x009e, "吸星锁"), 153 | new PalGoodsInfo(0x009f, "缠魂丝"), 154 | new PalGoodsInfo(0x00a0, "捆仙绳"), 155 | new PalGoodsInfo(0x00a1, "无影神针"), 156 | new PalGoodsInfo(0x00a2, "血玲珑"), 157 | new PalGoodsInfo(0x00a3, "长鞭"), 158 | new PalGoodsInfo(0x00a4, "九节鞭"), 159 | new PalGoodsInfo(0x00a5, "金蛇鞭"), 160 | new PalGoodsInfo(0x00a6, "木剑"), 161 | new PalGoodsInfo(0x00a7, "短刀"), 162 | new PalGoodsInfo(0x00a8, "铁剑"), 163 | new PalGoodsInfo(0x00a9, "大刀"), 164 | new PalGoodsInfo(0x00aa, "仙女剑"), 165 | new PalGoodsInfo(0x00ab, "长剑"), 166 | new PalGoodsInfo(0x00ac, "红缨刀"), 167 | new PalGoodsInfo(0x00ad, "越女剑"), 168 | new PalGoodsInfo(0x00ae, "戒刀"), 169 | new PalGoodsInfo(0x00af, "玄铁剑"), 170 | new PalGoodsInfo(0x00b0, "芙蓉刀"), 171 | new PalGoodsInfo(0x00b1, "柳月刀"), 172 | new PalGoodsInfo(0x00b2, "青锋剑"), 173 | new PalGoodsInfo(0x00b3, "苗刀"), 174 | new PalGoodsInfo(0x00b4, "凤鸣刀"), 175 | new PalGoodsInfo(0x00b5, "双龙剑"), 176 | new PalGoodsInfo(0x00b6, "玉女剑"), 177 | new PalGoodsInfo(0x00b7, "金童剑"), 178 | new PalGoodsInfo(0x00b8, "龙泉剑"), 179 | new PalGoodsInfo(0x00b9, "鬼牙刀"), 180 | new PalGoodsInfo(0x00ba, "七星剑"), 181 | new PalGoodsInfo(0x00bb, "玄冥宝刀"), 182 | new PalGoodsInfo(0x00bc, "巫月神刀"), 183 | new PalGoodsInfo(0x00bd, "磐龙剑"), 184 | new PalGoodsInfo(0x00be, "太极剑"), 185 | new PalGoodsInfo(0x00bf, "无尘剑"), 186 | new PalGoodsInfo(0x00c0, "青蛇杖"), 187 | new PalGoodsInfo(0x00c1, "鬼头杖"), 188 | new PalGoodsInfo(0x00c2, "冥蛇杖"), 189 | new PalGoodsInfo(0x00c3, "天蛇杖"), 190 | new PalGoodsInfo(0x00c4, "头巾"), 191 | new PalGoodsInfo(0x00c5, "青丝巾"), 192 | new PalGoodsInfo(0x00c6, "发饰"), 193 | new PalGoodsInfo(0x00c7, "银钗 "), 194 | new PalGoodsInfo(0x00c8, "翠玉金钗"), 195 | new PalGoodsInfo(0x00c9, "皮帽"), 196 | new PalGoodsInfo(0x00ca, "珍珠冠"), 197 | new PalGoodsInfo(0x00cb, "天师帽"), 198 | new PalGoodsInfo(0x00cc, "紫金冠"), 199 | new PalGoodsInfo(0x00cd, "天蚕丝带"), 200 | new PalGoodsInfo(0x00ce, "凤凰羽毛"), 201 | new PalGoodsInfo(0x00cf, "冲天冠"), 202 | new PalGoodsInfo(0x00d0, "布袍"), 203 | new PalGoodsInfo(0x00d1, "藤甲"), 204 | new PalGoodsInfo(0x00d2, "丝衣"), 205 | new PalGoodsInfo(0x00d3, "铁锁衣"), 206 | new PalGoodsInfo(0x00d4, "夜行衣"), 207 | new PalGoodsInfo(0x00d5, "青铜甲"), 208 | new PalGoodsInfo(0x00d6, "罗汉袍"), 209 | new PalGoodsInfo(0x00d7, "铁鳞甲"), 210 | new PalGoodsInfo(0x00d8, "天师道袍"), 211 | new PalGoodsInfo(0x00d9, "精铁战甲"), 212 | new PalGoodsInfo(0x00da, "金镂衣"), 213 | new PalGoodsInfo(0x00db, "鬼针胄"), 214 | new PalGoodsInfo(0x00dc, "天蚕宝衣"), 215 | new PalGoodsInfo(0x00dd, "青龙宝甲"), 216 | new PalGoodsInfo(0x00de, "白虎之铠"), 217 | new PalGoodsInfo(0x00df, "玄武战袍"), 218 | new PalGoodsInfo(0x00e0, "朱雀战衣"), 219 | new PalGoodsInfo(0x00e1, "披风"), 220 | new PalGoodsInfo(0x00e2, "护肩"), 221 | new PalGoodsInfo(0x00e3, "武士披风"), 222 | new PalGoodsInfo(0x00e4, "护心镜"), 223 | new PalGoodsInfo(0x00e5, "霓虹羽衣"), 224 | new PalGoodsInfo(0x00e6, "菩提袈裟"), 225 | new PalGoodsInfo(0x00e7, "虎纹披风"), 226 | new PalGoodsInfo(0x00e8, "凤纹披风"), 227 | new PalGoodsInfo(0x00e9, "龙纹披风"), 228 | new PalGoodsInfo(0x00ea, "圣灵披风"), 229 | new PalGoodsInfo(0x00eb, "草鞋"), 230 | new PalGoodsInfo(0x00ec, "木鞋"), 231 | new PalGoodsInfo(0x00ed, "布靴"), 232 | new PalGoodsInfo(0x00ee, "绣花鞋"), 233 | new PalGoodsInfo(0x00ef, "铁履"), 234 | new PalGoodsInfo(0x00f0, "武僧靴"), 235 | new PalGoodsInfo(0x00f1, "鹿皮靴"), 236 | new PalGoodsInfo(0x00f2, "疾风靴"), 237 | new PalGoodsInfo(0x00f3, "莲花靴"), 238 | new PalGoodsInfo(0x00f4, "虎皮靴"), 239 | new PalGoodsInfo(0x00f5, "龙鳞靴"), 240 | new PalGoodsInfo(0x00f6, "步云靴"), 241 | new PalGoodsInfo(0x00f7, "魅影神靴"), 242 | new PalGoodsInfo(0x00f8, "香袋"), 243 | new PalGoodsInfo(0x00f9, "护腕"), 244 | new PalGoodsInfo(0x00fa, "铁护腕"), 245 | new PalGoodsInfo(0x00fb, "竹笛 "), 246 | new PalGoodsInfo(0x00fc, "珍珠"), 247 | new PalGoodsInfo(0x00fd, "玉镯"), 248 | new PalGoodsInfo(0x00fe, "念珠"), 249 | new PalGoodsInfo(0x00ff, "银针"), 250 | new PalGoodsInfo(0x0100, "铜镜"), 251 | new PalGoodsInfo(0x0101, "八卦镜"), 252 | new PalGoodsInfo(0x0102, "乾坤镜"), 253 | new PalGoodsInfo(0x0103, "豹牙手环"), 254 | new PalGoodsInfo(0x0104, "圣灵珠"), 255 | new PalGoodsInfo(0x0105, "金罡珠"), 256 | new PalGoodsInfo(0x0106, "五毒珠"), 257 | new PalGoodsInfo(0x0107, "风灵珠"), 258 | new PalGoodsInfo(0x0108, "雷灵珠"), 259 | new PalGoodsInfo(0x0109, "水灵珠"), 260 | new PalGoodsInfo(0x010a, "火灵珠"), 261 | new PalGoodsInfo(0x010b, "土灵珠"), 262 | new PalGoodsInfo(0x010c, "炼蛊器"), 263 | new PalGoodsInfo(0x010d, "寿葫芦"), 264 | new PalGoodsInfo(0x010e, "紫金葫芦"), 265 | new PalGoodsInfo(0x010f, "布包"), 266 | new PalGoodsInfo(0x0110, "桂花酒"), 267 | new PalGoodsInfo(0x0111, "紫金丹"), 268 | new PalGoodsInfo(0x0112, "玉佛珠"), 269 | new PalGoodsInfo(0x0113, "金凤凰蛋壳"), 270 | new PalGoodsInfo(0x0114, "火眼麒麟角"), 271 | new PalGoodsInfo(0x0115, "青龙碧血玉"), 272 | new PalGoodsInfo(0x0116, "毒龙胆"), 273 | new PalGoodsInfo(0x0117, "破天槌"), 274 | new PalGoodsInfo(0x0118, "包袱"), 275 | new PalGoodsInfo(0x0119, "银杏果"), 276 | new PalGoodsInfo(0x011a, "鲤鱼"), 277 | new PalGoodsInfo(0x011b, "鹿茸"), 278 | new PalGoodsInfo(0x011c, "钓竿"), 279 | new PalGoodsInfo(0x011d, "捕兽夹"), 280 | new PalGoodsInfo(0x011e, "六神丹"), 281 | new PalGoodsInfo(0x011f, "情书"), 282 | new PalGoodsInfo(0x0120, "玉佩"), 283 | new PalGoodsInfo(0x0121, "石钥匙"), 284 | new PalGoodsInfo(0x0122, "天书"), 285 | new PalGoodsInfo(0x0123, "香蕉"), 286 | new PalGoodsInfo(0x0124, "凤纹手绢"), 287 | new PalGoodsInfo(0x0125, "手卷"), 288 | new PalGoodsInfo(0x0126, "芦苇漂") 289 | }; 290 | 291 | #endregion 292 | 293 | public PalGoods() 294 | { 295 | gBuf = new byte[GOODS_CNT * 6]; //缓存 296 | goods = new PALGoods[GOODS_CNT]; //内存数组 297 | } 298 | 299 | #region Load Save 300 | 301 | public void LoadPalGoods(System.IO.FileStream fStream) 302 | { 303 | try 304 | { 305 | //文件到缓存 306 | fStream.Seek(PAL_GOODS_OFFSET, SeekOrigin.Begin); 307 | fStream.Read(gBuf, 0, gBuf.Length); 308 | 309 | //缓存到内存数组 310 | for (int ii = 0; ii < GOODS_CNT; ii++) 311 | { 312 | ushort id = System.BitConverter.ToUInt16(gBuf, ii * 6); 313 | ushort cnt = System.BitConverter.ToUInt16(gBuf, ii * 6 + 2); 314 | goods[ii] = new PALGoods(id, cnt); 315 | } 316 | 317 | //内存数组到显示用数组 318 | for (int ii = 0; ii < GOODS_CNT; ii++) 319 | { 320 | if (goods[ii].goodsID == 0) //id为0时说明箱子中无此物品 321 | continue; 322 | for (int jj = 0; jj < GOODS_CNT; jj++) 323 | { 324 | if (goods[ii].goodsID == goodsInfo[jj].goodsID) 325 | { 326 | goodsInfo[jj].goodsCnt = goods[ii].goodsCnt; 327 | break; 328 | } 329 | } 330 | } 331 | } 332 | catch (Exception e) 333 | { 334 | System.Windows.Forms.MessageBox.Show("Exception in PalGoods.LoadPalGoods(): " + e.Message); 335 | } 336 | } 337 | 338 | public void SavePalGoods(System.IO.FileStream fStream) 339 | { 340 | try 341 | { 342 | //显示用数组到内存数组, ii:显示, jj=内存 343 | for (int ii = 0; ii < GOODS_CNT; ii++) 344 | { 345 | if (goodsInfo[ii].goodsCnt == 0) 346 | continue; 347 | 348 | bool bExist = false; 349 | 350 | for (int jj = 0; jj < GOODS_CNT; jj++) 351 | { 352 | if (goods[jj].goodsID == 0) 353 | { 354 | if (!bExist) 355 | { 356 | goods[jj].goodsID = goodsInfo[ii].goodsID; 357 | goods[jj].goodsCnt = goodsInfo[ii].goodsCnt; 358 | } 359 | 360 | break; 361 | } 362 | 363 | if (goods[jj].goodsID == goodsInfo[ii].goodsID) 364 | { 365 | goods[jj].goodsCnt = goodsInfo[ii].goodsCnt; 366 | bExist = true; 367 | break; 368 | } 369 | } 370 | } 371 | 372 | //内存数组到缓存 373 | for (int ii = 0; ii < GOODS_CNT; ii++) 374 | { 375 | byte[] tmp1 = System.BitConverter.GetBytes(goods[ii].goodsID); 376 | byte[] tmp2 = System.BitConverter.GetBytes(goods[ii].goodsCnt); 377 | 378 | gBuf[ii * 6 + 0] = tmp1[0]; 379 | gBuf[ii * 6 + 1] = tmp1[1]; 380 | gBuf[ii * 6 + 2] = tmp2[0]; 381 | gBuf[ii * 6 + 3] = tmp2[1]; 382 | } 383 | 384 | //缓存到文件 385 | fStream.Seek(PAL_GOODS_OFFSET, SeekOrigin.Begin); 386 | fStream.Write(gBuf, 0, gBuf.Length); 387 | } 388 | catch (Exception e) 389 | { 390 | System.Windows.Forms.MessageBox.Show("Exception in PalGoods.SavePalGoods(): " + e.Message); 391 | } 392 | } 393 | 394 | #endregion 395 | 396 | public void allGoods99() 397 | { 398 | for (int ii = 0; ii < GOODS_CNT; ii++) 399 | { 400 | goodsInfo[ii].goodsCnt = 99; 401 | } 402 | } 403 | 404 | #region debug 405 | 406 | #if DEBUG 407 | //the following functions only for debug. 408 | private void outputDbgFile(string fileName) 409 | { 410 | String strout = ""; 411 | 412 | for (int ii = 0; ii < GOODS_CNT; ii++) 413 | { 414 | strout = strout + goodsInfo[ii].goodsDescript + ", " + goodsInfo[ii].goodsCnt + "\r\n"; 415 | } 416 | 417 | TextWriter stringWriter = new System.IO.StreamWriter(fileName); 418 | stringWriter.Write(strout); 419 | stringWriter.Close(); 420 | } 421 | 422 | private void DumpHex(byte[] tmp) 423 | { 424 | String strout = ""; 425 | int count = 0; 426 | 427 | for (int ii = 0; ii < tmp.Length; ii++) 428 | { 429 | strout = strout + tmp[ii].ToString() + ", "; 430 | count++; 431 | 432 | if (count % 10 == 0) 433 | { 434 | strout += "\r\n"; 435 | count = 0; 436 | } 437 | } 438 | 439 | TextWriter stringWriter = new System.IO.StreamWriter("dumpHex.txt"); 440 | stringWriter.Write(strout); 441 | stringWriter.Close(); 442 | } 443 | #endif 444 | 445 | #endregion 446 | } 447 | } -------------------------------------------------------------------------------- /PalEditor/PalMagic.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfaint/PalEditor/3bb4fd250a4feb77a601fae1babf253abf6cb56a/PalEditor/PalMagic.cs -------------------------------------------------------------------------------- /PalEditor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace PalEditor 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [MTAThread] 12 | static void Main() 13 | { 14 | Application.Run(new Form1()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /PalEditor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PalEditor")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PalEditor")] 13 | [assembly: AssemblyCopyright("Copyright © 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8B2960CF-B76C-465F-A246-E9B7CEB1C395")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /PalEditor/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PalEditor.Properties 12 | { 13 | /// 14 | /// A strongly-typed resource class, for looking up localized strings, etc. 15 | /// 16 | // This class was auto-generated by the StronglyTypedResourceBuilder 17 | // class via a tool like ResGen or Visual Studio. 18 | // To add or remove a member, edit your .ResX file then rerun ResGen 19 | // with the /str option, or rebuild your VS project. 20 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", 21 | "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources 25 | { 26 | private static global::System.Resources.ResourceManager resourceMan; 27 | 28 | private static global::System.Globalization.CultureInfo resourceCulture; 29 | 30 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", 31 | "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() 33 | { 34 | } 35 | 36 | /// 37 | /// Returns the cached ResourceManager instance used by this class. 38 | /// 39 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState 40 | .Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = 48 | new global::System.Resources.ResourceManager("PalEditor.Properties.Resources", 49 | typeof(Resources).Assembly); 50 | resourceMan = temp; 51 | } 52 | 53 | return resourceMan; 54 | } 55 | } 56 | 57 | /// 58 | /// Overrides the current thread's CurrentUICulture property for all 59 | /// resource lookups using this strongly typed resource class. 60 | /// 61 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState 62 | .Advanced)] 63 | internal static global::System.Globalization.CultureInfo Culture 64 | { 65 | get { return resourceCulture; } 66 | set { resourceCulture = value; } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /PalEditor/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /PalEditor/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PalEditor.Properties 12 | { 13 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 14 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute( 15 | "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 17 | { 18 | private static Settings defaultInstance = 19 | ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 20 | 21 | public static Settings Default 22 | { 23 | get { return defaultInstance; } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /PalEditor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PalEditor/RPGData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: jason(jsfaint@gmail.com) 4 | * Date: 2009-4-21 5 | * Time: 10:25 6 | * 7 | */ 8 | 9 | using System; 10 | using System.IO; 11 | 12 | namespace PalEditor //should be modified 13 | { 14 | /// 15 | /// Description of SaveData. 16 | /// 17 | public class RPGData 18 | { 19 | #region offset map 20 | 21 | // offset map 22 | private const uint PAL_SAVETIME_OFFSET = 0x0000; //保存次数 23 | private const uint PAL_CALABASH_OFFSET = 0x0018; //当前灵葫值 24 | private const uint PAL_MONEY_OFFSET = 0x0028; //金钱 25 | 26 | private readonly uint[] p1_offset = 27 | { 0x7C, 0x244, 0x250, 0x25c, 0x268, 0x274, 0x2c8, 0x2d4, 0x2e0, 0x2ec, 0x2f8 }; 28 | 29 | private readonly uint[] p2_offset = 30 | { 0x84, 0x246, 0x252, 0x25e, 0x26a, 0x276, 0x2ca, 0x2d6, 0x2e2, 0x2ee, 0x2fa }; 31 | 32 | private readonly uint[] p3_offset = 33 | { 0x8c, 0x248, 0x254, 0x260, 0x26c, 0x278, 0x2cc, 0x2d8, 0x2e4, 0x2f0, 0x2fc }; 34 | 35 | private readonly uint[] p4_offset = 36 | { 0x94, 0x24a, 0x256, 0x262, 0x26e, 0x27a, 0x2ce, 0x2da, 0x2e6, 0x2f2, 0x2fe }; 37 | 38 | private readonly uint[] p5_offset = 39 | { 0x9c, 0x24c, 0x258, 0x264, 0x270, 0x27e, 0x2d0, 0x2dc, 0x2e8, 0x2f4, 0x300 }; 40 | 41 | #endregion 42 | 43 | //人物 44 | public PalExp[] palExp; 45 | 46 | //物品 47 | public PalGoods palGoods; 48 | 49 | //仙术 50 | public PalMagic palMagic; 51 | 52 | //其他 53 | public uint palMoney; //金钱 54 | public ushort palSaveTime; //保存次数 55 | public ushort palCalabash; //灵葫值 56 | private FileStream fStream; 57 | 58 | public RPGData() 59 | { 60 | palExp = new PalExp[5] 61 | { 62 | new PalExp(p1_offset), //李逍遥 63 | new PalExp(p2_offset), //赵灵儿 64 | new PalExp(p3_offset), //林月如 65 | new PalExp(p4_offset), //巫后 66 | new PalExp(p5_offset) //阿奴 67 | }; 68 | palGoods = new PalGoods(); 69 | palMagic = new PalMagic(); 70 | } 71 | 72 | public bool OpenPalSave(String fileName) 73 | { 74 | if (!File.Exists(fileName)) 75 | { 76 | return false; //文件未找到 77 | } 78 | 79 | try 80 | { 81 | fStream.Close(); 82 | } 83 | catch (Exception e) 84 | { 85 | System.Console.WriteLine(e.Message); 86 | } 87 | 88 | try 89 | { 90 | fStream = new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.Read); 91 | LoadFromFile(); 92 | return true; 93 | } 94 | catch (Exception e) 95 | { 96 | System.Console.WriteLine("Exception in RPGData.OpenPalSave(): " + e.Message); 97 | System.Windows.Forms.MessageBox.Show("打开存档文件失败", "错误"); 98 | return false; 99 | } 100 | } 101 | 102 | #region Money 金钱 103 | 104 | private bool LoadMoney(System.IO.BinaryReader br) 105 | { 106 | try 107 | { 108 | fStream.Seek(PAL_MONEY_OFFSET, SeekOrigin.Begin); 109 | palMoney = br.ReadUInt32(); 110 | return true; 111 | } 112 | catch (Exception e) 113 | { 114 | System.Console.WriteLine("Exception in RPGData.LoadMoney(): " + e.Message); 115 | return false; 116 | } 117 | } 118 | 119 | private bool SaveMoney() 120 | { 121 | try 122 | { 123 | byte[] tmp = System.BitConverter.GetBytes(this.palMoney); 124 | WriteByte(PAL_MONEY_OFFSET, tmp); 125 | return true; 126 | } 127 | catch (Exception e) 128 | { 129 | System.Console.WriteLine("Exception in RPGData.SaveMoney(): " + e.Message); 130 | System.Windows.Forms.MessageBox.Show("Exception in RPGData.SaveMoney(): " + e.Message); 131 | return false; 132 | } 133 | } 134 | 135 | #endregion 136 | 137 | #region Save Time 存档次数 138 | 139 | private bool LoadSaveTime(System.IO.BinaryReader br) 140 | { 141 | try 142 | { 143 | fStream.Seek(PAL_SAVETIME_OFFSET, SeekOrigin.Begin); 144 | palSaveTime = br.ReadUInt16(); 145 | return true; 146 | } 147 | catch (Exception e) 148 | { 149 | System.Console.WriteLine("Exception in RPGData.LoadSaveTime(): " + e.Message); 150 | return false; 151 | } 152 | } 153 | 154 | private bool SaveSaveTime() 155 | { 156 | try 157 | { 158 | byte[] tmp = System.BitConverter.GetBytes(this.palSaveTime); 159 | WriteByte(PAL_SAVETIME_OFFSET, tmp); 160 | return true; 161 | } 162 | catch (Exception e) 163 | { 164 | System.Console.WriteLine("Exception in RPGData.SaveSaveTime(): " + e.Message); 165 | return false; 166 | } 167 | } 168 | 169 | #endregion 170 | 171 | #region Calabash 灵葫值 172 | 173 | private bool LoadCalabash(System.IO.BinaryReader br) 174 | { 175 | try 176 | { 177 | fStream.Seek(PAL_CALABASH_OFFSET, SeekOrigin.Begin); 178 | palCalabash = br.ReadUInt16(); 179 | return true; 180 | } 181 | catch (Exception e) 182 | { 183 | System.Console.WriteLine("Exception in RPGData.LoadCalabash(): " + e.Message); 184 | return false; 185 | } 186 | } 187 | 188 | private bool SaveCalabash() 189 | { 190 | try 191 | { 192 | byte[] tmp = System.BitConverter.GetBytes(this.palCalabash); 193 | WriteByte(PAL_CALABASH_OFFSET, tmp); 194 | return true; 195 | } 196 | catch (Exception e) 197 | { 198 | System.Console.WriteLine("Exception in RPGData.SaveCalabash(): " + e.Message); 199 | return false; 200 | } 201 | } 202 | 203 | #endregion 204 | 205 | public int LoadFromFile() 206 | { 207 | try 208 | { 209 | System.IO.BinaryReader binRead = new BinaryReader(fStream); 210 | LoadMoney(binRead); 211 | LoadSaveTime(binRead); 212 | LoadCalabash(binRead); 213 | 214 | for (int ii = 0; ii < palExp.Length; ii++) 215 | palExp[ii].LoadPalExp(fStream); 216 | 217 | palGoods.LoadPalGoods(fStream); 218 | palMagic.LoadPalMagic(fStream); 219 | return 0; 220 | } 221 | catch (Exception e) 222 | { 223 | System.Console.WriteLine("Exception in RPGData.LoadFromFile(): " + e.Message); 224 | System.Windows.Forms.MessageBox.Show("Exception in RPGData.LoadFromFile(): " + e.Message); 225 | return -1; 226 | } 227 | } 228 | 229 | public int SaveToFile() 230 | { 231 | try 232 | { 233 | SaveMoney(); //金钱 234 | SaveCalabash(); //灵葫值 235 | SaveSaveTime(); //存盘次数 236 | 237 | for (int ii = 0; ii < palExp.Length; ii++) 238 | palExp[ii].SavePalExp(fStream); 239 | 240 | palGoods.SavePalGoods(fStream); 241 | palMagic.SavePalMagic(fStream); 242 | fStream.Close(); 243 | return 0; 244 | } 245 | catch (Exception e) 246 | { 247 | System.Console.WriteLine("Exception in RPGData.SaveToFile(): " + e.Message); 248 | System.Windows.Forms.MessageBox.Show("Exception in RPGData.SaveToFile(): " + e.Message); 249 | return -1; 250 | } 251 | } 252 | 253 | private void WriteByte(uint offset, byte[] byteArray) 254 | { 255 | try 256 | { 257 | fStream.Seek(offset, SeekOrigin.Begin); 258 | fStream.Write(byteArray, 0, byteArray.Length); 259 | } 260 | catch (Exception e) 261 | { 262 | System.Windows.Forms.MessageBox.Show("Exception in RPGData.WriteByte(): " + e.Message); 263 | } 264 | } 265 | 266 | //debug using 267 | private void MessageBoxByteArray(byte[] byteArray) 268 | { 269 | string tmp = ""; 270 | 271 | for (int ii = 0; ii < byteArray.Length; ii++) 272 | { 273 | tmp += ii.ToString() + " = " + byteArray[ii].ToString("X") + "\n"; 274 | } 275 | 276 | System.Windows.Forms.MessageBox.Show(tmp, "Information"); 277 | } 278 | } 279 | } -------------------------------------------------------------------------------- /PalEditor/sdlpal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfaint/PalEditor/3bb4fd250a4feb77a601fae1babf253abf6cb56a/PalEditor/sdlpal.ico -------------------------------------------------------------------------------- /PalEditor/法术列表.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfaint/PalEditor/3bb4fd250a4feb77a601fae1babf253abf6cb56a/PalEditor/法术列表.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # paledit 2 | 仙剑奇侠传DOS版存档修改器 3 | 4 | 此工具为仙剑奇侠传DOS版存档修改器 5 | 6 | 适用于移植自仙剑DOS版的各个平台的存档修改 7 | 8 | PPC,PC,S60,PSP等 9 | 10 | 程序使用c#,基于.net CF库,任何支持.net CF的平台都可运行此工具。 11 | 12 | --- 13 | 14 | 15 | trunk下的代码为pc/ppc通用的代码 16 | 17 | branches下为魅族 M8专用 18 | 19 | 20 | --- 21 | 22 | 此工具首发于[PDAFans](http://bbs.pdafans.com/viewthread.php?tid=733687) 23 | 24 | 断断续续的更新过几个版本,添加了不少常用的功能。 25 | 26 | 一直想把源码放出来,可是由于自己代码写得乱七八糟,而且也一直很忙,所以就一直拖到现在。 27 | 28 | 有兴趣的朋友可以看看,如果添加了新功能记得告诉我 :) 29 | 30 | 如有任何问题,欢迎与我联系。 31 | 32 | email: jsfaint@gmail.com 33 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # 更新日志: 2 | 3 | ## 2024 年 11 月 23 日 4 | 5 | 由于代码年久失修,在新版的系统下已经无法构建,对项目做了迁移,使之可以在新环境下构建成功。 6 | 7 | 1. 使用 Rider+dotnet framework 4.8.1 编译通过。 8 | 2. 使用 rider 对代码进行了格式化 9 | 10 | ## 2010 年 5 月 30 更新 11 | 12 | 重写部分代码, 修正了 VGA 仙术第三列错位问题(我很 sb 的写错了一个变量的值) 13 | 关于仙术第 5 个字显示不全的问题应该好了, 不过我的开发环境以及模拟器都是英文的, 模拟器中中文显示有问题, 所以不确定 14 | 增强用户体验(其实, 还是很奇怪..) 15 | 16 | ## 2010 年 5 月 29 第三次更新 17 | 18 | 这次终于在 VGA 机器上完美显示了, 再次感谢 xsyyuyu 的帮助! 19 | 修改了显示错行.. 20 | 按照 xsyyuyu 提出的建议修改了处理方式 21 | 22 | ## 2010 年 5 月 29 第二次更新 23 | 24 | 再次更新, 证实 M8 在 VGA 机器上排版是乱掉的(感谢 xsyyuyu 的测试), 移除 M8 版下载 25 | 对源码进行了修正, 修了一个物品列表中名称显示不全的 bug 26 | 这个版本 VGA/QVGA 应该都可以正常显示了, QVGA 我真机看过了, 显示正常 27 | VGA 机器在模拟器大概看了一下是正常的(电脑太老了, 运行模拟器卡得不行..) 28 | 经过 xsyyuyu 的测试, 果然还是不行啊.. 29 | 30 | ## 2010 年 5 月 29 更新 31 | 32 | 其实 M8 版已经做好一周了, 在魅族论坛发过, 似乎被人无视了 33 | 这个给 vga 屏的 ppc 用应该也是正常的, 功能相同, 只是对界面重新排版了 34 | 有 VGA 机器的朋友麻烦帮忙看看是否正常, 排版是否会乱掉 35 | 36 | ## 2010 年 5 月 19 更新 37 | 38 | 添加仙术修改功能 39 | 对物品修改界面进行调整 40 | 41 | ## 2010 年 5 月 15 日更新 42 | 43 | 添加物品修改功能, 已进行测试, 没遇到什么问题, 如有朋友遇到问题请留言, 谢谢! 44 | --------------------------------------------------------------------------------