Blame view

d2quest.h 17 KB
1
2
3
#ifndef D2QUEST_H
#define D2QUEST_H
4
5
6
// Forward declaration
typedef enum D2S_DIFFICULTY D2S_DIFFICULTY; 
7
8
#include <stdint.h>
9
#include "d2char.h"
Imanol-Mikel Barba Sabariego authored
10
11
#include "d2strings.h"
12
#define D2S_QUESTDATA_HEADER_LENGTH 4
13
#define D2S_QUESTDATA_NUMQUESTS 27
14
15
typedef enum D2S_QUEST {
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
    D2S_QUEST_UNKNOWN = -1,
    D2S_QUEST_DEN_OF_EVIL = 0,
    D2S_QUEST_SISTER_BURIAL_GROUNDS,
    D2S_QUEST_SEARCH_FOR_CAIN,
    D2S_QUEST_FORGOTTEN_TOWER,
    D2S_QUEST_TOOLS_OF_THE_TRADE,
    D2S_QUEST_SISTERS_TO_THE_SLAUGHTER,
    D2S_QUEST_RADAMENT_LAIR,
    D2S_QUEST_HORADRIC_STAFF,
    D2S_QUEST_TAINTED_SUN,
    D2S_QUEST_ARCANE_SANCTUARY,
    D2S_QUEST_SUMMONER,
    D2S_QUEST_SEVEN_TOMBS,
    D2S_QUEST_GOLDEN_BIRD,
    D2S_QUEST_BLADE_OF_THE_OLD_RELIGION,
    D2S_QUEST_KHALIM_WILL,
    D2S_QUEST_LAM_ESEN_TOME,
    D2S_QUEST_BLACKENED_TEMPLE,
    D2S_QUEST_GUARDIAN,
    D2S_QUEST_FALLEN_ANGEL,
    D2S_QUEST_HELLFORGE,
    D2S_QUEST_TERROR_END,
    D2S_QUEST_SIEGE_ON_HARROGATH,
    D2S_QUEST_RESCUE_ON_MOUNT_ARREAT,
    D2S_QUEST_PRISON_OF_ICE,
    D2S_QUEST_BETRAYAL_OF_HARROGATH,
    D2S_QUEST_RITE_OF_PASSAGE,
    D2S_QUEST_EVE_OF_DESTRUCTION
44
45
46
47
} D2S_QUEST;

