d2quest.h
16.6 KB
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
#ifndef D2QUEST_H
#define D2QUEST_H
#include <stdint.h>
#include "d2char.h"
#include "d2common.h"
#include "d2strings.h"
#define D2S_QUESTDATA_HEADER_LENGTH 4
#define D2S_QUESTDATA_NUMQUESTS 27
typedef enum D2S_QUEST_IDENTIFIER {
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
} D2S_QUEST_IDENTIFIER;
// TODO transform this into struct with name and checkpoints
typedef struct D2Quest {
const char* name;
const char* checkpointNames[16];
uint16_t questData;
D2S_DIFFICULTY difficulty;
} D2Quest;
const D2Quest quests[] = {
{"Den of Evil", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Sister's Burial Grounds", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Search For Cain", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Forgotten Tower", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Tools of the Trade", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Sisters To the Slaughter", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Radament's Lair", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Horadric Staff", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Tainted Sun", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Arcane Sanctuary", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Summoner", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Seven Tombs", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Golden Bird", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Blade of the Old Religion", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Khalim's Will", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Lam Esen's Tome", {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_254, D2S_QUEST_CHECKPOINT_255}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Blackened Temple", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"The Guardian", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Fallen Angel", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Hell's Forge", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Terror's End", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Siege On Harrogath", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Rescue On Mount Arreat", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Prison of Ice", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Betrayal of Harrogath", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Rite of Passage", {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}, 0, D2S_DIFFICULTY_UNKNOWN},
{"Eve of Destruction", {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}, 0, D2S_DIFFICULTY_UNKNOWN}
};
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
};
typedef enum D2S_SPECIALQUEST {
D2S_SPECIALQUEST_UNKNOWN = -1,
D2S_SPECIALQUEST_AKARA_RESPEC = 0
} D2S_SPECIALQUEST;
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;
// 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.
uint16_t akaraRespecData; // This uint16_t determines if the player has used Akara's respec or not
uint16_t unknown1[6];
} D2Quests;
typedef struct __attribute__((packed)) {
const char* header[D2S_QUESTDATA_HEADER_LENGTH]; // Woo!
uint32_t unknown1; // This is likely version data
uint16_t size; // in bytes
D2Quests quests[3]; // 1 set for each difficulty
} D2QuestData;
// Populates a D2Quest struct with the quest name and
// its checkpoint names, as well as quest data for the
// specified difficulty. Returned strings are static
// strings from library memory, no need to free
int getQuestData(D2QuestData* d, D2S_QUEST_IDENTIFIER questID, D2Quest* quest, D2S_DIFFICULTY difficulty);
// Sets quest status for the specified quest
int setQuestData(D2QuestData* d, D2S_QUEST_IDENTIFIER questID, D2Quest* quest);
int isQuestStarted(D2Quest* quest);
int isQuestRewardCollected(D2Quest* quest);
int isQuestCompleted(D2Quest* quest);
// The following functions don't directly modify the quest
// you must call setQuestData afterwards
// Set bool to 1 to set the status or 0 to remove it
void setQuestStarted(D2Quest* quest, int bool);
void setQuestRewardCollected(D2Quest* quest, int bool);
// 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.
// If you want to mark the quest as not completed just to get the reward, please use `setQuestRewardCollected(,,0)`
// instead.
void setQuestCompleted(D2Quest* quest, int bool);
// 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
int getSpecialQuestStatus(D2QuestData* d, D2S_SPECIALQUEST specialQuestState, D2S_DIFFICULTY difficulty);
int setSpecialQuestStatus(D2QuestData* d, D2S_SPECIALQUEST specialQuestState, D2S_DIFFICULTY difficulty, int bool);
#endif