|
|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
int qtopline; // idb
|
|
|
|
|
BOOL questlog; |
|
|
|
|
void *pQLogCel; |
|
|
|
|
BYTE *pQLogCel; |
|
|
|
|
QuestStruct quests[MAXQUESTS]; |
|
|
|
|
int qline; // weak
|
|
|
|
|
int qlist[MAXQUESTS]; |
|
|
|
|
@ -51,9 +51,8 @@ int QuestGroup4[2] = { QTYPE_VEIL, QTYPE_WARLRD };
|
|
|
|
|
|
|
|
|
|
void InitQuests() |
|
|
|
|
{ |
|
|
|
|
int initiatedQuests; |
|
|
|
|
int i; |
|
|
|
|
unsigned int z; |
|
|
|
|
int i, initiatedQuests; |
|
|
|
|
DWORD z; |
|
|
|
|
|
|
|
|
|
if (gbMaxPlayers == 1) { |
|
|
|
|
for (i = 0; i < MAXQUESTS; i++) { |
|
|
|
|
@ -82,7 +81,7 @@ void InitQuests()
|
|
|
|
|
quests[z]._qvar1 = 0; |
|
|
|
|
quests[z]._qlog = 0; |
|
|
|
|
} |
|
|
|
|
++initiatedQuests; |
|
|
|
|
initiatedQuests++; |
|
|
|
|
} else { |
|
|
|
|
quests[z]._qactive = 1; |
|
|
|
|
quests[z]._qlevel = questlist[z]._qdlvl; |
|
|
|
|
@ -124,8 +123,6 @@ void InitQuests()
|
|
|
|
|
if (gbMaxPlayers != 1) |
|
|
|
|
quests[QTYPE_VB]._qvar1 = 2; |
|
|
|
|
} |
|
|
|
|
// 679660: using guessed type char gbMaxPlayers;
|
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
|
|
|
|
|
void CheckQuests() |
|
|
|
|
{ |
|
|
|
|
@ -235,11 +232,10 @@ BOOL ForceQuests()
|
|
|
|
|
|
|
|
|
|
return FALSE; |
|
|
|
|
} |
|
|
|
|
// 679660: using guessed type char gbMaxPlayers;
|
|
|
|
|
|
|
|
|
|
BOOL QuestStatus(int i) |
|
|
|
|
{ |
|
|
|
|
BOOL result; // al
|
|
|
|
|
BOOL result; |
|
|
|
|
|
|
|
|
|
if (setlevel |
|
|
|
|
|| currlevel != quests[i]._qlevel |
|
|
|
|
@ -249,24 +245,12 @@ BOOL QuestStatus(int i)
|
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
// 5CF31D: using guessed type char setlevel;
|
|
|
|
|
// 679660: using guessed type char gbMaxPlayers;
|
|
|
|
|
|
|
|
|
|
void CheckQuestKill(int m, BOOL sendmsg) |
|
|
|
|
{ |
|
|
|
|
int v2; // ecx
|
|
|
|
|
char v3; // al
|
|
|
|
|
unsigned char v5; // dl
|
|
|
|
|
char *v7; // ecx
|
|
|
|
|
int v10; // edi
|
|
|
|
|
int(*v11)[112]; // esi
|
|
|
|
|
signed int v12; // ecx
|
|
|
|
|
int *v13; // eax
|
|
|
|
|
int(*v14)[112]; // ebx
|
|
|
|
|
|
|
|
|
|
v2 = m; |
|
|
|
|
v3 = monster[v2].MType->mtype; |
|
|
|
|
if (v3 == MT_SKING) { |
|
|
|
|
int i, j; |
|
|
|
|
|
|
|
|
|
if (monster[m].MType->mtype == MT_SKING) { |
|
|
|
|
quests[QTYPE_KING]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
@ -276,111 +260,10 @@ void CheckQuestKill(int m, BOOL sendmsg)
|
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE82; |
|
|
|
|
} |
|
|
|
|
if (sendmsg) |
|
|
|
|
NetSendCmdQuest(TRUE, 12); |
|
|
|
|
|
|
|
|
|
if (sendmsg) { |
|
|
|
|
v5 = 12; |
|
|
|
|
LABEL_10: |
|
|
|
|
NetSendCmdQuest(TRUE, v5); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (v3 != MT_CLEAVER) { |
|
|
|
|
v7 = monster[v2].mName; |
|
|
|
|
if (v7 == UniqMonst[0].mName) { |
|
|
|
|
quests[QTYPE_GARB]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR61; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE61; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE61; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (v7 == UniqMonst[2].mName) { |
|
|
|
|
quests[QTYPE_ZHAR]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR62; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE62; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE62; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (v7 == UniqMonst[4].mName) { |
|
|
|
|
if (gbMaxPlayers != 1) { |
|
|
|
|
quests[QTYPE_VB]._qactive = 3; |
|
|
|
|
quests[QTYPE_VB]._qvar1 = 7; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
quests[QTYPE_MOD]._qactive = 2; |
|
|
|
|
v10 = 0; |
|
|
|
|
v11 = dPiece; |
|
|
|
|
do { |
|
|
|
|
v12 = 0; |
|
|
|
|
v13 = &trigs[trigflag_4]._ty; |
|
|
|
|
v14 = v11; |
|
|
|
|
do { |
|
|
|
|
if ((*v14)[0] == 370) { |
|
|
|
|
++trigflag_4; |
|
|
|
|
*(v13 - 1) = v12; |
|
|
|
|
*v13 = v10; |
|
|
|
|
v13[1] = 1026; |
|
|
|
|
v13 += 4; |
|
|
|
|
} |
|
|
|
|
++v12; |
|
|
|
|
++v14; |
|
|
|
|
} while (v12 < 112); |
|
|
|
|
v11 = (int(*)[112])((char *)v11 + 4); |
|
|
|
|
++v10; |
|
|
|
|
} while ((signed int)v11 < (signed int)dPiece[1]); |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE83; |
|
|
|
|
} |
|
|
|
|
if (sendmsg) { |
|
|
|
|
NetSendCmdQuest(TRUE, 0xFu); |
|
|
|
|
v5 = 5; |
|
|
|
|
goto LABEL_10; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (v7 == UniqMonst[4].mName && gbMaxPlayers == 1) { |
|
|
|
|
quests[QTYPE_VB]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
InitVPTriggers(); |
|
|
|
|
quests[QTYPE_VB]._qvar1 = 7; |
|
|
|
|
quests[QTYPE_VB]._qvar2 = 4; |
|
|
|
|
quests[QTYPE_MOD]._qactive = 2; |
|
|
|
|
AddMissile(35, 32, 35, 32, 0, MIS_RPORTAL, 0, myplr, 0, 0); |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE83; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (v7 == UniqMonst[8].mName) { |
|
|
|
|
quests[QTYPE_WARLRD]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR94; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE94; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE94; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} else if (monster[m].MType->mtype == MT_CLEAVER) { |
|
|
|
|
quests[QTYPE_BUTCH]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
@ -390,35 +273,103 @@ void CheckQuestKill(int m, BOOL sendmsg)
|
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE80; |
|
|
|
|
} |
|
|
|
|
if (sendmsg) |
|
|
|
|
NetSendCmdQuest(TRUE, 6); |
|
|
|
|
} else if (monster[m].mName == UniqMonst[0].mName) { //"Gharbad the Weak"
|
|
|
|
|
quests[QTYPE_GARB]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR61; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE61; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE61; |
|
|
|
|
} |
|
|
|
|
} else if (monster[m].mName == UniqMonst[2].mName) { //"Zhar the Mad"
|
|
|
|
|
quests[QTYPE_ZHAR]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR62; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE62; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE62; |
|
|
|
|
} |
|
|
|
|
} else if (monster[m].mName == UniqMonst[4].mName && gbMaxPlayers != 1) { //"Arch-Bishop Lazarus"
|
|
|
|
|
quests[QTYPE_VB]._qactive = 3; |
|
|
|
|
quests[QTYPE_VB]._qvar1 = 7; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
quests[QTYPE_MOD]._qactive = 2; |
|
|
|
|
|
|
|
|
|
for (j = 0; j < 112; j++) { |
|
|
|
|
for (i = 0; i < 112; i++) { |
|
|
|
|
if (dPiece[i][j] == 370) { |
|
|
|
|
trigs[trigflag_4]._tx = i; |
|
|
|
|
trigs[trigflag_4]._ty = j; |
|
|
|
|
trigs[trigflag_4]._tmsg = 1026; |
|
|
|
|
trigflag_4++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE83; |
|
|
|
|
} |
|
|
|
|
if (sendmsg) { |
|
|
|
|
v5 = 6; |
|
|
|
|
goto LABEL_10; |
|
|
|
|
NetSendCmdQuest(TRUE, 15); |
|
|
|
|
NetSendCmdQuest(TRUE, 5); |
|
|
|
|
} |
|
|
|
|
} else if (monster[m].mName == UniqMonst[4].mName && gbMaxPlayers == 1) { //"Arch-Bishop Lazarus"
|
|
|
|
|
quests[QTYPE_VB]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
InitVPTriggers(); |
|
|
|
|
quests[QTYPE_VB]._qvar1 = 7; |
|
|
|
|
quests[QTYPE_VB]._qvar2 = 4; |
|
|
|
|
quests[QTYPE_MOD]._qactive = 2; |
|
|
|
|
AddMissile(35, 32, 35, 32, 0, MIS_RPORTAL, 0, myplr, 0, 0); |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE83; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE83; |
|
|
|
|
} |
|
|
|
|
} else if (monster[m].mName == UniqMonst[8].mName) { //"Warlord of Blood"
|
|
|
|
|
quests[QTYPE_WARLRD]._qactive = 3; |
|
|
|
|
sfxdelay = 30; |
|
|
|
|
if (plr[myplr]._pClass == PC_WARRIOR) { |
|
|
|
|
sfxdnum = PS_WARR94; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_ROGUE) { |
|
|
|
|
sfxdnum = PS_ROGUE94; |
|
|
|
|
} else if (plr[myplr]._pClass == PC_SORCERER) { |
|
|
|
|
sfxdnum = PS_MAGE94; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 52A554: using guessed type int sfxdelay;
|
|
|
|
|
// 679660: using guessed type char gbMaxPlayers;
|
|
|
|
|
|
|
|
|
|
void DrawButcher() |
|
|
|
|
{ |
|
|
|
|
DRLG_RectTrans(2 * setpc_x + 19, 2 * setpc_y + 19, 2 * setpc_x + 26, 2 * setpc_y + 26); |
|
|
|
|
int x, y; |
|
|
|
|
|
|
|
|
|
x = 2 * setpc_x + 16; |
|
|
|
|
y = 2 * setpc_y + 16; |
|
|
|
|
DRLG_RectTrans(x + 3, y + 3, x + 10, y + 10); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawSkelKing(int q, int x, int y) |
|
|
|
|
{ |
|
|
|
|
int v3; // eax
|
|
|
|
|
|
|
|
|
|
v3 = q; |
|
|
|
|
quests[v3]._qtx = 2 * x + 28; |
|
|
|
|
quests[v3]._qty = 2 * y + 23; |
|
|
|
|
quests[q]._qtx = 2 * x + 28; |
|
|
|
|
quests[q]._qty = 2 * y + 23; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawWarLord(int x, int y) |
|
|
|
|
{ |
|
|
|
|
int rw, rh; |
|
|
|
|
int i, j; |
|
|
|
|
unsigned char *sp; |
|
|
|
|
unsigned char *setp; |
|
|
|
|
BYTE *sp, *setp; |
|
|
|
|
int v; |
|
|
|
|
|
|
|
|
|
setp = LoadFileInMem("Levels\\L4Data\\Warlord2.DUN", NULL); |
|
|
|
|
@ -430,8 +381,8 @@ void DrawWarLord(int x, int y)
|
|
|
|
|
setpc_h = rh; |
|
|
|
|
setpc_x = x; |
|
|
|
|
setpc_y = y; |
|
|
|
|
for (j = y; j < y+rh; j++) { |
|
|
|
|
for (i = x; i < x+rw; i++) { |
|
|
|
|
for (j = y; j < y + rh; j++) { |
|
|
|
|
for (i = x; i < x + rw; i++) { |
|
|
|
|
if (*sp != 0) { |
|
|
|
|
v = *sp; |
|
|
|
|
} else { |
|
|
|
|
@ -443,16 +394,13 @@ void DrawWarLord(int x, int y)
|
|
|
|
|
} |
|
|
|
|
mem_free_dbg(setp); |
|
|
|
|
} |
|
|
|
|
// 5CF330: using guessed type int setpc_h;
|
|
|
|
|
// 5CF334: using guessed type int setpc_w;
|
|
|
|
|
|
|
|
|
|
void DrawSChamber(int q, int x, int y) |
|
|
|
|
{ |
|
|
|
|
int i, j; |
|
|
|
|
int rw, rh; |
|
|
|
|
int xx, yy; |
|
|
|
|
unsigned char *sp; |
|
|
|
|
unsigned char *setp; |
|
|
|
|
BYTE *sp, *setp; |
|
|
|
|
int v; |
|
|
|
|
|
|
|
|
|
setp = LoadFileInMem("Levels\\L2Data\\Bonestr1.DUN", NULL); |
|
|
|
|
@ -464,8 +412,8 @@ void DrawSChamber(int q, int x, int y)
|
|
|
|
|
setpc_h = rh; |
|
|
|
|
setpc_x = x; |
|
|
|
|
setpc_y = y; |
|
|
|
|
for (j = y; j < y+rh; j++) { |
|
|
|
|
for (i = x; i < x+rw; i++) { |
|
|
|
|
for (j = y; j < y + rh; j++) { |
|
|
|
|
for (i = x; i < x + rw; i++) { |
|
|
|
|
if (*sp != 0) { |
|
|
|
|
v = *sp; |
|
|
|
|
} else { |
|
|
|
|
@ -481,15 +429,12 @@ void DrawSChamber(int q, int x, int y)
|
|
|
|
|
quests[q]._qty = yy; |
|
|
|
|
mem_free_dbg(setp); |
|
|
|
|
} |
|
|
|
|
// 5CF330: using guessed type int setpc_h;
|
|
|
|
|
// 5CF334: using guessed type int setpc_w;
|
|
|
|
|
|
|
|
|
|
void DrawLTBanner(int x, int y) |
|
|
|
|
{ |
|
|
|
|
int rw, rh; |
|
|
|
|
int i, j; |
|
|
|
|
unsigned char *sp; |
|
|
|
|
unsigned char *setp; |
|
|
|
|
BYTE *sp, *setp; |
|
|
|
|
|
|
|
|
|
setp = LoadFileInMem("Levels\\L1Data\\Banner1.DUN", NULL); |
|
|
|
|
rw = *setp; |
|
|
|
|
@ -503,22 +448,19 @@ void DrawLTBanner(int x, int y)
|
|
|
|
|
for (j = 0; j < rh; j++) { |
|
|
|
|
for (i = 0; i < rw; i++) { |
|
|
|
|
if (*sp != 0) { |
|
|
|
|
pdungeon[x+i][y+j] = *sp; |
|
|
|
|
pdungeon[x + i][y + j] = *sp; |
|
|
|
|
} |
|
|
|
|
sp += 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
mem_free_dbg(setp); |
|
|
|
|
} |
|
|
|
|
// 5CF330: using guessed type int setpc_h;
|
|
|
|
|
// 5CF334: using guessed type int setpc_w;
|
|
|
|
|
|
|
|
|
|
void DrawBlind(int x, int y) |
|
|
|
|
{ |
|
|
|
|
int rw, rh; |
|
|
|
|
int i, j; |
|
|
|
|
unsigned char *sp; |
|
|
|
|
unsigned char *setp; |
|
|
|
|
BYTE *sp, *setp; |
|
|
|
|
|
|
|
|
|
setp = LoadFileInMem("Levels\\L2Data\\Blind1.DUN", NULL); |
|
|
|
|
rw = *setp; |
|
|
|
|
@ -532,22 +474,19 @@ void DrawBlind(int x, int y)
|
|
|
|
|
for (j = 0; j < rh; j++) { |
|
|
|
|
for (i = 0; i < rw; i++) { |
|
|
|
|
if (*sp != 0) { |
|
|
|
|
pdungeon[x+i][y+j] = *sp; |
|
|
|
|
pdungeon[x + i][y + j] = *sp; |
|
|
|
|
} |
|
|
|
|
sp += 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
mem_free_dbg(setp); |
|
|
|
|
} |
|
|
|
|
// 5CF330: using guessed type int setpc_h;
|
|
|
|
|
// 5CF334: using guessed type int setpc_w;
|
|
|
|
|
|
|
|
|
|
void DrawBlood(int x, int y) |
|
|
|
|
{ |
|
|
|
|
int rw, rh; |
|
|
|
|
int i, j; |
|
|
|
|
unsigned char *sp; |
|
|
|
|
unsigned char *setp; |
|
|
|
|
BYTE *sp, *setp; |
|
|
|
|
|
|
|
|
|
setp = LoadFileInMem("Levels\\L2Data\\Blood2.DUN", NULL); |
|
|
|
|
rw = *setp; |
|
|
|
|
@ -561,15 +500,13 @@ void DrawBlood(int x, int y)
|
|
|
|
|
for (j = 0; j < rh; j++) { |
|
|
|
|
for (i = 0; i < rw; i++) { |
|
|
|
|
if (*sp != 0) { |
|
|
|
|
dungeon[x+i][y+j] = *sp; |
|
|
|
|
dungeon[x + i][y + j] = *sp; |
|
|
|
|
} |
|
|
|
|
sp += 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
mem_free_dbg(setp); |
|
|
|
|
} |
|
|
|
|
// 5CF330: using guessed type int setpc_h;
|
|
|
|
|
// 5CF334: using guessed type int setpc_w;
|
|
|
|
|
|
|
|
|
|
void DRLG_CheckQuests(int x, int y) |
|
|
|
|
{ |
|
|
|
|
@ -603,7 +540,6 @@ void DRLG_CheckQuests(int x, int y)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
|
|
|
|
|
void SetReturnLvlPos() |
|
|
|
|
{ |
|
|
|
|
@ -644,25 +580,24 @@ void GetReturnLvlPos()
|
|
|
|
|
currlevel = ReturnLvl; |
|
|
|
|
leveltype = ReturnLvlT; |
|
|
|
|
} |
|
|
|
|
// 5BB1ED: using guessed type char leveltype;
|
|
|
|
|
|
|
|
|
|
void ResyncMPQuests() |
|
|
|
|
{ |
|
|
|
|
if (quests[QTYPE_KING]._qactive == 1 |
|
|
|
|
&& currlevel >= (unsigned char)quests[QTYPE_KING]._qlevel - 1 |
|
|
|
|
&& currlevel <= (unsigned char)quests[QTYPE_KING]._qlevel + 1) { |
|
|
|
|
&& currlevel >= quests[QTYPE_KING]._qlevel - 1 |
|
|
|
|
&& currlevel <= quests[QTYPE_KING]._qlevel + 1) { |
|
|
|
|
quests[QTYPE_KING]._qactive = 2; |
|
|
|
|
NetSendCmdQuest(TRUE, 0xCu); |
|
|
|
|
NetSendCmdQuest(TRUE, QTYPE_KING); |
|
|
|
|
} |
|
|
|
|
if (quests[QTYPE_BUTCH]._qactive == 1 |
|
|
|
|
&& currlevel >= (unsigned char)quests[QTYPE_BUTCH]._qlevel - 1 |
|
|
|
|
&& currlevel <= (unsigned char)quests[QTYPE_BUTCH]._qlevel + 1) { |
|
|
|
|
&& currlevel >= quests[QTYPE_BUTCH]._qlevel - 1 |
|
|
|
|
&& currlevel <= quests[QTYPE_BUTCH]._qlevel + 1) { |
|
|
|
|
quests[QTYPE_BUTCH]._qactive = 2; |
|
|
|
|
NetSendCmdQuest(TRUE, 6u); |
|
|
|
|
NetSendCmdQuest(TRUE, QTYPE_BUTCH); |
|
|
|
|
} |
|
|
|
|
if (quests[QTYPE_VB]._qactive == 1 && currlevel == (unsigned char)quests[QTYPE_VB]._qlevel - 1) { |
|
|
|
|
if (quests[QTYPE_VB]._qactive == 1 && currlevel == quests[QTYPE_VB]._qlevel - 1) { |
|
|
|
|
quests[QTYPE_VB]._qactive = 2; |
|
|
|
|
NetSendCmdQuest(TRUE, 0xFu); |
|
|
|
|
NetSendCmdQuest(TRUE, QTYPE_VB); |
|
|
|
|
} |
|
|
|
|
if (QuestStatus(QTYPE_VB)) |
|
|
|
|
AddObject(OBJ_ALTBOY, 2 * setpc_x + 20, 2 * setpc_y + 22); |
|
|
|
|
@ -670,26 +605,19 @@ void ResyncMPQuests()
|
|
|
|
|
|
|
|
|
|
void ResyncQuests() |
|
|
|
|
{ |
|
|
|
|
char *v0; // ecx
|
|
|
|
|
int v1; // esi
|
|
|
|
|
//int v2; // eax
|
|
|
|
|
int i; // esi
|
|
|
|
|
char v4; // bl
|
|
|
|
|
int j; // esi
|
|
|
|
|
char v6; // bl
|
|
|
|
|
int k; // esi
|
|
|
|
|
int i, tren; |
|
|
|
|
|
|
|
|
|
if (setlevel && setlvlnum == quests[QTYPE_PW]._qslvl && quests[QTYPE_PW]._qactive != 1 && leveltype == quests[QTYPE_PW]._qlvltype) { |
|
|
|
|
v0 = "Levels\\L3Data\\L3pwater.pal"; |
|
|
|
|
if (quests[QTYPE_PW]._qactive != 3) |
|
|
|
|
v0 = "Levels\\L3Data\\L3pfoul.pal"; |
|
|
|
|
LoadPalette(v0); |
|
|
|
|
v1 = 0; |
|
|
|
|
do |
|
|
|
|
palette_update_quest_palette(v1++); |
|
|
|
|
while (v1 <= 32); |
|
|
|
|
} |
|
|
|
|
//_LOBYTE(v2) = QuestStatus(QTYPE_BOL);
|
|
|
|
|
|
|
|
|
|
if (quests[QTYPE_PW]._qactive == 3) |
|
|
|
|
LoadPalette("Levels\\L3Data\\L3pwater.pal"); |
|
|
|
|
else |
|
|
|
|
LoadPalette("Levels\\L3Data\\L3pfoul.pal"); |
|
|
|
|
|
|
|
|
|
for (i = 0; i < 32; i++) |
|
|
|
|
palette_update_quest_palette(i); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (QuestStatus(QTYPE_BOL)) { |
|
|
|
|
if (quests[QTYPE_BOL]._qvar1 == 1) |
|
|
|
|
ObjChangeMapResync( |
|
|
|
|
@ -704,21 +632,21 @@ void ResyncQuests()
|
|
|
|
|
setpc_w + setpc_x + 1, |
|
|
|
|
setpc_h + setpc_y + 1); |
|
|
|
|
ObjChangeMapResync(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 2, (setpc_h >> 1) + setpc_y - 2); |
|
|
|
|
for (i = 0; i < nobjects; ++i) |
|
|
|
|
for (i = 0; i < nobjects; i++) |
|
|
|
|
SyncObjectAnim(objectactive[i]); |
|
|
|
|
v4 = TransVal; |
|
|
|
|
tren = TransVal; |
|
|
|
|
TransVal = 9; |
|
|
|
|
DRLG_MRectTrans(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 4, setpc_y + (setpc_h >> 1)); |
|
|
|
|
TransVal = v4; |
|
|
|
|
TransVal = tren; |
|
|
|
|
} |
|
|
|
|
if (quests[QTYPE_BOL]._qvar1 == 3) { |
|
|
|
|
ObjChangeMapResync(setpc_x, setpc_y, setpc_w + setpc_x + 1, setpc_h + setpc_y + 1); |
|
|
|
|
for (j = 0; j < nobjects; ++j) |
|
|
|
|
SyncObjectAnim(objectactive[j]); |
|
|
|
|
v6 = TransVal; |
|
|
|
|
for (i = 0; i < nobjects; i++) |
|
|
|
|
SyncObjectAnim(objectactive[i]); |
|
|
|
|
tren = TransVal; |
|
|
|
|
TransVal = 9; |
|
|
|
|
DRLG_MRectTrans(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 4, setpc_y + (setpc_h >> 1)); |
|
|
|
|
TransVal = v6; |
|
|
|
|
TransVal = tren; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (currlevel == quests[QTYPE_BLKM]._qlevel) { |
|
|
|
|
@ -728,16 +656,15 @@ void ResyncQuests()
|
|
|
|
|
quests[QTYPE_BLKM]._qvar1 = QS_TOMESPAWNED; |
|
|
|
|
} |
|
|
|
|
} else if (quests[QTYPE_BLKM]._qactive == 2) { |
|
|
|
|
if (quests[QTYPE_BLKM]._qvar1 < QS_MUSHGIVEN) { |
|
|
|
|
if (quests[QTYPE_BLKM]._qvar1 >= QS_BRAINGIVEN) |
|
|
|
|
Qtalklist[TOWN_HEALER]._qblkm = -1; |
|
|
|
|
} else { |
|
|
|
|
if (quests[QTYPE_BLKM]._qvar1 >= QS_MUSHGIVEN) { |
|
|
|
|
Qtalklist[TOWN_WITCH]._qblkm = -1; |
|
|
|
|
Qtalklist[TOWN_HEALER]._qblkm = QUEST_MUSH3; |
|
|
|
|
} else if (quests[QTYPE_BLKM]._qvar1 >= QS_BRAINGIVEN) { |
|
|
|
|
Qtalklist[TOWN_HEALER]._qblkm = -1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (currlevel == (unsigned char)quests[QTYPE_VEIL]._qlevel + 1 && quests[QTYPE_VEIL]._qactive == 2 && !quests[QTYPE_VEIL]._qvar1) { |
|
|
|
|
if (currlevel == quests[QTYPE_VEIL]._qlevel + 1 && quests[QTYPE_VEIL]._qactive == 2 && !quests[QTYPE_VEIL]._qvar1) { |
|
|
|
|
quests[QTYPE_VEIL]._qvar1 = 1; |
|
|
|
|
SpawnQuestItem(15, 0, 0, 5, 1); |
|
|
|
|
} |
|
|
|
|
@ -748,8 +675,8 @@ void ResyncQuests()
|
|
|
|
|
ObjChangeMapResync(1, 18, 20, 24); |
|
|
|
|
if (quests[QTYPE_VB]._qvar1 >= 7u) |
|
|
|
|
InitVPTriggers(); |
|
|
|
|
for (k = 0; k < nobjects; ++k) |
|
|
|
|
SyncObjectAnim(objectactive[k]); |
|
|
|
|
for (i = 0; i < nobjects; i++) |
|
|
|
|
SyncObjectAnim(objectactive[i]); |
|
|
|
|
} |
|
|
|
|
if (currlevel == quests[QTYPE_VB]._qlevel |
|
|
|
|
&& !setlevel |
|
|
|
|
@ -840,29 +767,28 @@ void PrintQLString(int x, int y, unsigned char cjustflag, char *str, int col)
|
|
|
|
|
|
|
|
|
|
void DrawQuestLog() |
|
|
|
|
{ |
|
|
|
|
int v0; // edi
|
|
|
|
|
int i; // esi
|
|
|
|
|
int y, i; |
|
|
|
|
|
|
|
|
|
PrintQLString(0, 2, 1u, "Quest Log", 3); |
|
|
|
|
CelDecodeOnly(64, 511, (BYTE *)pQLogCel, 1, 320); |
|
|
|
|
v0 = qtopline; |
|
|
|
|
for (i = 0; i < numqlines; ++i) { |
|
|
|
|
PrintQLString(0, v0, 1u, questlist[qlist[i]]._qlstr, 0); |
|
|
|
|
v0 += 2; |
|
|
|
|
CelDecodeOnly(64, 511, pQLogCel, 1, 320); |
|
|
|
|
y = qtopline; |
|
|
|
|
for (i = 0; i < numqlines; i++) { |
|
|
|
|
PrintQLString(0, y, 1, questlist[qlist[i]]._qlstr, 0); |
|
|
|
|
y += 2; |
|
|
|
|
} |
|
|
|
|
PrintQLString(0, 22, 1u, "Close Quest Log", 0); |
|
|
|
|
PrintQLString(0, 22, 1, "Close Quest Log", 0); |
|
|
|
|
ALLQUESTS = (ALLQUESTS & 7) + 1; |
|
|
|
|
} |
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void StartQuestlog() |
|
|
|
|
{ |
|
|
|
|
unsigned int i; |
|
|
|
|
DWORD i; |
|
|
|
|
|
|
|
|
|
numqlines = 0; |
|
|
|
|
for (i = 0; i < MAXQUESTS; i++) { |
|
|
|
|
if (quests[i]._qactive == 2 && quests[i]._qlog) { |
|
|
|
|
qlist[numqlines++] = i; |
|
|
|
|
qlist[numqlines] = i; |
|
|
|
|
numqlines++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (numqlines > 5) { |
|
|
|
|
@ -876,8 +802,6 @@ void StartQuestlog()
|
|
|
|
|
questlog = TRUE; |
|
|
|
|
ALLQUESTS = 1; |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void QuestlogUp() |
|
|
|
|
{ |
|
|
|
|
@ -892,8 +816,6 @@ void QuestlogUp()
|
|
|
|
|
PlaySFX(IS_TITLEMOV); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void QuestlogDown() |
|
|
|
|
{ |
|
|
|
|
@ -908,55 +830,41 @@ void QuestlogDown()
|
|
|
|
|
PlaySFX(IS_TITLEMOV); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void QuestlogEnter() |
|
|
|
|
{ |
|
|
|
|
PlaySFX(IS_TITLSLCT); |
|
|
|
|
if (numqlines && qline != 22) |
|
|
|
|
InitQTextMsg((unsigned char)quests[qlist[(qline - qtopline) >> 1]]._qmsg); |
|
|
|
|
InitQTextMsg(quests[qlist[(qline - qtopline) >> 1]]._qmsg); |
|
|
|
|
questlog = FALSE; |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void QuestlogESC() |
|
|
|
|
{ |
|
|
|
|
int v0; // esi
|
|
|
|
|
int i; // edi
|
|
|
|
|
int y, i; |
|
|
|
|
|
|
|
|
|
v0 = (MouseY - 32) / 12; |
|
|
|
|
y = (MouseY - 32) / 12; |
|
|
|
|
if (numqlines) { |
|
|
|
|
for (i = 0; i < numqlines; ++i) { |
|
|
|
|
if (v0 == qtopline + 2 * i) { |
|
|
|
|
qline = v0; |
|
|
|
|
for (i = 0; i < numqlines; i++) { |
|
|
|
|
if (y == qtopline + 2 * i) { |
|
|
|
|
qline = y; |
|
|
|
|
QuestlogEnter(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (v0 == 22) { |
|
|
|
|
if (y == 22) { |
|
|
|
|
qline = 22; |
|
|
|
|
QuestlogEnter(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 69BE90: using guessed type int qline;
|
|
|
|
|
// 69BED4: using guessed type int numqlines;
|
|
|
|
|
|
|
|
|
|
void SetMultiQuest(int q, int s, int l, int v1) |
|
|
|
|
{ |
|
|
|
|
int v4; // eax
|
|
|
|
|
unsigned char *v5; // ecx
|
|
|
|
|
unsigned char *v6; // eax
|
|
|
|
|
|
|
|
|
|
v4 = q; |
|
|
|
|
v5 = &quests[q]._qactive; |
|
|
|
|
if (*v5 != 3) { |
|
|
|
|
if (s > (unsigned char)*v5) |
|
|
|
|
*v5 = s; |
|
|
|
|
quests[v4]._qlog |= l; |
|
|
|
|
v6 = &quests[v4]._qvar1; |
|
|
|
|
if (v1 > (unsigned char)*v6) |
|
|
|
|
*v6 = v1; |
|
|
|
|
if (quests[q]._qactive != 3) { |
|
|
|
|
if (s > quests[q]._qactive) |
|
|
|
|
quests[q]._qactive = s; |
|
|
|
|
quests[q]._qlog |= l; |
|
|
|
|
if (v1 > quests[q]._qvar1) |
|
|
|
|
quests[q]._qvar1 = v1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|