forked from three-houses-research-team/010-binary-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPersonFile.bt
373 lines (359 loc) · 12.8 KB
/
PersonFile.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
//------------------------------------------------
//--- 010 Editor v9.0.2 Binary Template
//
// File: Person.bin / 0000010ea800.bin
// Authors: DeathChaos
// Version: 1.06
// Purpose: Three Houses character file mapping
// History
// 1.00 2019-08-05 DeathChaos - started this
// 1.01 ---------- DeathChaos - Added AID
// 1.02 ---------- DeathChaos - Added Voice ID
// 1.03 ---------- DeathChaos - Added Facculty Related stuff
// 1.04 ---------- DeathChaos - Added Portrait IDs
// 1.05 ---------- DeathChaos - Added Character Goals
// 1.06 ---------- DeathChaos - Added Starting Weapon Ranks and Proficiencies
//------------------------------------------------
//---------------------------------------------
// Includes
//---------------------------------------------
#include "3H_Enums.bt"
LittleEndian();
struct File{
struct SectionPointers{
uint32 Header;
uint32 PointerToCharBlocks<bgcolor=cRed>;
uint32 CharBlockStructSize<bgcolor=cRed>;
uint32 PointerToAssetID<bgcolor=cBlue>;
uint32 AssetIDStructSize<bgcolor=cBlue>;
uint32 PointerToVoiceID<bgcolor=cPurple>;
uint32 VoiceIDStructSize<bgcolor=cPurple>;
uint32 PointerToWpnRanks<bgcolor=cDkYellow>;
uint32 WpnRanksStructSize<bgcolor=cDkYellow>;
uint32 PointerToSpellLearnset<bgcolor=cYellow>;
uint32 SpellLearnsetStructSize<bgcolor=cYellow>;
uint32 PointerToSkillLearnset<bgcolor=cYellow>;
uint32 SkillLearnsetStructSize<bgcolor=cYellow>;
uint32 PointerToStartingWeapons<bgcolor=cDkBlue>;
uint32 StartingWeaponsStructSize<bgcolor=cDkBlue>;
uint32 PointerToArtLearnset<bgcolor=cYellow>;
uint32 ArtLearnsetStructSize<bgcolor=cYellow>;
uint32 UnkPointer01<bgcolor=cYellow>;
uint32 UnkTotalSize01<bgcolor=cYellow>;
uint32 UnkPointer01<bgcolor=cYellow>;
uint32 UnkTotalSize01<bgcolor=cYellow>;
uint32 UnkPointer01<bgcolor=cYellow>;
uint32 UnkTotalSize01<bgcolor=cYellow>;
uint32 UnkPointer01<bgcolor=cYellow>;
uint32 UnkTotalSize01<bgcolor=cYellow>;
uint32 UnkPointer01<bgcolor=cYellow>;
uint32 UnkTotalSize01<bgcolor=cYellow>;
uint32 PointerToFacultyTraining<bgcolor=cBlack>;
uint32 FacultyTrainingStructSize<bgcolor=cBlack>;
uint32 PointerToSeminar<bgcolor=cGreen>;
uint32 SeminarTotalSize<bgcolor=cGreen>;
uint32 Size3Pointer<bgcolor=cDkRed>;
uint32 Size3TotalSize<bgcolor=cDkRed>;
uint32 PortraitsPointer<bgcolor=cDkPurple>;
uint32 PortraitsTotalSize<bgcolor=cDkPurple>;
uint32 SizeFourPointer<bgcolor=cDkGreen>;
uint32 SizeFourTotalSize<bgcolor=cDkGreen>;
}sectionpointers<name="Section Pointers">;
FSeek(sectionpointers.PointerToCharBlocks);
struct PersonStructure{
uint32 Person_Magic;
uint32 numPerson;
uint32 SizeOfPersonBlock;
struct PersonHeaderPadding{
byte Padding[0x34];
}personheaderpadding<name="Padding">;
struct Person{
struct ModelScale{
float Scale01;
float Scale02;
float Scale03;
float Scale04;
uint16 UnknownValue;
}modelscale<name="Model Scale Values">;
Names NameID<name="Name ID">;
uint16 unknown<name="Unknown Value">;
uint16 CharID<name="Voice ID">;
uint16 AssetsID<name="Asset ID">;
byte unknown<name="Unknown Value">;
byte Age<name="Age">;
ClassName Class<name="Class">;
byte Birthday<name="Birth Day">;
byte BirthMonth<name="Birth Month">;
byte unknown<name="Unknown Value">;
byte unknown<name="Unknown Value">;
byte BodyType<name="Body Type">;
byte HPCap<name="Max HP">;
byte unknown<name="School Related">;
AllegianceID Allegiance<name="Allegiance">;
byte HPGrowth<name="HP Growth">;
GenderFlag Gender<name="Gender">;
byte BaseHP<name="Base HP">;
byte AnimSet<name="Non Combat Animation Set">;
Crests Crest<name="Primary Crest">;
Crests Crest<name="Secondary Crest">;
byte unknown<name="Unknown Value">;
ubyte PreTimeSkipHeight<name="Pre-Time Skip Height (cm)">;
ubyte PostTimeSkipHeight<name="Post-Time Skip Height (cm)">;
uint16 unknown<name="Unknown Value">;
struct CharacterStats{
struct BaseStats{
byte BaseStr<name="Base Str">;
byte BaseMag<name="Base Mag">;
byte BaseDex<name="Base Dex">;
byte BaseSpd<name="Base Spd">;
byte BaseLck<name="Base Lck">;
byte BaseDef<name="Base Def">;
byte BaseRes<name="Base Res">;
byte BaseMov<name="Base Mov">;
byte BaseCharm<name="Base Cha">;
}basestats<bgcolor=cBlue,name="Base Stats">;
struct BaseGrowths{
byte StrGrowth<name="Str Growth">;
byte MagGrowth<name="Mag Growth">;
byte DexGrowth<name="Dex Growth">;
byte SpdGrowth<name="Spd Growth">;
byte LckGrowth<name="Lck Growth">;
byte DefGrowth<name="Def Growth">;
byte ResGrowth<name="Res Growth">;
byte MovGrowth<name="Mov Growth">;
byte CharmGrowth<name="Cha Growth">;
}basegrowths<bgcolor=cGreen,name="Growths">;
struct MaxStats{
byte MaxStr<name="Max Str">;
byte MaxMag<name="Max Mag">;
byte MaxDex<name="Max Dex">;
byte MaxSpd<name="Max Spd">;
byte MaxLck<name="Max Lck">;
byte MaxDef<name="Max Def">;
byte MaxRes<name="Max Res">;
byte MaxMov<name="Max Mov">;
byte MaxCharm<name="Max Cha">;
}maxstats<bgcolor=cYellow,name="Stat Caps">;
byte padding<name="Padding">;
}characterstats<name="Stats and Growths">;
}person[numPerson]<read=ReadNameID, name="Character Block">;
}personstructure<bgcolor=cRed, name="Character Blocks">;
FSeek(sectionpointers.PointerToAssetID);
struct AssetIDStructure{
uint32 AID_Magic;
uint32 numAID;
uint32 SizeOfAIDBlock;
struct AIDHeaderPadding{
byte Padding[0x34];
}aidheaderpadding<name="Padding">;
struct AssetID{
uint16 PreTimeSkipPortrait;
uint16 TimeSkipHeadModel;
uint16 NGPlusHair;
uint16 PreTimeSkipHead;
uint16 DLCOutfit;
uint16 BodyModelTimeSkip;
uint16 TimeSkipPortrait;
uint16 BodyModelPreTimeSkip;
}assetid[numAID]<bgcolor=cGreen>;
}assetidstructure<bgcolor=cBlue, name="Asset IDs">;
FSeek(sectionpointers.PointerToVoiceID);
struct VoiceIDStructure{
uint32 Voice_Magic;
uint32 numVoice;
uint32 SizeOfVoiceBlock;
struct VoiceHeaderPadding{
byte Padding[0x34];
}voiceheaderpadding<name="Padding">;
struct VoiceID{
uint16 voice;
uint16 voice;
uint16 voice;
uint16 voice;
}voiceid[numVoice];
}voicestructure<bgcolor=cPurple, name="Voice IDs">;
FSeek(sectionpointers.PointerToWpnRanks);
struct WpnRankStructure{
uint32 WpnRank_Magic;
uint32 numWpnRank;
uint32 SizeOfWpnRankBlock;
struct WpnRankPadding{
byte Padding[0x34];
}wpnrankpadding<name="Padding">;
struct WpnRank{
uint16 unk;
ubyte color<name="Outfit Color value">;
ClassName uniqueclass1<name="PreTimeSkip Class">;
ClassName certclass<name="Certified Class">;
ClassName certclass<name="Certified Class">;
ClassName certclass<name="Certified Class">;
ClassName certclass<name="Certified Class">;
ubyte unk;
struct StartingRanks{
MinRanks rank0<name="Starting Sword Rank">;
MinRanks rank1<name="Starting Lances Rank">;
MinRanks rank2<name="Starting Axes Rank">;
MinRanks rank3<name="Starting Bows Rank">;
MinRanks rank4<name="Starting Brawling Rank">;
MinRanks rank5<name="Starting Reason Rank">;
MinRanks rank6<name="Starting Faith Rank">;
MinRanks rank7<name="Starting Authority Rank">;
MinRanks rank8<name="Starting Armor Rank">;
MinRanks rank9<name="Starting Riding Rank">;
MinRanks rank10<name="Starting Flying Rank">;
}startingranks<name="Starting Weapon Ranks">;
struct WpnProficiency{
ubyte rank0<name="Sword Proficiency">;
ubyte rank1<name="Lances Proficiency">;
ubyte rank2<name="Axes Proficiency">;
ubyte rank3<name="Bows Proficiency">;
ubyte rank4<name="Brawling Proficiency">;
ubyte rank5<name="Reason Proficiency">;
ubyte rank6<name="Faith Proficiency">;
ubyte rank7<name="Authority Proficiency">;
ubyte rank8<name="Armor Proficiency">;
ubyte rank9<name="Riding Proficiency">;
ubyte rank10<name="Flying Proficiency">;
}wpnproficiency<name="Proficiencies">;
ClassName class<name="Post TimeSkip Class">;
ClassName class<name="Post TimeSkip Class">;
ClassName class<name="Post TimeSkip Class">;
}wpnrank[numWpnRank];
}wpnrankstructure<bgcolor=cDkYellow, name="Starting Weapon Ranks/Combat Assets">;
FSeek(sectionpointers.PointerToStartingWeapons);
struct StartingWeaponsStructure{
uint32 Weapons_Magic;
uint32 numStartWep;
uint32 SizeOfStartWep;
struct StartWeaponHeaderPadding{
byte Padding[0x34];
}startweaponheaderpadding<name="Padding">;
struct StartWepID{
uint16 CharID<name="Character ID">;
uint16 Weapon<name="Weapon">;
uint16 Weapon<name="Weapon">;
uint16 Weapon<name="Weapon">;
uint16 Weapon<name="Weapon">;
uint16 Weapon<name="Weapon">;
uint16 Weapon<name="Weapon">;
}startwepid[numStartWep];
}startingweaponsstructure<bgcolor=cDkBlue, name="Starting Weapons">;
FSeek(sectionpointers.PointerToFacultyTraining);
struct FacultyTraining{
uint32 FacultyMagic;
uint32 numFaculty;
uint32 SizeOfFaculty;
struct FacultyHeaderPadding{
byte Padding[0x34];
}facultyheaderpadding<name="Padding">;
struct FacultyID{
struct StatBits{
ubyte bit0 : 1<name="Sword">;
ubyte bit1 : 1<name="Lances">;
ubyte bit2 : 1<name="Axes">;
ubyte bit3 : 1<name="Bows">;
ubyte bit4 : 1<name="Brawling">;
ubyte bit5 : 1<name="Reason">;
ubyte bit6 : 1<name="Faith">;
ubyte bit7 : 1<name="Authority">;
ubyte bit8 : 1<name="Armor">;
ubyte bit9 : 1<name="Riding">;
ubyte bit10 : 1<name="Flying">;
ubyte bit11 : 1<name="Reserve">;
ubyte bit12 : 1<name="Reserve">;
ubyte bit13 : 1<name="Reserve">;
ubyte bit14 : 1<name="Reserve">;
ubyte bit15 : 1<name="Reserve">;
}statbits<name="Teachable Stats">;
byte charID<name="Character ID">;
TrueFalse IsTeacher<name="IsTeacher">;
}facultyid[numFaculty]<name="Faculty Training Stuff">;
}facultytraining<bgcolor=cBlack,name="Faculty ID">;
FSeek(sectionpointers.PointerToSeminar);
struct SeminarTraining{
uint32 SeminarMagic;
uint32 numSeminar;
uint32 SizeOfSeminar;
struct SeminarHeaderPadding{
byte Padding[0x34];
}seminarheaderpadding<name="Padding">;
struct SeminarID{
struct StatBitsSeminar{
ubyte bit0 : 1<name="Sword">;
ubyte bit1 : 1<name="Lances">;
ubyte bit2 : 1<name="Axes">;
ubyte bit3 : 1<name="Bows">;
ubyte bit4 : 1<name="Brawling">;
ubyte bit5 : 1<name="Reason">;
ubyte bit6 : 1<name="Faith">;
ubyte bit7 : 1<name="Authority">;
ubyte bit8 : 1<name="Armor">;
ubyte bit9 : 1<name="Riding">;
ubyte bit10 : 1<name="Flying">;
ubyte bit11 : 1<name="Reserve">;
ubyte bit12 : 1<name="Reserve">;
ubyte bit13 : 1<name="Reserve">;
ubyte bit14 : 1<name="Reserve">;
ubyte bit15 : 1<name="Reserve">;
}statbitsseminar<name="Stats Interested">;
byte charID<name="Character ID">;
TrueFalse IsTeacher<name="IsTeacher">;
}seminarid[numSeminar]<name="Seminar Stuff">;
}seminartraining<bgcolor=cGreen,name="Seminar ID">;
FSeek(sectionpointers.Size3Pointer);
struct CharacterGoals{
uint32 CharacterGoalsMagic;
uint32 numCharacterGoals;
uint32 SizeOfCharacterGoals;
struct CharacterGoalsHeaderPadding{
byte Padding[0x34];
}charactergoalspadding<name="Padding">;
struct CharacterGoalsID{
ubyte Goal<name="Goal ID">;
ubyte unk2;
ubyte unk3;
}charactergoalsid[numCharacterGoals];
}charactergoals<bgcolor=cDkRed,name="Character Goals">;
FSeek(sectionpointers.PortraitsPointer);
struct Portraits{
uint32 PortraitsMagic;
uint32 numPortraits;
uint32 SizeOfPortraits;
struct PortraitsHeaderPadding{
byte Padding[0x34];
}portraitsheaderpadding<name="Padding">;
struct PortraitsID{
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 unk<name="Expression ">;
uint16 TimeSkip<name="Unknown Flag">;
}portraitsid[numPortraits]<name="Face ID">;
}portraits<bgcolor=cDkPurple,name="Portrait IDs">;
FSeek(sectionpointers.SizeFourPointer);
struct SizeFour{
uint32 SizeFourMagic;
uint32 numSizeFour;
uint32 SizeOfSizeFour;
struct SizeFourHeaderPadding{
byte Padding[0x34];
}sizefourheaderpadding<name="Padding">;
struct SizeFourID{
ubyte unk1;
ubyte unk2;
ubyte unk3;
ubyte unk4;
}sizefourid[numSizeFour];
}sizefour<bgcolor=cDkGreen>;
}file;
string ReadNameID(Person &p)
{
return EnumToString(p.NameID);
}