const char* const questName[] = {
48
49
};
Imanol-Mikel Barba Sabariego authored
50
51
52
53
54
55
56
enum D2S_QUEST_STATUS {
    D2S_QUEST_STATUS_COMPLETED = 0x0001,
    D2S_QUEST_STATUS_REWARD_AVAILABLE = 0x0002,
    D2S_QUEST_STATUS_STARTED = 0x0004,
    D2S_QUEST_STATUS_SEEN_FINISH_ANIMATION = 0x1000,
    D2S_QUEST_STATUS_JUST_FINISHED = 0x2000
};
57
58
typedef enum D2S_SPECIALQUEST {
Imanol-Mikel Barba Sabariego authored
59
    D2S_SPECIALQUEST_AKARA_RESPEC
60
} D2S_SPECIALQUEST;
61
Imanol-Mikel Barba Sabariego authored
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
const char* const checkpointDescriptions[] = {
    D2S_QUEST_CHECKPOINT_0,
    D2S_QUEST_CHECKPOINT_1,
    D2S_QUEST_CHECKPOINT_2,
    D2S_QUEST_CHECKPOINT_3,
    D2S_QUEST_CHECKPOINT_4,
    D2S_QUEST_CHECKPOINT_5,
    D2S_QUEST_CHECKPOINT_6,
    D2S_QUEST_CHECKPOINT_7,
    D2S_QUEST_CHECKPOINT_8,
    D2S_QUEST_CHECKPOINT_9,
    D2S_QUEST_CHECKPOINT_10,
    D2S_QUEST_CHECKPOINT_11,
    D2S_QUEST_CHECKPOINT_12,
    D2S_QUEST_CHECKPOINT_13,
    D2S_QUEST_CHECKPOINT_14,
    D2S_QUEST_CHECKPOINT_15,
    D2S_QUEST_CHECKPOINT_16,
    D2S_QUEST_CHECKPOINT_17,
    D2S_QUEST_CHECKPOINT_18,
    D2S_QUEST_CHECKPOINT_19,
    D2S_QUEST_CHECKPOINT_20,
    D2S_QUEST_CHECKPOINT_21,
    D2S_QUEST_CHECKPOINT_22,
    D2S_QUEST_CHECKPOINT_23,
    D2S_QUEST_CHECKPOINT_24,
    D2S_QUEST_CHECKPOINT_25,
    D2S_QUEST_CHECKPOINT_26,
    D2S_QUEST_CHECKPOINT_27,
    D2S_QUEST_CHECKPOINT_28,
    D2S_QUEST_CHECKPOINT_29,
    D2S_QUEST_CHECKPOINT_30,
    D2S_QUEST_CHECKPOINT_31,
    D2S_QUEST_CHECKPOINT_32,
    D2S_QUEST_CHECKPOINT_33,
    D2S_QUEST_CHECKPOINT_34,
    D2S_QUEST_CHECKPOINT_35,
    D2S_QUEST_CHECKPOINT_36,
    D2S_QUEST_CHECKPOINT_37,
    D2S_QUEST_CHECKPOINT_38,
    D2S_QUEST_CHECKPOINT_39,
    D2S_QUEST_CHECKPOINT_40,
    D2S_QUEST_CHECKPOINT_41,
    D2S_QUEST_CHECKPOINT_42,
    D2S_QUEST_CHECKPOINT_43,
    D2S_QUEST_CHECKPOINT_44,
    D2S_QUEST_CHECKPOINT_45,
    D2S_QUEST_CHECKPOINT_46,
    D2S_QUEST_CHECKPOINT_47,
    D2S_QUEST_CHECKPOINT_48,
    D2S_QUEST_CHECKPOINT_49,
    D2S_QUEST_CHECKPOINT_50,
    D2S_QUEST_CHECKPOINT_51,
    D2S_QUEST_CHECKPOINT_52,
    D2S_QUEST_CHECKPOINT_53,
    D2S_QUEST_CHECKPOINT_54,
    D2S_QUEST_CHECKPOINT_55,
    D2S_QUEST_CHECKPOINT_56,
    D2S_QUEST_CHECKPOINT_57,
    D2S_QUEST_CHECKPOINT_58,
    D2S_QUEST_CHECKPOINT_59,
    D2S_QUEST_CHECKPOINT_60,
    D2S_QUEST_CHECKPOINT_61,
    D2S_QUEST_CHECKPOINT_62,
    D2S_QUEST_CHECKPOINT_63,
    D2S_QUEST_CHECKPOINT_64,
    D2S_QUEST_CHECKPOINT_65,
    D2S_QUEST_CHECKPOINT_66,
    D2S_QUEST_CHECKPOINT_67,
    D2S_QUEST_CHECKPOINT_68,
    D2S_QUEST_CHECKPOINT_69,
    D2S_QUEST_CHECKPOINT_70,
    D2S_QUEST_CHECKPOINT_71,
    D2S_QUEST_CHECKPOINT_72,
    D2S_QUEST_CHECKPOINT_73,
    D2S_QUEST_CHECKPOINT_74,
    D2S_QUEST_CHECKPOINT_75,
    D2S_QUEST_CHECKPOINT_76,
    D2S_QUEST_CHECKPOINT_77,
    D2S_QUEST_CHECKPOINT_78,
    D2S_QUEST_CHECKPOINT_79,
    D2S_QUEST_CHECKPOINT_80,
    D2S_QUEST_CHECKPOINT_81,
    D2S_QUEST_CHECKPOINT_82,
    D2S_QUEST_CHECKPOINT_83,
    D2S_QUEST_CHECKPOINT_84,
    D2S_QUEST_CHECKPOINT_85,
    D2S_QUEST_CHECKPOINT_86,
    D2S_QUEST_CHECKPOINT_87,
    D2S_QUEST_CHECKPOINT_88,
    D2S_QUEST_CHECKPOINT_89,
    D2S_QUEST_CHECKPOINT_90,
    D2S_QUEST_CHECKPOINT_91,
    D2S_QUEST_CHECKPOINT_92,
    D2S_QUEST_CHECKPOINT_93,
    D2S_QUEST_CHECKPOINT_94,
    D2S_QUEST_CHECKPOINT_95,
    D2S_QUEST_CHECKPOINT_96,
    D2S_QUEST_CHECKPOINT_97,
    D2S_QUEST_CHECKPOINT_98,
    D2S_QUEST_CHECKPOINT_99,
    D2S_QUEST_CHECKPOINT_100,
    D2S_QUEST_CHECKPOINT_101,
    D2S_QUEST_CHECKPOINT_102,
    D2S_QUEST_CHECKPOINT_103,
    D2S_QUEST_CHECKPOINT_104,
    D2S_QUEST_CHECKPOINT_105,
    D2S_QUEST_CHECKPOINT_106,
    D2S_QUEST_CHECKPOINT_107,
    D2S_QUEST_CHECKPOINT_108,
    D2S_QUEST_CHECKPOINT_109,
    D2S_QUEST_CHECKPOINT_110,
    D2S_QUEST_CHECKPOINT_111,
    D2S_QUEST_CHECKPOINT_112,
    D2S_QUEST_CHECKPOINT_113,
    D2S_QUEST_CHECKPOINT_114,
    D2S_QUEST_CHECKPOINT_115,
    D2S_QUEST_CHECKPOINT_116,
    D2S_QUEST_CHECKPOINT_117,
    D2S_QUEST_CHECKPOINT_118,
    D2S_QUEST_CHECKPOINT_119,
    D2S_QUEST_CHECKPOINT_120,
    D2S_QUEST_CHECKPOINT_121,
    D2S_QUEST_CHECKPOINT_122,
    D2S_QUEST_CHECKPOINT_123,
    D2S_QUEST_CHECKPOINT_124,
    D2S_QUEST_CHECKPOINT_125,
    D2S_QUEST_CHECKPOINT_126,
    D2S_QUEST_CHECKPOINT_127,
    D2S_QUEST_CHECKPOINT_128,
    D2S_QUEST_CHECKPOINT_129,
    D2S_QUEST_CHECKPOINT_130,
    D2S_QUEST_CHECKPOINT_131,
    D2S_QUEST_CHECKPOINT_132,
    D2S_QUEST_CHECKPOINT_133,
    D2S_QUEST_CHECKPOINT_134,
    D2S_QUEST_CHECKPOINT_135,
    D2S_QUEST_CHECKPOINT_136,
    D2S_QUEST_CHECKPOINT_137,
    D2S_QUEST_CHECKPOINT_138,
    D2S_QUEST_CHECKPOINT_139,
    D2S_QUEST_CHECKPOINT_140,
    D2S_QUEST_CHECKPOINT_141,
    D2S_QUEST_CHECKPOINT_142,
    D2S_QUEST_CHECKPOINT_143,
    D2S_QUEST_CHECKPOINT_144,
    D2S_QUEST_CHECKPOINT_145,
    D2S_QUEST_CHECKPOINT_146,
    D2S_QUEST_CHECKPOINT_147,
    D2S_QUEST_CHECKPOINT_148,
    D2S_QUEST_CHECKPOINT_149,
    D2S_QUEST_CHECKPOINT_150,
    D2S_QUEST_CHECKPOINT_151,
    D2S_QUEST_CHECKPOINT_152,
    D2S_QUEST_CHECKPOINT_153,
    D2S_QUEST_CHECKPOINT_154,
    D2S_QUEST_CHECKPOINT_155,
    D2S_QUEST_CHECKPOINT_156,
    D2S_QUEST_CHECKPOINT_157,
    D2S_QUEST_CHECKPOINT_158,
    D2S_QUEST_CHECKPOINT_159,
    D2S_QUEST_CHECKPOINT_160,
    D2S_QUEST_CHECKPOINT_161,
    D2S_QUEST_CHECKPOINT_162,
    D2S_QUEST_CHECKPOINT_163,
    D2S_QUEST_CHECKPOINT_164,
    D2S_QUEST_CHECKPOINT_165,
    D2S_QUEST_CHECKPOINT_166,
    D2S_QUEST_CHECKPOINT_167,
    D2S_QUEST_CHECKPOINT_168,
    D2S_QUEST_CHECKPOINT_169,
    D2S_QUEST_CHECKPOINT_170,
    D2S_QUEST_CHECKPOINT_171,
    D2S_QUEST_CHECKPOINT_172,
    D2S_QUEST_CHECKPOINT_173,
    D2S_QUEST_CHECKPOINT_174,
    D2S_QUEST_CHECKPOINT_175,
    D2S_QUEST_CHECKPOINT_176,
    D2S_QUEST_CHECKPOINT_177,
    D2S_QUEST_CHECKPOINT_178,
    D2S_QUEST_CHECKPOINT_179,
    D2S_QUEST_CHECKPOINT_180,
    D2S_QUEST_CHECKPOINT_181,
    D2S_QUEST_CHECKPOINT_182,
    D2S_QUEST_CHECKPOINT_183,
    D2S_QUEST_CHECKPOINT_184,
    D2S_QUEST_CHECKPOINT_185,
    D2S_QUEST_CHECKPOINT_186,
    D2S_QUEST_CHECKPOINT_187,
    D2S_QUEST_CHECKPOINT_188,
    D2S_QUEST_CHECKPOINT_189,
    D2S_QUEST_CHECKPOINT_190,
    D2S_QUEST_CHECKPOINT_191,
    D2S_QUEST_CHECKPOINT_192,
    D2S_QUEST_CHECKPOINT_193,
    D2S_QUEST_CHECKPOINT_194,
    D2S_QUEST_CHECKPOINT_195,
    D2S_QUEST_CHECKPOINT_196,
    D2S_QUEST_CHECKPOINT_197,
    D2S_QUEST_CHECKPOINT_198,
    D2S_QUEST_CHECKPOINT_199,
    D2S_QUEST_CHECKPOINT_200,
    D2S_QUEST_CHECKPOINT_201,
    D2S_QUEST_CHECKPOINT_202,
    D2S_QUEST_CHECKPOINT_203,
    D2S_QUEST_CHECKPOINT_204,
    D2S_QUEST_CHECKPOINT_205,
    D2S_QUEST_CHECKPOINT_206,
    D2S_QUEST_CHECKPOINT_207,
    D2S_QUEST_CHECKPOINT_208,
    D2S_QUEST_CHECKPOINT_209,
    D2S_QUEST_CHECKPOINT_210,
    D2S_QUEST_CHECKPOINT_211,
    D2S_QUEST_CHECKPOINT_212,
    D2S_QUEST_CHECKPOINT_213,
    D2S_QUEST_CHECKPOINT_214,
    D2S_QUEST_CHECKPOINT_215,
    D2S_QUEST_CHECKPOINT_216,
    D2S_QUEST_CHECKPOINT_217,
    D2S_QUEST_CHECKPOINT_218,
    D2S_QUEST_CHECKPOINT_219,
    D2S_QUEST_CHECKPOINT_220,
    D2S_QUEST_CHECKPOINT_221,
    D2S_QUEST_CHECKPOINT_222,
    D2S_QUEST_CHECKPOINT_223,
    D2S_QUEST_CHECKPOINT_224,
    D2S_QUEST_CHECKPOINT_225,
    D2S_QUEST_CHECKPOINT_226,
    D2S_QUEST_CHECKPOINT_227,
    D2S_QUEST_CHECKPOINT_228,
    D2S_QUEST_CHECKPOINT_229,
    D2S_QUEST_CHECKPOINT_230,
    D2S_QUEST_CHECKPOINT_231,
    D2S_QUEST_CHECKPOINT_232,
    D2S_QUEST_CHECKPOINT_233,
    D2S_QUEST_CHECKPOINT_234,
    D2S_QUEST_CHECKPOINT_235,
    D2S_QUEST_CHECKPOINT_236,
    D2S_QUEST_CHECKPOINT_237,
    D2S_QUEST_CHECKPOINT_238,
    D2S_QUEST_CHECKPOINT_239,
    D2S_QUEST_CHECKPOINT_240,
    D2S_QUEST_CHECKPOINT_241,
    D2S_QUEST_CHECKPOINT_242,
    D2S_QUEST_CHECKPOINT_243,
    D2S_QUEST_CHECKPOINT_244,
    D2S_QUEST_CHECKPOINT_245,
    D2S_QUEST_CHECKPOINT_246,
    D2S_QUEST_CHECKPOINT_247,
    D2S_QUEST_CHECKPOINT_248,
    D2S_QUEST_CHECKPOINT_249,
    D2S_QUEST_CHECKPOINT_250,
    D2S_QUEST_CHECKPOINT_251,
    D2S_QUEST_CHECKPOINT_252,
    D2S_QUEST_CHECKPOINT_253,
    D2S_QUEST_CHECKPOINT_256,
    D2S_QUEST_CHECKPOINT_257,
    D2S_QUEST_CHECKPOINT_258,
    D2S_QUEST_CHECKPOINT_259,
    D2S_QUEST_CHECKPOINT_260,
    D2S_QUEST_CHECKPOINT_261,
    D2S_QUEST_CHECKPOINT_262,
    D2S_QUEST_CHECKPOINT_263,
    D2S_QUEST_CHECKPOINT_264,
    D2S_QUEST_CHECKPOINT_265,
    D2S_QUEST_CHECKPOINT_266,
    D2S_QUEST_CHECKPOINT_267,
    D2S_QUEST_CHECKPOINT_268,
    D2S_QUEST_CHECKPOINT_269,
    D2S_QUEST_CHECKPOINT_270,
    D2S_QUEST_CHECKPOINT_271,
    D2S_QUEST_CHECKPOINT_272,
    D2S_QUEST_CHECKPOINT_273,
    D2S_QUEST_CHECKPOINT_274,
    D2S_QUEST_CHECKPOINT_275,
    D2S_QUEST_CHECKPOINT_276,
    D2S_QUEST_CHECKPOINT_277,
    D2S_QUEST_CHECKPOINT_278,
    D2S_QUEST_CHECKPOINT_279,
    D2S_QUEST_CHECKPOINT_280,
    D2S_QUEST_CHECKPOINT_281,
    D2S_QUEST_CHECKPOINT_282,
    D2S_QUEST_CHECKPOINT_283,
    D2S_QUEST_CHECKPOINT_284,
    D2S_QUEST_CHECKPOINT_285,
    D2S_QUEST_CHECKPOINT_286,
    D2S_QUEST_CHECKPOINT_287,
    D2S_QUEST_CHECKPOINT_288,
    D2S_QUEST_CHECKPOINT_289,
    D2S_QUEST_CHECKPOINT_290,
    D2S_QUEST_CHECKPOINT_291,
    D2S_QUEST_CHECKPOINT_292,
    D2S_QUEST_CHECKPOINT_293,
    D2S_QUEST_CHECKPOINT_294,
    D2S_QUEST_CHECKPOINT_295,
    D2S_QUEST_CHECKPOINT_296,
    D2S_QUEST_CHECKPOINT_297,
    D2S_QUEST_CHECKPOINT_298,
    D2S_QUEST_CHECKPOINT_299,
    D2S_QUEST_CHECKPOINT_300,
    D2S_QUEST_CHECKPOINT_301,
    D2S_QUEST_CHECKPOINT_302,
    D2S_QUEST_CHECKPOINT_303,
    D2S_QUEST_CHECKPOINT_304,
    D2S_QUEST_CHECKPOINT_305,
    D2S_QUEST_CHECKPOINT_306,
    D2S_QUEST_CHECKPOINT_307,
    D2S_QUEST_CHECKPOINT_308,
    D2S_QUEST_CHECKPOINT_309,
    D2S_QUEST_CHECKPOINT_310,
    D2S_QUEST_CHECKPOINT_311,
    D2S_QUEST_CHECKPOINT_312,
    D2S_QUEST_CHECKPOINT_313,
    D2S_QUEST_CHECKPOINT_314,
    D2S_QUEST_CHECKPOINT_315,
    D2S_QUEST_CHECKPOINT_316,
    D2S_QUEST_CHECKPOINT_317,
    D2S_QUEST_CHECKPOINT_318,
    D2S_QUEST_CHECKPOINT_319,
    D2S_QUEST_CHECKPOINT_320,
    D2S_QUEST_CHECKPOINT_321,
    D2S_QUEST_CHECKPOINT_322,
    D2S_QUEST_CHECKPOINT_323,
    D2S_QUEST_CHECKPOINT_324,
    D2S_QUEST_CHECKPOINT_325,
    D2S_QUEST_CHECKPOINT_326,
    D2S_QUEST_CHECKPOINT_327,
    D2S_QUEST_CHECKPOINT_328,
    D2S_QUEST_CHECKPOINT_329,
    D2S_QUEST_CHECKPOINT_330,
    D2S_QUEST_CHECKPOINT_331,
    D2S_QUEST_CHECKPOINT_332,
    D2S_QUEST_CHECKPOINT_333,
    D2S_QUEST_CHECKPOINT_334,
    D2S_QUEST_CHECKPOINT_335,
    D2S_QUEST_CHECKPOINT_336,
    D2S_QUEST_CHECKPOINT_337,
    D2S_QUEST_CHECKPOINT_338,
    D2S_QUEST_CHECKPOINT_339,
    D2S_QUEST_CHECKPOINT_340,
    D2S_QUEST_CHECKPOINT_341,
    D2S_QUEST_CHECKPOINT_342,
    D2S_QUEST_CHECKPOINT_343,
    D2S_QUEST_CHECKPOINT_344,
    D2S_QUEST_CHECKPOINT_345,
    D2S_QUEST_CHECKPOINT_346,
    D2S_QUEST_CHECKPOINT_347,
    D2S_QUEST_CHECKPOINT_348,
    D2S_QUEST_CHECKPOINT_349,
    D2S_QUEST_CHECKPOINT_350,
    D2S_QUEST_CHECKPOINT_351,
    D2S_QUEST_CHECKPOINT_352,
    D2S_QUEST_CHECKPOINT_353,
    D2S_QUEST_CHECKPOINT_354,
    D2S_QUEST_CHECKPOINT_355,
    D2S_QUEST_CHECKPOINT_356,
    D2S_QUEST_CHECKPOINT_357,
    D2S_QUEST_CHECKPOINT_358,
    D2S_QUEST_CHECKPOINT_359,
    D2S_QUEST_CHECKPOINT_360,
    D2S_QUEST_CHECKPOINT_361,
    D2S_QUEST_CHECKPOINT_362,
    D2S_QUEST_CHECKPOINT_363,
    D2S_QUEST_CHECKPOINT_364,
    D2S_QUEST_CHECKPOINT_365,
    D2S_QUEST_CHECKPOINT_366,
    D2S_QUEST_CHECKPOINT_367,
    D2S_QUEST_CHECKPOINT_368,
    D2S_QUEST_CHECKPOINT_369,
    D2S_QUEST_CHECKPOINT_370,
    D2S_QUEST_CHECKPOINT_371,
    D2S_QUEST_CHECKPOINT_372,
    D2S_QUEST_CHECKPOINT_373,
    D2S_QUEST_CHECKPOINT_374,
    D2S_QUEST_CHECKPOINT_375,
    D2S_QUEST_CHECKPOINT_376,
    D2S_QUEST_CHECKPOINT_377,
    D2S_QUEST_CHECKPOINT_378,
    D2S_QUEST_CHECKPOINT_379,
    D2S_QUEST_CHECKPOINT_380,
    D2S_QUEST_CHECKPOINT_381,
    D2S_QUEST_CHECKPOINT_382,
    D2S_QUEST_CHECKPOINT_383,
    D2S_QUEST_CHECKPOINT_384,
    D2S_QUEST_CHECKPOINT_385,
    D2S_QUEST_CHECKPOINT_386,
    D2S_QUEST_CHECKPOINT_387,
    D2S_QUEST_CHECKPOINT_388,
    D2S_QUEST_CHECKPOINT_389,
    D2S_QUEST_CHECKPOINT_390,
    D2S_QUEST_CHECKPOINT_391,
    D2S_QUEST_CHECKPOINT_392,
    D2S_QUEST_CHECKPOINT_393,
    D2S_QUEST_CHECKPOINT_394,
    D2S_QUEST_CHECKPOINT_395,
    D2S_QUEST_CHECKPOINT_396,
    D2S_QUEST_CHECKPOINT_397,
    D2S_QUEST_CHECKPOINT_398,
    D2S_QUEST_CHECKPOINT_399,
    D2S_QUEST_CHECKPOINT_400,
    D2S_QUEST_CHECKPOINT_401,
    D2S_QUEST_CHECKPOINT_402,
    D2S_QUEST_CHECKPOINT_403,
    D2S_QUEST_CHECKPOINT_404,
    D2S_QUEST_CHECKPOINT_405,
    D2S_QUEST_CHECKPOINT_406,
    D2S_QUEST_CHECKPOINT_407,
    D2S_QUEST_CHECKPOINT_408,
    D2S_QUEST_CHECKPOINT_409,
    D2S_QUEST_CHECKPOINT_410,
    D2S_QUEST_CHECKPOINT_411,
    D2S_QUEST_CHECKPOINT_412,
    D2S_QUEST_CHECKPOINT_413,
    D2S_QUEST_CHECKPOINT_414,
    D2S_QUEST_CHECKPOINT_415,
    D2S_QUEST_CHECKPOINT_416,
    D2S_QUEST_CHECKPOINT_417,
    D2S_QUEST_CHECKPOINT_418,
    D2S_QUEST_CHECKPOINT_419,
    D2S_QUEST_CHECKPOINT_420,
    D2S_QUEST_CHECKPOINT_421,
    D2S_QUEST_CHECKPOINT_422,
    D2S_QUEST_CHECKPOINT_423,
    D2S_QUEST_CHECKPOINT_424,
    D2S_QUEST_CHECKPOINT_425,
    D2S_QUEST_CHECKPOINT_426,
    D2S_QUEST_CHECKPOINT_427,
    D2S_QUEST_CHECKPOINT_428,
    D2S_QUEST_CHECKPOINT_429,
    D2S_QUEST_CHECKPOINT_430,
    D2S_QUEST_CHECKPOINT_431
};
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

