From 9cff2bbd6b7fdecbe908a36028f879f990c9fe51 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 4 Aug 2015 19:42:03 -0700 Subject: [PATCH] Fix item object Was missing 4 bytes. --- pk3DS/Structs.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pk3DS/Structs.cs b/pk3DS/Structs.cs index 44ad295..569dacf 100644 --- a/pk3DS/Structs.cs +++ b/pk3DS/Structs.cs @@ -434,13 +434,15 @@ public class Item public byte FieldEffect; // Revive 1, Sacred Ash 3, Rare Candy 5, EvoStone 8 public int BoostATK, BoostDEF, BoostSPA, - BoostSPD, BoostSPE, + BoostSPD, BoostSPE, BoostACC, BoostCRIT, BoostPP; + public ushort FunctionFlags; public ushort FieldBoost; // 0x15-0x16 public byte EVHP, EVATK, EVDEF, EVSPE, EVSPA, EVSPD; public Heal Healing; public byte PPGain, Friendship1, Friendship2, Friendship3; + public byte _0x23, _0x24; public Item(byte[] data) { @@ -482,6 +484,8 @@ public Item(byte[] data) BoostPP = (BoostACC >> 6); BoostACC &= 0xF; + FunctionFlags = br.ReadUInt16(); + EVHP = br.ReadByte(); EVATK = br.ReadByte(); EVDEF = br.ReadByte(); @@ -494,6 +498,8 @@ public Item(byte[] data) Friendship1 = br.ReadByte(); Friendship2 = br.ReadByte(); Friendship3 = br.ReadByte(); + _0x23 = br.ReadByte(); + _0x24 = br.ReadByte(); } } public byte[] Write() @@ -523,6 +529,8 @@ public byte[] Write() bw.Write((byte)(BoostSPD | (BoostSPE << 4))); bw.Write((byte)(BoostACC | (BoostCRIT << 4) | (BoostPP << 6))); + bw.Write(FunctionFlags); + bw.Write(EVHP); bw.Write(EVATK); bw.Write(EVDEF); @@ -535,6 +543,9 @@ public byte[] Write() bw.Write(Friendship2); bw.Write(Friendship3); + bw.Write(_0x23); + bw.Write(_0x24); + return ms.ToArray(); } }