-
Notifications
You must be signed in to change notification settings - Fork 0
/
fe7.py
352 lines (338 loc) · 25 KB
/
fe7.py
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
from rom import Rom
# class inheriting Rom which contains FE7's data
# doesn't override any functions
class FE7(Rom):
def __init__(self, file):
super().__init__(file)
self.GAME_VERSION = "FE7"
self.CHAR_TABLE = 0xBDCE18
self.CHAR_ENTRY_LENGTH = 52
self.CHAR_UNIT_LENGTH = 16
# self.CHAR_TABLE_INDIRECT = 0x17890
self.CLASS_TABLE = 0xBE015C
self.CLASS_ENTRY_LENGTH = 84
# self.CLASS_TABLE_INDIRECT = 0x178F0
self.TEXT_TABLE_INDIRECT = 0x12CB8
self.file.seek(self.TEXT_TABLE_INDIRECT)
self.TEXT_TABLE = int.from_bytes(self.file.read(4), byteorder='little', signed=False) - 0x8000000
# self.dynamicLoadTables()
self.CHAR_TO_HEX = {
'Eliwood' : 0x01,
'Hector' : 0x02,
# 'Lyn_t' : 0x03,
'Raven' : 0x04,
'Geitz' : 0x05,
'Guy' : 0x06,
'Karel' : 0x07,
'Dorcas' : 0x08,
'Bartre' : 0x09,
'Oswin' : 0x0B,
# 'Wil_t' : 0x0D,
'Rebecca' : 0x0E,
'Louise' : 0x0F,
'Lucius' : 0x10,
'Serra' : 0x11,
'Renault' : 0x12,
'Erk' : 0x13,
'Nino' : 0x14,
'Pent' : 0x15,
'Canas' : 0x16,
# 'Kent_t' : 0x17,
# 'Sain_t' : 0x18,
'Lowen' : 0x19,
'Marcus' : 0x1A,
'Priscilla' : 0x1B,
# 'Rath_t' : 0x1C,
# 'Florina_t' : 0x1D,
'Fiora' : 0x1E,
'Farina' : 0x1F,
'Heath' : 0x20,
'Vaida' : 0x21,
'Hawkeye' : 0x22,
'Matthew' : 0x23,
'Jaffar' : 0x24,
'Ninian' : 0x25,
'Athos' : 0x27,
'Wallace' : 0x2C,
'Lyn' : 0x2D,
'Wil' : 0x2E,
'Kent' : 0x2F,
'Sain' : 0x30,
'Florina' : 0x31,
'Rath' : 0x32,
'Dart' : 0x33,
'Isadora' : 0x34,
'Legault' : 0x36,
'Karla' : 0x37,
'Harken' : 0x38
}
self.CHAR_UNIT_FORMAT = [
"char", "class", "X1", "levels", "X", "Y", "X2", "Y2", "item 1", "item 2", "item 3", "item 4"
]
# generated with a script
# TODO: prune. FE7 has less separate "cutscene" units so it might be easier??
self.CHAR_TO_UNIT_TABLE = {'Legault': [13432700, 13432732, 13452948, 13449560, 13507108], 'Matthew': [13400208, 13400416, 13400640, 13402188, 13402444, 13403180, 13403988, 13404164, 13405316, 13406692, 13409460, 13409620, 13410420, 13410840, 13411016, 13413456, 13413632, 13416928, 13417040, 13418576, 13418988, 13419180, 13421052, 13422644, 13425312, 13425520, 13427952, 13428144, 13430172, 13430396, 13433484, 13434428, 13434604, 13437204, 13437444, 13441628, 13441804, 13441948, 13442140, 13445028, 13445220, 13450260, 13450468, 13447080, 13447304, 13454052, 13454276, 13456508, 13456764, 13460468, 13460708, 13464804, 13465028, 13468920, 13469160, 13473168, 13473408, 13478072, 13484996, 13485060, 13486412, 13486716, 13491500, 13492128, 13492400, 13395264, 13395888, 13396384, 13397336, 13397544, 13397720, 13399316, 13399492, 13502808, 13503048, 13506900], 'Karel': [13463636, 13467044, 13505892], 'Heath': [13410452, 13439108, 13440388, 13450244, 13450452, 13447176, 13447400, 13456492, 13456748, 13492112, 13492384, 13506852], 'Florina': [13412440, 13412536, 13416896, 13417008, 13418544, 13419052, 13419244, 13421100, 13422436, 13422628, 13425296, 13425504, 13427936, 13428128, 13430156, 13430380, 13433468, 13434412, 13434588, 13437188, 13437428, 13441644, 13441836, 13441980, 13442172, 13444964, 13445156, 13450228, 13450436, 13447160, 13447384, 13454004, 13454228, 13456476, 13456732, 13460452, 13460692, 13464788, 13465012, 13468904, 13469144, 13473152, 13473392, 13478056, 13486396, 13486700, 13491484, 13492096, 13492368, 13500116, 13500324, 13506132], 'Lucius': [13400432, 13400656, 13415456, 13415552, 13419196, 13447128, 13447352, 13477784, 13486300, 13486604, 13492048, 13492320, 13397008, 13397560, 13397736, 13505988], 'Karla': [13491740, 13507124], 'Oswin': [13403212, 13403276, 13403972, 13404148, 13405380, 13406676, 13408532, 13409380, 13409540, 13410308, 13410744, 13410936, 13412984, 13413472, 13413648, 13416064, 13416912, 13418560, 13422324, 13422596, 13430044, 13430268, 13433340, 13437108, 13437348, 13490524, 13492144, 13492416, 13498404, 13498500, 13502776, 13503016, 13503176, 13505940], 'Florina_t': [13400176, 13400320, 13400544, 13393688, 13394088, 13394736, 13395232, 13395536, 13396000, 13396352, 13396592, 13396736, 13397352, 13397464, 13397640, 13398324, 13398484, 13398644, 13399220, 13399396, 13399620, 13506820], 'Renault': [13494624, 13494656, 13506020], 'Kent_t': [13393008, 13400144, 13400288, 13400512, 13393160, 13393560, 13394072, 13394704, 13395200, 13395504, 13395968, 13396320, 13396528, 13396672, 13397240, 13397448, 13397624, 13398292, 13398452, 13398612, 13399188, 13399364, 13399588], 'Kent': [13412472, 13412568, 13413504, 13413680, 13419084, 13421068, 13425376, 13428000, 13454100, 13468952, 13469192, 13507012], 'Wil': [13412456, 13412552, 13419116, 13422292, 13506996], 'Pent': [13443836, 13443868, 13444316, 13444444, 13446708, 13452996, 13449512, 13458732, 13458780, 13477848, 13486364, 13486668, 13492016, 13492288, 13500196, 13500404, 13506068], 'Sain_t': [13392992, 13400160, 13400304, 13400528, 13393144, 13393592, 13394024, 13394720, 13395216, 13395520, 13395984, 13396336, 13396544, 13396688, 13397272, 13398308, 13398468, 13398628, 13399204, 13399380, 13399604, 13506788], 'Hector': [13402172, 13402412, 13403148, 13403260, 13403956, 13404036, 13405300, 13406660, 13408500, 13409332, 13409492, 13410276, 13410728, 13410920, 13412872, 13412936, 13413360, 13413552, 13416032, 13416112, 13416192, 13416832, 13417024, 13418480, 13419020, 13419212, 13421004, 13421292, 13421692, 13422276, 13422484, 13424740, 13425216, 13425424, 13427392, 13427872, 13428064, 13429488, 13429632, 13430012, 13430236, 13433084, 13433308, 13434332, 13434508, 13436492, 13437140, 13437316, 13440244, 13440612, 13441548, 13441740, 13441884, 13442076, 13444156, 13444268, 13444396, 13445012, 13445204, 13450116, 13450324, 13452884, 13447112, 13447336, 13449464, 13455956, 13453908, 13454132, 13455956, 13456332, 13456588, 13459356, 13459436, 13459628, 13459724, 13460324, 13460564, 13463956, 13464068, 13464660, 13464884, 13467652, 13467764, 13467860, 13468148, 13468840, 13469080, 13471960, 13472328, 13473056, 13473296, 13476752, 13476992, 13477704, 13477960, 13482008, 13482200, 13482232, 13484572, 13484980, 13485044, 13485844, 13485908, 13486220, 13486524, 13490060, 13490124, 13490556, 13491372, 13491564, 13491660, 13491936, 13492208, 13497136, 13497280, 13497408, 13502648, 13502920, 13500052, 13500260, 13501556, 13501636, 13502068, 13505524, 13505812], 'Erk': [13400384, 13400608, 13408564, 13409428, 13409588, 13410388, 13410776, 13410968, 13413392, 13413568, 13416864, 13418512, 13422356, 13422580, 13430076, 13430300, 13433388, 13434364, 13434540, 13447048, 13447272, 13453956, 13454180, 13456396, 13456652, 13468968, 13469208, 13498388, 13498484, 13394992, 13395312, 13395584, 13396512, 13396656, 13397512, 13397688, 13398548, 13398708, 13399284, 13399460, 13502760, 13503000, 13503160, 13505428, 13506036], 'Lyn': [13412424, 13412520, 13412952, 13413376, 13416048, 13416128, 13416208, 13416848, 13418624, 13419004, 13421020, 13421180, 13421708, 13422308, 13422500, 13424756, 13427408, 13429520, 13429648, 13430028, 13430252, 13433100, 13433324, 13436508, 13437092, 13437332, 13440260, 13440628, 13441564, 13441756, 13441900, 13442092, 13444172, 13444284, 13444412, 13444996, 13445188, 13450132, 13450340, 13452900, 13447016, 13447240, 13449480, 13455940, 13453924, 13454148, 13455940, 13456348, 13456604, 13459372, 13459468, 13459644, 13459740, 13460340, 13460580, 13463972, 13464084, 13464676, 13464900, 13467668, 13467780, 13467876, 13468164, 13471976, 13472344, 13473072, 13473312, 13476768, 13477008, 13477720, 13477976, 13482024, 13482280, 13484588, 13485860, 13485924, 13486236, 13486540, 13490076, 13490140, 13491420, 13491580, 13491952, 13492224, 13497152, 13497296, 13497424, 13502680, 13502936, 13500068, 13500276, 13501572, 13501652, 13502084, 13505828], 'Isadora': [13401580, 13439076, 13469032, 13507076], 'Dorcas': [13400352, 13400576, 13401180, 13402700, 13403924, 13404116, 13405348, 13406628, 13409364, 13409524, 13425344, 13433516, 13434460, 13437252, 13441676, 13442028, 13445060, 13454036, 13454260, 13460516, 13469000, 13473216, 13477896, 13486460, 13394376, 13394800, 13395296, 13395568, 13396560, 13396704, 13397480, 13397656, 13398516, 13398676, 13399252, 13399428, 13502792, 13503032, 13503192, 13505908], 'Harken': [13463668, 13467076, 13477736, 13486252, 13486556, 13507140], 'Wil_t': [13400192, 13400336, 13400560, 13393848, 13394040, 13394752, 13395248, 13395552, 13396016, 13396368, 13396608, 13396752, 13397208, 13398340, 13398500, 13398660, 13399236, 13399412, 13399636, 13506804], 'Vaida': [13480968, 13505476, 13506868], 'Nino': [13453092, 13467924, 13471864, 13472104, 13472376, 13473040, 13473280, 13476672, 13476928, 13482056, 13482376, 13506052], 'Rebecca': [13401148, 13401228, 13401740, 13402668, 13403908, 13404100, 13405428, 13406612, 13409396, 13409556, 13410356, 13410760, 13410952, 13413424, 13413600, 13416880, 13416992, 13418528, 13418972, 13419164, 13421116, 13422340, 13422548, 13425232, 13425440, 13430060, 13430284, 13434348, 13434524, 13437124, 13437364, 13450148, 13450356, 13453940, 13454164, 13456380, 13456636, 13460372, 13460612, 13464708, 13464932, 13473088, 13473328, 13477768, 13477992, 13483340, 13483436, 13486284, 13486588, 13491468, 13492000, 13492272, 13498356, 13498452, 13502728, 13502968, 13503128, 13500132, 13500340, 13505956], 'Farina': [13455396, 13505604, 13506164], 'Lyn_t': [13392848, 13400128, 13400272, 13400496, 13393128, 13393544, 13394008, 13394688, 13395168, 13395488, 13395952, 13396288, 13396496, 13396640, 13397224, 13397432, 13397608, 13398260, 13398436, 13398596, 13399172, 13399348, 13399556, 13392720, 13506756], 'Serra': [13400368, 13400592, 13403228, 13404004, 13404180, 13405444, 13406708, 13409412, 13409572, 13410372, 13410856, 13441596, 13441820, 13441964, 13442156, 13498372, 13498468, 13395008, 13395328, 13395600, 13397496, 13397672, 13398532, 13398692, 13399268, 13399444, 13502744, 13502984, 13503144, 13506004], 'Rath': [13438900, 13472456, 13499668, 13507044], 'Wallace': [13400464, 13400688, 13448984, 13449016, 13399908, 13506980], 'Geitz': [13452564, 13452596, 13456364, 13456620, 13460356, 13460596, 13464692, 13464916, 13477752, 13486268, 13486572, 13491452, 13491984, 13492256, 13503208, 13505652, 13505860], 'Marcus': [13401084, 13401676, 13402652, 13403876, 13404068, 13405332, 13406580, 13408516, 13410324, 13410824, 13412888, 13412968, 13416144, 13416224, 13427424, 13433356, 13454084, 13464020, 13464180, 13467716, 13468068, 13491596, 13503224, 13506100], 'Canas': [13418272, 13422372, 13422532, 13425248, 13425456, 13427888, 13428080, 13430092, 13430316, 13433404, 13437076, 13437380, 13441580, 13441772, 13441916, 13442108, 13444980, 13445172, 13450164, 13450372, 13456412, 13456668, 13460388, 13460628, 13464724, 13464948, 13468856, 13469096, 13473104, 13473344, 13477800, 13478008, 13483372, 13486316, 13486620, 13491388, 13492032, 13492304, 13500148, 13500356, 13506836], 'Louise': [13444332, 13444460, 13453012, 13449528, 13458716, 13458764, 13505444, 13505972], 'Athos': [13444348, 13444476, 13482440, 13484540, 13485876, 13486004, 13490156, 13502840, 13503256, 13500084, 13500292, 13501700, 13501732, 13502116, 13506932], 'Guy': [13404388, 13405396, 13406724, 13410872, 13419100, 13425328, 13427968, 13428160, 13430188, 13433500, 13434444, 13437236, 13441660, 13441996, 13445044, 13447192, 13456540, 13460500, 13464836, 13468984, 13473200, 13477880, 13486444, 13492160, 13503112, 13505636, 13505876], 'Lowen': [13401116, 13402684, 13403892, 13404084, 13405364, 13406596, 13409444, 13409604, 13410404, 13410792, 13410984, 13413408, 13413584, 13422404, 13422612, 13430124, 13430348, 13433436, 13450196, 13450404, 13447144, 13447368, 13454020, 13454244, 13456444, 13456700, 13460420, 13460660, 13464756, 13464980, 13506084], 'Sain': [13412488, 13412584, 13413488, 13413664, 13416944, 13417056, 13418592, 13419036, 13419228, 13421084, 13422388, 13422516, 13425264, 13425472, 13427904, 13428096, 13430108, 13430332, 13433420, 13434380, 13434556, 13437156, 13437396, 13444948, 13445140, 13450180, 13450388, 13447096, 13447320, 13453972, 13454196, 13456428, 13456684, 13460404, 13460644, 13464740, 13464964, 13468872, 13469112, 13473120, 13473360, 13477816, 13478024, 13483388, 13483452, 13486332, 13486636, 13491404, 13492080, 13492352, 13500164, 13500372, 13507028], 'Eliwood': [13401052, 13401660, 13402636, 13403860, 13404052, 13405284, 13406564, 13408484, 13409348, 13409508, 13410292, 13410712, 13410904, 13412856, 13412920, 13413344, 13413536, 13416016, 13416096, 13416176, 13416816, 13416976, 13418464, 13418956, 13419148, 13420988, 13421164, 13421676, 13422260, 13422468, 13424724, 13425200, 13425408, 13427376, 13427856, 13428048, 13429472, 13429616, 13429996, 13430220, 13433068, 13433292, 13434316, 13434492, 13436556, 13437060, 13437300, 13440228, 13440596, 13441532, 13441724, 13441868, 13442060, 13444140, 13444252, 13444380, 13444916, 13445108, 13446676, 13450100, 13450308, 13452868, 13447000, 13447224, 13449448, 13455924, 13455924, 13456316, 13456572, 13459340, 13459404, 13459612, 13459708, 13460308, 13460548, 13463940, 13464052, 13464644, 13464868, 13467636, 13467748, 13467844, 13468132, 13468824, 13469064, 13471944, 13472312, 13473024, 13473264, 13476736, 13476976, 13477688, 13477944, 13481992, 13482184, 13482248, 13483324, 13483420, 13484508, 13485828, 13485972, 13486204, 13486508, 13490044, 13490188, 13491356, 13491548, 13491920, 13492192, 13497120, 13497264, 13497392, 13498340, 13498436, 13399524, 13502616, 13502904, 13503080, 13500036, 13500244, 13501540, 13501620, 13502052, 13505412, 13505796], 'Priscilla': [13408260, 13408292, 13410808, 13411000, 13413440, 13413616, 13419068, 13419260, 13421132, 13422420, 13422564, 13425280, 13425488, 13427920, 13428112, 13430140, 13430364, 13433452, 13434396, 13434572, 13437172, 13437412, 13444932, 13445124, 13450212, 13450420, 13447064, 13447288, 13453988, 13454212, 13456460, 13456716, 13460436, 13460676, 13464772, 13464996, 13468888, 13469128, 13473136, 13473376, 13477832, 13478040, 13483356, 13485012, 13486348, 13486652, 13492064, 13492336, 13500180, 13500388, 13505460, 13506116], 'Dart': [13417104, 13417344, 13417584, 13418128, 13421388, 13424404, 13497184, 13507060], 'Nils': [13400224, 13400448, 13400672, 13436620, 13482344, 13484604, 13485940, 13490092, 13490252, 13497104, 13497328, 13497440, 13396416, 13396976, 13397288, 13397576, 13397752, 13398356, 13398564, 13398724, 13502872, 13503288, 13500100, 13500308, 13501588, 13501668, 13502100, 13506196], 'Ninian': [13421356, 13421724, 13424772, 13427440, 13429552, 13429664, 13432892, 13432924, 13432956, 13433020, 13436588, 13437220, 13437460, 13440308, 13440644, 13441612, 13441788, 13441932, 13442124, 13444188, 13450276, 13450484, 13452916, 13447032, 13447256, 13449496, 13454068, 13454292, 13456524, 13456780, 13459500, 13459660, 13459772, 13460484, 13460724, 13463988, 13464148, 13464820, 13465044, 13467684, 13468036, 13468936, 13469176, 13473184, 13473424, 13478088, 13482296, 13486428, 13486732, 13505492, 13506180], 'Hawkeye': [13443900, 13443932, 13444300, 13444428, 13445076, 13446692, 13452964, 13449576, 13477864, 13486380, 13486684, 13491436, 13491968, 13492240, 13500212, 13500420, 13506884], 'Bartre': [13401196, 13402716, 13403940, 13404132, 13405412, 13406644, 13425360, 13433532, 13437268, 13441692, 13442012, 13469016, 13473232, 13477912, 13486476, 13505508, 13505924], 'Rath_t': [13400400, 13400624, 13395920, 13396048, 13396576, 13396720, 13397528, 13397704, 13399300, 13399476, 13506772], 'Jaffar': [13424660, 13433132, 13440020, 13467972, 13471880, 13472120, 13472392, 13475856, 13476704, 13476944, 13482088, 13482408, 13505556, 13506916], 'Raven': [13415488, 13415584, 13428016, 13502712, 13502952, 13503096, 13505620, 13505844], 'Elenora': [13401564, 13507092], 'Fiora': [13424436, 13424468, 13427984, 13506148]}
self.CLASS_TO_HEX = {
'Lord (Eliwood)' : 0x01,
'Lord (Lyn)' : 0x02,
'Lord (Hector)' : 0x03,
'Knight Lord' : 0x07,
'Blade Lord' : 0x08,
'Great Lord' : 0x09,
'Mercenary' : 0x0A,
'Mercenary (F)' : 0x0B,
'Hero' : 0x0C,
'Hero (F)' : 0x0D,
'Myrmidon' : 0x0E,
'Myrmidon (F)' : 0x0F,
'Swordmaster' : 0x10,
'Swordmaster (F)' : 0x11,
'Fighter' : 0x12,
'Warrior' : 0x13,
'Knight' : 0x14,
'Knight (F)' : 0x15,
'General' : 0x16,
'General (F)' : 0x17,
'Archer' : 0x18,
'Archer (F)' : 0x19,
'Sniper' : 0x1A,
'Sniper (F)' : 0x1B,
'Monk' : 0x1C,
'Cleric' : 0x1D,
'Bishop' : 0x1E,
'Bishop (F)' : 0x1F,
'Mage' : 0x20,
'Mage (F)' : 0x21,
'Sage' : 0x22,
'Sage (F)' : 0x23,
'Shaman' : 0x24,
'Shaman (F)' : 0x25,
'Druid' : 0x26,
'Druid (F)' : 0x27,
'Cavalier' : 0x28,
'Cavalier (F)' : 0x29,
'Paladin' : 0x2A,
'Paladin (F)' : 0x2B,
'Troubadour' : 0x2C,
'Valkyrie' : 0x2D,
'Nomad' : 0x2E,
'Nomad (F)' : 0x2F,
'Nomad Trooper' : 0x30,
'Nomad Trooper (F)' : 0x31,
'Pegasus Knight' : 0x32,
'Falcon Knight' : 0x33,
'Wyvern Rider' : 0x34,
'Wyvern Rider (F)' : 0x35,
'Wyvern Lord' : 0x36,
'Wyvern Lord (F)' : 0x37,
'Soldier' : 0x38,
'Brigand' : 0x39,
'Pirate' : 0x3A,
'Berserker' : 0x3B,
'Thief' : 0x3C,
'Thief (F)' : 0x3D,
'Assassin' : 0x3E,
'Dancer' : 0x40,
'Bard' : 0x41,
'Archsage' : 0x42
}
self.CLASS_TO_CLASS = {
'Ranger' : 'Nomad Trooper',
'Light Mage' : 'Monk',
'Light Sage' : 'Bishop',
'Dark Sage' : 'Druid',
'Mage Knight' : 'Valkyrie',
}
self.ITEM_TO_HEX = {
'Iron Sword' : 0x01,
'Slim Sword' : 0x02,
'Steel Sword' : 0x03,
'Silver Sword' : 0x04,
'Iron Blade' : 0x05,
'Steel Blade' : 0x06,
'Silver Blade' : 0x07,
'Poison Sword' : 0x08,
'Rapier' : 0x09,
'Mani Katti' : 0x0A,
'Brave Sword' : 0x0B,
'Wo Dao' : 0x0C,
'Killing Edge' : 0x0D,
'Armourslayer' : 0x0E,
'Wyrmslayer' : 0x0F,
'Light Brand' : 0x10,
'Runesword' : 0x11,
'Lancereaver' : 0x12,
'Longsword' : 0x13,
'Iron Lance' : 0x14,
'Slim Lance' : 0x15,
'Steel Lance' : 0x16,
'Silver Lance' : 0x17,
'Poison Lance' : 0x18,
'Brave Lance' : 0x19,
'Killer Lance' : 0x1A,
'Horseslayer' : 0x1B,
'Javelin' : 0x1C,
'Spear' : 0x1D,
'Axereaver' : 0x1E,
'Iron Axe' : 0x1F,
'Steel Axe' : 0x20,
'Silver Axe' : 0x21,
'Poison Axe' : 0x22,
'Brave Axe' : 0x23,
'Killer Axe' : 0x24,
'Halberd' : 0x25,
'Hammer' : 0x26,
'Devil Axe' : 0x27,
'Hand Axe' : 0x28,
'Tomahawk' : 0x29,
'Swordreaver' : 0x2A,
'Swordslayer' : 0x2B,
'Iron Bow' : 0x2C,
'Steel Bow' : 0x2D,
'Silver Bow' : 0x2E,
'Poison Bow' : 0x2F,
'Killer Bow' : 0x30,
'Brave Bow' : 0x31,
'Short Bow' : 0x32,
'Longbow' : 0x33,
'Ballista' : 0x34,
'Iron Ballista' : 0x35,
'Killer Ballista' : 0x36,
'Fire' : 0x37,
'Thunder' : 0x38,
'Elfire' : 0x39,
'Bolting' : 0x3A,
'Fimbulvetr' : 0x3B,
'Forblaze' : 0x3C,
'Excalibur' : 0x3D,
'Lightning' : 0x3E,
'Shine' : 0x3F,
'Divine' : 0x40,
'Purge' : 0x41,
'Aura' : 0x42,
'Luce' : 0x43,
'Flux' : 0x44,
'Luna' : 0x45,
'Nosferatu' : 0x46,
'Eclipse' : 0x47,
'Fenrir' : 0x48,
'Gespenst' : 0x49,
'Heal' : 0x4A,
'Mend' : 0x4B,
'Recover' : 0x4C,
'Physic' : 0x4D,
'Fortify' : 0x4E,
'Restore' : 0x4F,
'Silence' : 0x50,
'Sleep' : 0x51,
'Berserk' : 0x52,
'Warp' : 0x53,
'Rescue' : 0x54,
'Torch Staff' : 0x55,
'Hammerne' : 0x56,
'Unlock' : 0x57,
'Barrier' : 0x58,
'Dragon Axe' : 0x59,
'Angelic Robe' : 0x5A,
'Energy Ring' : 0x5B,
'Secret Book' : 0x5C,
'Speedwings' : 0x5D,
'Goddess Icon' : 0x5E,
'Dragonshield' : 0x5F,
'Talisman' : 0x60,
'Boots' : 0x61,
'Body Ring' : 0x62,
'Hero Crest' : 0x63,
'Heros Crest' : 0x63,
'Knight Crest' : 0x64,
'Knights Crest' : 0x64,
'Orion Bolt' : 0x65,
'Orions Bolt' : 0x65,
'Elysian Whip' : 0x66,
'Guiding Ring' : 0x67,
'Chest Key' : 0x68,
'Door Key' : 0x69,
'Lock Pick' : 0x6A,
'Vulnerary' : 0x6B,
'Elixir' : 0x6C,
'Pure Water' : 0x6D,
'Antitoxin' : 0x6E,
'Torch' : 0x6F,
'Delphi Shield' : 0x70,
'Member Card' : 0x71,
'Silver Card' : 0x72,
'White Gem' : 0x73,
'Blue Gem' : 0x74,
'Red Gem' : 0x75,
'Gold' : 0x76,
'Uber Spear' : 0x77,
'Chest Key_5' : 0x78,
'Mine' : 0x79,
'Light Rune' : 0x7A,
'Iron Rune' : 0x7B,
'Fillas Might' : 0x7C,
'Niniss Grace' : 0x7D,
'Thors Ire' : 0x7E,
'Sets Litany' : 0x7F,
'Emblem Sword' : 0x80,
'Emblem Lance' : 0x81,
'Emblem Axe' : 0x82,
'Emblem Bow' : 0x83,
'Durandal' : 0x84,
'Armads' : 0x85,
'Aureola' : 0x86,
'Earth Seal' : 0x87,
'Afas Drops' : 0x88,
'Heaven Seal' : 0x89,
'Emblem Seal' : 0x8A,
'Fell Contract' : 0x8B,
'Sol Katti' : 0x8C,
'Wolf Beil' : 0x8D,
'Ereshkigal' : 0x8E,
'Flametongue' : 0x8F,
'Regal Blade' : 0x90,
'Rex Hasta' : 0x91,
'Basilikos' : 0x92,
'Rienfleche' : 0x93,
'Heavy Spear' : 0x94,
'Short Spear' : 0x95,
'Ocean Seal' : 0x96,
'3000G' : 0x97,
'5000G' : 0x98,
'Wind Sword' : 0x99
}
self.ITEM_TO_ITEM = {
'Shamsir' : 'Wo Dao',
'Vague Katti' : 'Wo Dao',
'Concoction' : 'Vulnerary',
'Wind' : 'Fire',
'Elthunder' : 'Elfire',
'Elwind' : 'Thunder',
'Arcfire' : 'Fimbulvetr',
'Arcthunder' : 'Fimbulvetr',
'Arcwind' : 'Aircalibur',
'Bolganone' : 'Elfire',
'Thoron' : 'Elfire',
'Meteor' : 'Bolting',
'Rat Spirit' : 'Fire',
'Horse Spirit' : 'Fire',
'Ox Spirit' : 'Thunder',
'Sheep Spirit' : 'Thunder',
'Tiger Spirit' : 'Elfire',
'Dragon Spirit' : 'Fimbulvetr',
'Aircalibur' : 'Excalibur'
}
self.WR_TO_HEX = {
'' : 0x00,
'E' : 0x01,
'D' : 0x1F,
'C' : 0x47,
'B' : 0x79,
'A' : 0xB5,
'S' : 0xFB
}
self.WEAPON_TYPES = [
"sword", "lance", "axe", "bow", "staff", "anima", "light", "dark"
]
# generated from a script
self.ANTIHUFFMAN = {76928: 192, 76929: 26, 76930: 2, 76931: 120, 76932: 10, 76933: 112, 76934: 1, 76935: 49, 76936: 1, 76937: 48, 76938: 0, 76939: 42, 76940: 249, 76941: 209, 76942: 112, 76943: 71, 17261: 240, 17262: 134, 17263: 252, 17278: 0, 17279: 3, 17264: 3, 17265: 224, 17276: 64, 17266: 2, 17267: 74, 17268: 18, 17269: 104, 17270: 187, 17277: 57, 17260: 14, 17271: 240, 17272: 109, 17273: 252, 17274: 0, 17275: 189, 17252: 0, 17253: 181, 17254: 194, 17255: 15, 17256: 0, 17257: 42, 17258: 2, 17259: 208, 76908: 2, 76909: 73, 76910: 40, 76911: 28, 76912: 0, 76913: 240, 76914: 20, 76915: 248, 76916: 53, 76917: 96, 76918: 12, 76919: 224, 76920: 180, 76921: 165, 76922: 2, 76923: 2, 76924: 128, 76925: 35, 76926: 27, 76927: 6}