typedef struct __attribute__((packed)) {
    uint16_t actStarted;
    uint16_t questCheckpoints[6];
    uint16_t actEnded;
} D2ActData;

typedef struct __attribute__((packed)) {
    uint16_t actStarted;
    uint16_t unknown1[2];
    uint16_t questCheckpoints[6];
} D2XActData;

typedef struct __attribute__((packed)) {
    D2ActData actData[4];
    D2XActData expansionAct;
510
511
512
    // My guess is that the following `uint16_t`s all represents some quest data that was added after 
    // the game was launched. This also explains why there's version data (supposedly) and length 
    // of the quest data in bytes in the header.
Imanol-Mikel Barba Sabariego authored
513
514
    uint16_t akaraRespecData; // This uint16_t determines if the player has used Akara's respec or not
    uint16_t unknown1[6];
515
516
517
} D2Quests;

typedef struct __attribute__((packed)) {
518
519
    const char* header[D2S_QUESTDATA_HEADER_LENGTH]; // Woo!
    uint32_t unknown1; // This is likely version data
520
521
522
523
    uint16_t size; // in bytes
    D2Quests quests[3]; // 1 set for each difficulty
} D2QuestData;
524
525
// Returns static string from library memory, no need to free
const char* getQuestName(D2S_QUEST quest);
526
Imanol-Mikel Barba Sabariego authored
527
528
529
// Populates `descriptions` with static strings from library memory, no need to free.
// `descriptions` contains one string for each bit field of the quest's uint16_t data.
// Empty entries (non-existant or unknown checkpoints) will have NULL value. Be careful!
530
int getCheckpointDescriptions(D2S_QUEST quest, const char* *descriptions[16]);
Imanol-Mikel Barba Sabariego authored
531
532

// Returns quest status for the specified quest and act.
533
534
int getQuestStatus(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty, uint16_t* data);
int setQuestStatus(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty, uint16_t questData);
Imanol-Mikel Barba Sabariego authored
535
536
537
538
int isQuestStarted(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty);
int isQuestRewardCollected(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty);
int isQuestCompleted(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty);
Imanol-Mikel Barba Sabariego authored
539
540

// Set bool to 1 to set the status or 0 to remove it
541
542
int setQuestStarted(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty, int bool);
int setQuestRewardCollected(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty, int bool);
543
Imanol-Mikel Barba Sabariego authored
544
545
// When called to set the request to NOT completed (`bool` = 0), this will NOT set the reward collected status
// which *may* render the quest unobtainable, this is done in case we may want to further modify the quest state.
546
// If you want to mark the quest as not completed just to get the reward, please use `setQuestRewardCollected(,,0)`
Imanol-Mikel Barba Sabariego authored
547
// instead.
548
int setQuestCompleted(D2QuestData* d, D2S_QUEST quest, D2S_DIFFICULTY difficulty, int bool);
Imanol-Mikel Barba Sabariego authored
549
550
551

// Some quests have extra fields outside their quest data that govern certain states of the quest
// So far, I only know of the respec that Akara offers when clearing Den of Evil
552
553
int getSpecialQuestStatus(D2QuestData* d, D2S_SPECIALQUEST specialQuestState, D2S_DIFFICULTY difficulty);
int setSpecialQuestStatus(D2QuestData* d, D2S_SPECIALQUEST specialQuestState, D2S_DIFFICULTY difficulty, int bool);
554
555

#endif