1
0
Fork 0

Add files via upload

pull/1/head
galaxyhaxz 2018-06-06 21:27:39 -05:00 committed by GitHub
parent dde68ff89e
commit bcb3abe96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 29570 additions and 0 deletions

1380
Source/quests.cpp Normal file

File diff suppressed because it is too large Load Diff

61
Source/quests.h Normal file
View File

@ -0,0 +1,61 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//quests
extern int qtopline; // idb
extern int questlog; // weak
extern void *pQLogCel;
extern QuestStruct quests[16];
extern int qline; // weak
extern int qlist[16];
extern int numqlines; // weak
extern int WaterDone; // idb
extern int ReturnLvlY; // idb
extern int ReturnLvlX; // idb
extern int ReturnLvlT; // idb
extern int ALLQUESTS; // idb
extern int ReturnLvl; // idb
void __cdecl InitQuests();
void __cdecl CheckQuests();
bool __cdecl ForceQuests();
bool __fastcall QuestStatus(int i);
void __fastcall CheckQuestKill(int m, unsigned char sendmsg);
void __cdecl DrawButcher();
void __fastcall DrawSkelKing(int quest_id, int xx, int yy);
void __fastcall DrawWarLord(int xx, int yy);
void __fastcall DrawSChamber(int quest_id, int xx, int yy);
void __fastcall DrawLTBanner(int xx, int yy);
void __fastcall DrawBlind(int xx, int yy);
void __fastcall DrawBlood(int xx, int yy);
void __fastcall DRLG_CheckQuests(int xx, int yy);
void __cdecl SetReturnLvlPos();
void __cdecl GetReturnLvlPos();
void __cdecl ResyncMPQuests();
void __cdecl ResyncQuests();
void __fastcall PrintQLString(int x, int y, unsigned char cjustflag, char *str, int col);
void __cdecl DrawQuestLog();
void __cdecl StartQuestlog();
void __cdecl QuestlogUp();
void __cdecl QuestlogDown();
void __cdecl QuestlogEnter();
void __cdecl QuestlogESC();
void __fastcall SetMultiQuest(int q, int s, unsigned char l, int v1);
/* rdata */
extern QuestData questlist[16];
extern char questxoff[7];
extern char questyoff[7];
extern char *questtrigstr[5];
extern int QuestGroup1[3];
extern int QuestGroup2[3];
extern int QuestGroup3[3];
extern int QuestGroup4[2];

85
Source/restrict.cpp Normal file
View File

@ -0,0 +1,85 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
//----- (00452831) --------------------------------------------------------
bool __cdecl SystemSupported()
{
bool v0; // di
struct _OSVERSIONINFOA VersionInformation; // [esp+4h] [ebp-94h]
v0 = 0;
memset(&VersionInformation, 0, 0x94u);
VersionInformation.dwOSVersionInfoSize = 148;
if ( GetVersionExA(&VersionInformation)
&& VersionInformation.dwPlatformId == 2
&& VersionInformation.dwMajorVersion >= 5 )
{
v0 = 1;
}
return v0;
}
//----- (00452885) --------------------------------------------------------
bool __cdecl RestrictedTest()
{
bool v0; // si
FILE *v2; // eax
char Buffer[260]; // [esp+4h] [ebp-104h]
v0 = 0;
if ( SystemSupported() && GetWindowsDirectoryA(Buffer, 0x104u) )
{
strcat(Buffer, "\\Diablo1RestrictedTest.foo");
v2 = fopen(Buffer, "wt");
if ( v2 )
{
fclose(v2);
remove(Buffer);
}
else
{
v0 = 1;
}
}
return v0;
}
//----- (004528F7) --------------------------------------------------------
bool __cdecl ReadOnlyTest()
{
bool v0; // si
char *v1; // eax
FILE *v2; // eax
char Filename[260]; // [esp+4h] [ebp-104h]
v0 = 0;
if ( GetModuleFileNameA(ghInst, Filename, 0x104u) )
{
v1 = strrchr(Filename, '\\');
if ( v1 )
{
strcpy(v1 + 1, "Diablo1ReadOnlyTest.foo");
v2 = fopen(Filename, "wt");
if ( v2 )
{
fclose(v2);
remove(Filename);
}
else
{
v0 = 1;
}
}
}
return v0;
}

14
Source/restrict.h Normal file
View File

@ -0,0 +1,14 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
bool __cdecl SystemSupported();
bool __cdecl RestrictedTest();
bool __cdecl ReadOnlyTest();

3432
Source/scrollrt.cpp Normal file

File diff suppressed because it is too large Load Diff

80
Source/scrollrt.h Normal file
View File

@ -0,0 +1,80 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//scrollrt
extern int light_table_index; // weak
extern int screen_y_times_768[1024];
extern int scrollrt_cpp_init_value; // weak
extern unsigned int sgdwCursWdtOld; // idb
extern int sgdwCursX; // idb
extern int sgdwCursY; // idb
extern int screen_buf_end; // weak
extern int sgdwCursHgt;
extern int level_cel_block; // weak
extern int sgdwCursXOld; // idb
extern int sgdwCursYOld; // idb
extern char arch_draw_type; // weak
extern DDSURFACEDESC DDS_desc;
extern int cel_transparency_active; // weak
extern int level_piece_id; // weak
extern int sgdwCursWdt;
extern int (__fastcall *DrawPlrProc)(int player_num, int x, int y, int screen_x, int screen_y, void *cl2_buf, int frame, int frame_width, int a9, int a10);
extern char cursor_draw_back_buffer[8192];
extern int draw_monster_num; // weak
extern int sgdwCursHgtOld; // idb
void __cdecl scrollrt_cpp_init();
void __cdecl ClearCursor();
void __fastcall DrawMissile(int x, int y, int sx, int sy, int a5, int a6, int del_flag);
void __fastcall DrawClippedMissile(int x, int y, int sx, int sy, int a5, int a6, int a7);
void __fastcall DrawDeadPlayer(int x, int y, int sx, int sy, int a5, int a6, bool clipped);
void __fastcall DrawPlayer(int pnum, int x, int y, int px, int py, int animdata, int animframe, int animwidth, int a9, int a10);
void __fastcall DrawClippedPlayer(int pnum, int x, int y, int px, int py, int animdata, int animframe, int animwidth, int a9, int a10);
void __fastcall DrawView(int StartX, int StartY);
void __fastcall DrawGame(int x, int y);
void __fastcall scrollrt_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag);
void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4, int a5, int a6);
void __fastcall DrawClippedMonster(int x, int y, int a3, int a4, int mon_id, int a6, int a7);
void __fastcall DrawClippedObject(int x, int y, int a3, int a4, int pre_flag, int a6, int dir);
void __fastcall scrollrt_draw_clipped_e_flag(char *buffer, int x, int y, int a4, int a5);
void __fastcall scrollrt_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int a4, int a5, int sx, int sy, int me_flag);
void __fastcall scrollrt_draw_clipped_e_flag_2(char *buffer, int x, int y, int a4, signed int a5, int sx, int sy);
void __fastcall scrollrt_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5, int sx, int sy, int me_flag);
void __fastcall DrawMonster(int x, int y, int a3, int a4, int mon_id, int a6, int a7);
void __fastcall DrawObject(int x, int y, int a3, int a4, int pre_flag, int a6, int dir);
void __fastcall scrollrt_draw_e_flag(char *buffer, int x, int y, int a4, int a5, int sx, int sy);
void __fastcall DrawZoom(int x, int y);
void __cdecl ClearScreenBuffer();
#ifdef _DEBUG
void __cdecl ScrollView();
void __cdecl EnableFrameCount();
#endif
void __fastcall scrollrt_draw_game_screen(bool draw_cursor);
void __cdecl scrollrt_draw_cursor_back_buffer();
void __cdecl scrollrt_draw_cursor_item();
void __fastcall DrawMain(int dwHgt, int draw_desc, int draw_hp, int draw_mana, int draw_sbar, int draw_btn);
#ifdef _DEBUG
void __cdecl DrawFPS();
#endif
void __fastcall DoBlitScreen(int dwX, int dwY, int dwWdt, int dwHgt);
void __cdecl DrawAndBlit();
/* data */
extern int scrollrt_inf; // weak
/* rdata */
/* used in 1.00 debug */
extern char *szMonModeAssert[18];
extern char *szPlrModeAssert[12];

223
Source/setmaps.cpp Normal file
View File

@ -0,0 +1,223 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
RECT8 QSRects[32] =
{
{ { 19u, 47u }, { 26u, 55u } },
{ { 26u, 49u }, { 30u, 53u } },
{ { 33u, 19u }, { 47u, 29u } },
{ { 37u, 29u }, { 43u, 39u } },
{ { 27u, 53u }, { 35u, 61u } },
{ { 27u, 35u }, { 34u, 42u } },
{ { 45u, 35u }, { 53u, 43u } },
{ { 45u, 53u }, { 53u, 61u } },
{ { 31u, 39u }, { 49u, 57u } },
{ { 49u, 45u }, { 58u, 51u } },
{ { 57u, 31u }, { 62u, 37u } },
{ { 63u, 31u }, { 69u, 40u } },
{ { 59u, 41u }, { 73u, 55u } },
{ { 63u, 55u }, { 69u, 65u } },
{ { 73u, 45u }, { 78u, 51u } },
{ { 79u, 43u }, { 89u, 53u } },
{ { 43u, 19u }, { 50u, 26u } },
{ { 51u, 19u }, { 59u, 26u } },
{ { 35u, 27u }, { 42u, 34u } },
{ { 43u, 27u }, { 49u, 34u } },
{ { 50u, 27u }, { 59u, 34u } },
{ { 19u, 31u }, { 34u, 47u } },
{ { 34u, 35u }, { 42u, 42u } },
{ { 43u, 35u }, { 50u, 42u } },
{ { 51u, 35u }, { 62u, 42u } },
{ { 63u, 31u }, { 66u, 46u } },
{ { 67u, 31u }, { 78u, 34u } },
{ { 67u, 35u }, { 78u, 42u } },
{ { 67u, 43u }, { 78u, 46u } },
{ { 35u, 43u }, { 42u, 51u } },
{ { 43u, 43u }, { 49u, 51u } },
{ { 50u, 43u }, { 59u, 51u } }
};
char *quest_level_names[] =
{
&empty_string,
"Skeleton King's Lair",
"Bone Chamber",
"Maze",
"Poisoned Water Supply",
"Archbishop Lazarus' Lair"
};
//----- (00456625) --------------------------------------------------------
int __fastcall ObjIndex(int x, int y)
{
int i; // edi
int oi; // esi
i = 0;
if ( nobjects > 0 )
{
while ( 1 )
{
oi = objectactive[i];
if ( object[oi]._ox == x && object[oi]._oy == y )
return oi;
if ( ++i >= nobjects )
break;
}
}
TermMsg("ObjIndex: Active object not found at (%d,%d)", x, y);
return -1;
}
//----- (0045666B) --------------------------------------------------------
void __cdecl AddSKingObjs()
{
SetObjMapRange(ObjIndex(64, 34), 20, 7, 23, 10, 1);
SetObjMapRange(ObjIndex(64, 59), 20, 14, 21, 16, 2);
SetObjMapRange(ObjIndex(27, 37), 8, 1, 15, 11, 3);
SetObjMapRange(ObjIndex(46, 35), 8, 1, 15, 11, 3);
SetObjMapRange(ObjIndex(49, 53), 8, 1, 15, 11, 3);
SetObjMapRange(ObjIndex(27, 53), 8, 1, 15, 11, 3);
}
//----- (0045671A) --------------------------------------------------------
void __cdecl AddSChamObjs()
{
SetObjMapRange(ObjIndex(37, 30), 17, 0, 21, 5, 1);
SetObjMapRange(ObjIndex(37, 46), 13, 0, 16, 5, 2);
}
//----- (00456755) --------------------------------------------------------
void __cdecl AddVileObjs()
{
SetObjMapRange(ObjIndex(26, 45), 1, 1, 9, 10, 1);
SetObjMapRange(ObjIndex(45, 46), 11, 1, 20, 10, 2);
SetObjMapRange(ObjIndex(35, 36), 7, 11, 13, 18, 3);
}
//----- (004567AD) --------------------------------------------------------
void __fastcall DRLG_SetMapTrans(char *sFileName)
{
unsigned char *pLevelMap; // ecx
int v2; // ebx
int v3; // edi
int v4; // eax
int v5; // edi
int v6; // eax
int v7; // ebx
char *v8; // esi
char *v9; // eax
int v10; // [esp+Ch] [ebp-8h]
int v11; // [esp+10h] [ebp-4h]
pLevelMap = LoadFileInMem(sFileName, 0);
v11 = 0;
v2 = *pLevelMap;
v3 = pLevelMap[2];
v4 = v3;
v5 = 2 * v3;
v6 = v2 * v4;
v7 = 2 * v2;
v8 = (char *)&pLevelMap[6 * v7 * v5 + 4 + 2 * v6];
if ( v5 > 0 )
{
do
{
if ( v7 > 0 )
{
v10 = v7;
v9 = &dung_map[16][v11 + 16];
do
{
*v9 = *v8;
v8 += 2;
v9 += 112;
--v10;
}
while ( v10 );
}
++v11;
}
while ( v11 < v5 );
}
mem_free_dbg(pLevelMap);
}
//----- (00456819) --------------------------------------------------------
void __cdecl LoadSetMap()
{
switch ( setlvlnum )
{
case SL_SKELKING:
if ( quests[12]._qactive == 1 )
{
quests[12]._qactive = 2;
quests[12]._qvar1 = 1;
}
LoadPreL1Dungeon("Levels\\L1Data\\SklKng1.DUN", 83, 45);
LoadL1Dungeon("Levels\\L1Data\\SklKng2.DUN", 83, 45);
LoadPalette("Levels\\L1Data\\L1_2.pal");
DRLG_AreaTrans(2, (unsigned char *)QSRects);
DRLG_ListTrans(2, (unsigned char *)&QSRects[2]);
DRLG_AreaTrans(5, (unsigned char *)&QSRects[4]);
DRLG_ListTrans(7, (unsigned char *)&QSRects[9]);
AddL1Objs(0, 0, 112, 112);
AddSKingObjs();
InitSKingTriggers();
break;
case SL_BONECHAMB:
LoadPreL2Dungeon("Levels\\L2Data\\Bonecha2.DUN", 69, 39);
LoadL2Dungeon("Levels\\L2Data\\Bonecha1.DUN", 69, 39);
LoadPalette("Levels\\L2Data\\L2_2.pal");
DRLG_ListTrans(5, (unsigned char *)&QSRects[16]);
DRLG_AreaTrans(2, (unsigned char *)&QSRects[21]);
DRLG_ListTrans(9, (unsigned char *)&QSRects[23]);
AddL2Objs(0, 0, 112, 112);
AddSChamObjs();
InitSChambTriggers();
break;
case SL_MAZE:
LoadPreL1Dungeon("Levels\\L1Data\\Lv1MazeA.DUN", 20, 50);
LoadL1Dungeon("Levels\\L1Data\\Lv1MazeB.DUN", 20, 50);
LoadPalette("Levels\\L1Data\\L1_5.pal");
AddL1Objs(0, 0, 112, 112);
DRLG_SetMapTrans("Levels\\L1Data\\Lv1MazeA.DUN");
break;
case SL_POISONWATER:
if ( quests[13]._qactive == 1 )
quests[13]._qactive = 2;
LoadPreL3Dungeon("Levels\\L3Data\\Foulwatr.DUN", 19, 50);
LoadL3Dungeon("Levels\\L3Data\\Foulwatr.DUN", 20, 50);
LoadPalette("Levels\\L3Data\\L3pfoul.pal");
InitPWaterTriggers();
break;
case SL_VILEBETRAYER:
if ( quests[15]._qactive == 3 )
{
quests[15]._qvar2 = 4;
}
else if ( quests[15]._qactive == 2 )
{
quests[15]._qvar2 = 3;
}
LoadPreL1Dungeon("Levels\\L1Data\\Vile1.DUN", 35, 36);
LoadL1Dungeon("Levels\\L1Data\\Vile2.DUN", 35, 36);
LoadPalette("Levels\\L1Data\\L1_2.pal");
AddL1Objs(0, 0, 112, 112);
AddVileObjs();
DRLG_SetMapTrans("Levels\\L1Data\\Vile1.DUN");
InitNoTriggers();
break;
}
}
// 5CCB10: using guessed type char setlvlnum;

21
Source/setmaps.h Normal file
View File

@ -0,0 +1,21 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
int __fastcall ObjIndex(int x, int y);
void __cdecl AddSKingObjs();
void __cdecl AddSChamObjs();
void __cdecl AddVileObjs();
void __fastcall DRLG_SetMapTrans(char *sFileName);
void __cdecl LoadSetMap();
/* rdata */
extern RECT8 QSRects[32];
extern char *quest_level_names[];

167
Source/sha.cpp Normal file
View File

@ -0,0 +1,167 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
SHA1Context sgSHA1[3];
//----- (00456A16) --------------------------------------------------------
void __cdecl SHA1Clear()
{
memset(sgSHA1, 0, 0x114u);
}
//----- (00456A2B) --------------------------------------------------------
void __fastcall SHA1Result(int n, char Message_Digest[SHA1HashSize])
{
char *v2; // eax
SHA1Context *v3; // ecx
signed int i; // edx
int v5; // esi
v2 = Message_Digest;
if ( Message_Digest )
{
v3 = &sgSHA1[n];
i = 5;
do
{
v5 = v3->state[0];
v3 = (SHA1Context *)((char *)v3 + 4);
*(_DWORD *)v2 = v5;
v2 += 4;
--i;
}
while ( i );
}
}
//----- (00456A4D) --------------------------------------------------------
void __fastcall SHA1Calculate(int n, const char *data, char Message_Digest[SHA1HashSize])
{
int v3; // esi
v3 = n;
SHA1Input(&sgSHA1[n], data, 64);
if ( Message_Digest )
SHA1Result(v3, (char *)Message_Digest);
}
//----- (00456A73) --------------------------------------------------------
void __fastcall SHA1Input(SHA1Context *context, const char *message_array, int len)
{
SHA1Context *v3; // esi
const char *v4; // ebx
int v5; // ecx
int v6; // edx
unsigned int v7; // ebp
v3 = context;
v4 = message_array;
v5 = context->count[0];
v6 = v5 + 8 * len;
if ( v6 < v5 )
++v3->count[1];
v3->count[0] = v6;
v3->count[1] += len >> 29;
if ( len >= 64 )
{
v7 = (unsigned int)len >> 6;
do
{
memcpy(v3->buffer, v4, 0x40u);
SHA1ProcessMessageBlock(v3);
v4 += 64;
--v7;
}
while ( v7 );
}
}
//----- (00456AC4) --------------------------------------------------------
void __fastcall SHA1ProcessMessageBlock(SHA1Context *context)
{
int i; // [esp+158h] [ebp-4h]
int temp; // esi
int W[80]; // [esp+Ch] [ebp-150h]
int A, B, C, D, E; // [esp+150h] [ebp-Ch]
qmemcpy(W, context->buffer, 0x40u);
for(i = 0; i < 64; i++)
{
W[i+16] = W[i] ^ W[i+2] ^ W[i+8] ^ W[i+13];
}
A = context->state[0];
B = context->state[1];
C = context->state[2];
D = context->state[3];
E = context->state[4];
for(i = 0; i < 20; i++)
{
temp = SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[i] + 0x5A827999;
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(i = 20; i < 40; i++)
{
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1;
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(i = 40; i < 60; i++)
{
temp = SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC;
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(i = 60; i < 80; i++)
{
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6;
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
context->state[0] += A;
context->state[1] += B;
context->state[2] += C;
context->state[3] += D;
context->state[4] += E;
}
//----- (00456C82) --------------------------------------------------------
void __fastcall SHA1Reset(int n)
{
sgSHA1[n].count[0] = 0;
sgSHA1[n].count[1] = 0;
sgSHA1[n].state[0] = 0x67452301;
sgSHA1[n].state[1] = 0xEFCDAB89;
sgSHA1[n].state[2] = 0x98BADCFE;
sgSHA1[n].state[3] = 0x10325476;
sgSHA1[n].state[4] = 0xC3D2E1F0;
}

27
Source/sha.h Normal file
View File

@ -0,0 +1,27 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
/*
* Define the SHA1 circular left shift macro
*/
#define SHA1CircularShift(bits,word) \
(((word) << (bits)) | ((word) >> (32-(bits))))
#define SHA1HashSize 20
//sha
extern SHA1Context sgSHA1[3];
void __cdecl SHA1Clear();
void __fastcall SHA1Result(int n, char Message_Digest[SHA1HashSize]);
void __fastcall SHA1Calculate(int n, const char *data, char Message_Digest[SHA1HashSize]);
void __fastcall SHA1Input(SHA1Context *context, const char *message_array, int len);
void __fastcall SHA1ProcessMessageBlock(SHA1Context *context);
void __fastcall SHA1Reset(int n);

563
Source/sound.cpp Normal file
View File

@ -0,0 +1,563 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
float sound_cpp_init_value;
IDirectSoundBuffer *DSBs[8];
IDirectSound *sglpDS;
char gbSndInited;
int sglMusicVolume;
int sglSoundVolume;
HMODULE hDsound_dll; // idb
void *sgpMusicTrack;
IDirectSoundBuffer *sglpDSB;
int sound_inf = 0x7F800000; // weak
/* rdata */
char gbMusicOn = 1; // weak
char gbSoundOn = 1; // weak
char gbDupSounds = 1; // weak
int sgnMusicTrack = 6;
char *sgszMusicTracks[6] =
{
"Music\\DTowne.wav",
"Music\\DLvlA.wav",
"Music\\DLvlB.wav",
"Music\\DLvlC.wav",
"Music\\DLvlD.wav",
"Music\\Dintro.wav"
};
RECT8 QSRect[2] = { { { 15u, 240u }, { 15u, 240u } }, { { 30u, 225u }, { 30u, 225u } } }; /* psx version? */
//----- (00456CC0) --------------------------------------------------------
struct sound_cpp_init
{
sound_cpp_init()
{
sound_cpp_init_value = sound_inf;
}
} _sound_cpp_init;
// 47F24C: using guessed type int sound_inf;
//----- (00456CCB) --------------------------------------------------------
void __fastcall snd_update(bool bStopAll)
{
BOOL v1; // edi
unsigned int v2; // esi
IDirectSoundBuffer *v3; // eax
unsigned long v4; // [esp+8h] [ebp-4h]
v1 = bStopAll;
v2 = 0;
do
{
v3 = DSBs[v2];
if ( v3 && (v1 || IDirectSoundBuffer_GetStatus(v3, &v4) || v4 != DSBSTATUS_PLAYING) ) // FIX_ME: double check
{
IDirectSoundBuffer_Stop(DSBs[v2]);
IDirectSoundBuffer_Release(DSBs[v2]);
DSBs[v2] = 0;
}
++v2;
}
while ( v2 < 8 );
}
//----- (00456D22) --------------------------------------------------------
void __fastcall snd_stop_snd(TSnd *pSnd)
{
IDirectSoundBuffer *v1; // eax
if ( pSnd )
{
v1 = pSnd->DSB;
if ( v1 )
IDirectSoundBuffer_Stop(v1);
}
}
//----- (00456D34) --------------------------------------------------------
bool __fastcall snd_playing(TSnd *pSnd)
{
IDirectSoundBuffer *v1; // eax
bool result; // al
unsigned long v3; // [esp+0h] [ebp-4h]
v3 = (unsigned long)pSnd;
if ( pSnd
&& (v1 = pSnd->DSB) != 0
&& !IDirectSoundBuffer_GetStatus(v1, &v3) )
{
result = v3 == DSBSTATUS_PLAYING;
}
else
{
result = 0;
}
return result;
}
//----- (00456D60) --------------------------------------------------------
void __fastcall snd_play_snd(TSnd *pSnd, int lVolume, int lPan)
{
TSnd *v3; // edi
int v4; // ebp
IDirectSoundBuffer *v5; // esi
//int v6; // eax
int v7; // ebp
int v8; // eax
//int v9; // eax
DWORD v10; // [esp+30h] [ebp-4h]
v3 = pSnd;
v4 = lVolume;
if ( pSnd )
{
if ( gbSoundOn )
{
v5 = pSnd->DSB;
if ( v5 )
{
v10 = GetTickCount();
if ( v10 - v3->start_tc >= 0x50 )
{
//_LOBYTE(v6) = snd_playing(v3);
if ( !snd_playing(v3) || (v5 = sound_dup_channel(v3->DSB)) != 0 )
{
v7 = sglSoundVolume + v4;
if ( v7 >= -1600 )
{
if ( v7 > 0 )
v7 = 0;
}
else
{
v7 = -1600;
}
IDirectSoundBuffer_SetVolume(v5, v7);
IDirectSoundBuffer_SetPan(v5, lPan);
v8 = IDirectSoundBuffer_Play(
v5,
0,
0,
0);
if ( v8 == DSERR_BUFFERLOST )
{
//_LOBYTE(v9) = sound_file_reload(v3, v5);
if ( sound_file_reload(v3, v5) )
IDirectSoundBuffer_Play(
v5,
0,
0,
0);
}
else if ( v8 )
{
DSErrDlg(v8, 261, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
}
v3->start_tc = v10;
}
}
else
{
GetTickCount();
}
}
}
}
}
// 4A22D5: using guessed type char gbSoundOn;
//----- (00456E39) --------------------------------------------------------
IDirectSoundBuffer *__fastcall sound_dup_channel(IDirectSoundBuffer *DSB)
{
IDirectSoundBuffer *result; // eax
IDirectSoundBuffer **v2; // esi
result = 0;
if ( gbDupSounds )
{
while ( DSBs[(_DWORD)result] )
{
result = (IDirectSoundBuffer *)((char *)result + 1); // result++
if ( (unsigned int)result >= 8 )
return 0;
}
v2 = &DSBs[(_DWORD)result];
if ( IDirectSound_DuplicateSoundBuffer(
sglpDS,
DSB,
&DSBs[(_DWORD)result]) )
{
return 0;
}
result = *v2;
}
return result;
}
// 4A22D6: using guessed type char gbDupSounds;
//----- (00456E74) --------------------------------------------------------
bool __fastcall sound_file_reload(TSnd *sound_file, IDirectSoundBuffer *DSB)
{
IDirectSoundBuffer *v2; // edi
TSnd *v3; // esi
char *v5; // ecx
void *aptr2; // [esp+8h] [ebp-18h]
unsigned long asize2; // [esp+Ch] [ebp-14h]
bool v8; // [esp+10h] [ebp-10h]
void *aptr1; // [esp+14h] [ebp-Ch]
unsigned long asize1; // [esp+18h] [ebp-8h]
void *a1; // [esp+1Ch] [ebp-4h]
v2 = DSB;
v3 = sound_file;
if ( IDirectSoundBuffer_Restore(DSB) )
return 0;
v5 = v3->sound_path;
v8 = 0;
WOpenFile(v5, &a1, 0);
WSetFilePointer(a1, v3->offset, 0, 0);
if ( !IDirectSoundBuffer_Lock(
v2,
0,
v3->len,
&aptr1,
&asize1,
&aptr2,
&asize2,
0) )
{
WReadFile(a1, (char *)aptr1, asize1);
if ( !IDirectSoundBuffer_Unlock(v2, aptr1, asize1, aptr2, asize2) )
v8 = 1;
}
WCloseFile(a1);
return v8;
}
//----- (00456F07) --------------------------------------------------------
TSnd *__fastcall sound_file_load(char *path)
{
// int v1; // esi
char *v2; // edi
TSnd *v4; // esi
int v5; // eax
int v6; // eax
// int v7; // [esp-4h] [ebp-24h]
void *aptr2; // [esp+8h] [ebp-18h]
unsigned long asize2; // [esp+Ch] [ebp-14h]
void *a1; // [esp+10h] [ebp-10h]
void *ptr; // [esp+14h] [ebp-Ch]
void *aptr1; // [esp+18h] [ebp-8h]
unsigned long asize1; // [esp+1Ch] [ebp-4h]
v2 = path;
if ( !sglpDS )
return 0;
// v7 = v1;
WOpenFile(path, &a1, 0);
v4 = (TSnd *)DiabloAllocPtr(40);
memset(v4, 0, 0x28u);
v4->sound_path = v2;
v4->start_tc = GetTickCount() - 81;
ptr = LoadWaveFile(a1, &v4->fmt, &v4->len);
if ( !ptr )
TermMsg("Invalid sound format on file %s", v4->sound_path);
sound_CreateSoundBuffer(v4);
v5 = IDirectSoundBuffer_Lock(
v4->DSB,
0,
v4->len,
&aptr1,
&asize1,
&aptr2,
&asize2,
0);
//v7);
if ( v5 )
DSErrDlg(v5, 318, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
memcpy(aptr1, (char *)ptr + v4->offset, asize1);
v6 = IDirectSoundBuffer_Unlock(v4->DSB, aptr1, asize1, aptr2, asize2);
if ( v6 )
DSErrDlg(v6, 325, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
mem_free_dbg(ptr);
WCloseFile(a1);
return v4;
}
// 456F07: could not find valid save-restore pair for esi
//----- (00457003) --------------------------------------------------------
void __fastcall sound_CreateSoundBuffer(TSnd *sound_file)
{
TSnd *v1; // esi
int v2; // eax
DSBUFFERDESC v3; // [esp+4h] [ebp-14h]
v1 = sound_file;
memset(&v3, 0, 0x14u);
v3.dwBufferBytes = v1->len;
v3.lpwfxFormat = &v1->fmt;
v3.dwSize = 20;
v3.dwFlags = DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN|DSBCAPS_STATIC;
v2 = IDirectSound_CreateSoundBuffer(
sglpDS,
&v3,
&v1->DSB,
NULL);
if ( v2 )
DSErrDlg(v2, 282, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
}
//----- (00457060) --------------------------------------------------------
void __fastcall sound_file_cleanup(TSnd *sound_file)
{
TSnd *v1; // esi
IDirectSoundBuffer *v2; // eax
v1 = sound_file;
if ( sound_file )
{
v2 = sound_file->DSB;
if ( v2 )
{
IDirectSoundBuffer_Stop(sound_file->DSB);
IDirectSoundBuffer_Release(v1->DSB);
v1->DSB = 0;
}
mem_free_dbg(v1);
}
}
//----- (0045708B) --------------------------------------------------------
void __fastcall snd_init(HWND hWnd)
{
sound_load_volume("Sound Volume", &sglSoundVolume);
gbSoundOn = sglSoundVolume > -1600;
sound_load_volume("Music Volume", &sglMusicVolume);
gbMusicOn = sglMusicVolume > -1600;
if ( sound_DirectSoundCreate(NULL, &sglpDS, NULL) )
sglpDS = 0;
if ( sglpDS && !IDirectSound_SetCooperativeLevel(sglpDS, hWnd, DSSCL_EXCLUSIVE) )
sound_create_primary_buffer(0);
SVidInitialize(sglpDS);
SFileDdaInitialize(sglpDS);
gbSndInited = sglpDS != 0;
}
// 4A22D4: using guessed type char gbMusicOn;
// 4A22D5: using guessed type char gbSoundOn;
//----- (0045712B) --------------------------------------------------------
void __fastcall sound_load_volume(char *value_name, int *value)
{
int *v2; // esi
//int v3; // eax
int v4; // ecx
int valuea; // [esp+8h] [ebp-4h]
v2 = value;
valuea = *value;
//_LOBYTE(v3) = SRegLoadValue("Diablo", value_name, 0, &valuea);
if ( SRegLoadValue("Diablo", value_name, 0, &valuea) )
v4 = valuea;
else
v4 = 0;
*v2 = v4;
if ( v4 >= -1600 )
{
if ( v4 > 0 )
*v2 = 0;
}
else
{
*v2 = -1600;
}
*v2 -= *v2 % 100;
}
//----- (0045717C) --------------------------------------------------------
void __fastcall sound_create_primary_buffer(int music_track)
{
int v1; // eax
int v2; // eax
DSCAPS v3; // [esp+4h] [ebp-8Ch]
DSBUFFERDESC v4; // [esp+64h] [ebp-2Ch]
int a1; // [esp+78h] [ebp-18h]
WAVEFORMATEX a2; // [esp+7Ch] [ebp-14h]
a1 = music_track;
if ( !music_track )
{
memset(&v4, 0, 0x14u);
v4.dwSize = 20;
v4.dwFlags = DSBCAPS_PRIMARYBUFFER;
v1 = IDirectSound_CreateSoundBuffer(
sglpDS,
&v4,
&sglpDSB,
NULL);
if ( v1 )
DSErrDlg(v1, 375, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
}
if ( sglpDSB )
{
v3.dwSize = 96;
v2 = IDirectSound_GetCaps(sglpDS, &v3);
if ( v2 )
DSErrDlg(v2, 383, "C:\\Src\\Diablo\\Source\\SOUND.CPP");
if ( !a1 || !LoadWaveFormat((HANDLE)a1, &a2) )
{
memset(&a2, 0, 0x12u);
a2.wFormatTag = WAVE_FORMAT_PCM;
a2.nSamplesPerSec = 22050;
a2.wBitsPerSample = 16;
a2.cbSize = 0;
}
a2.nChannels = 2;
a2.nBlockAlign = 2 * a2.wBitsPerSample / 8; // a2.nChannels * x / 8 (BUG_FIX: per MSDN)
a2.nAvgBytesPerSec = a2.nSamplesPerSec * a2.nBlockAlign;
IDirectSoundBuffer_SetFormat(sglpDSB, &a2);
}
}
// 69F100: using guessed type int sglpDSB;
//----- (0045727E) --------------------------------------------------------
int __fastcall sound_DirectSoundCreate(GUID *guid, IDirectSound **DS, int always_null)
{
IDirectSound **v3; // ebp
int v4; // eax
FARPROC v5; // ebx
int v6; // eax
GUID *v8; // [esp+10h] [ebp-4h]
v3 = DS;
v8 = guid;
if ( !hDsound_dll )
{
hDsound_dll = LoadLibraryA("dsound.dll");
if ( !hDsound_dll )
{
v4 = GetLastError();
TermDlg(108, v4, "C:\\Src\\Diablo\\Source\\SOUND.CPP", 422);
}
}
v5 = GetProcAddress(hDsound_dll, "DirectSoundCreate");
if ( !v5 )
{
v6 = GetLastError();
TermDlg(108, v6, "C:\\Src\\Diablo\\Source\\SOUND.CPP", 427);
}
return ((int (__stdcall *)(GUID *, IDirectSound **, int))v5)(v8, v3, always_null);
}
//----- (004572FF) --------------------------------------------------------
void __cdecl sound_cleanup()
{
snd_update(1);
SVidDestroy();
SFileDdaDestroy();
if ( sglpDS )
{
IDirectSound_Release(sglpDS);
sglpDS = 0;
}
if ( gbSndInited )
{
gbSndInited = 0;
sound_store_volume("Sound Volume", sglSoundVolume);
sound_store_volume("Music Volume", sglMusicVolume);
}
}
//----- (00457358) --------------------------------------------------------
void __fastcall sound_store_volume(char *key, int value)
{
SRegSaveValue("Diablo", key, 0, value);
}
//----- (00457367) --------------------------------------------------------
void __cdecl music_stop()
{
if ( sgpMusicTrack )
{
SFileDdaEnd(sgpMusicTrack);
SFileCloseFile(sgpMusicTrack);
sgpMusicTrack = 0;
sgnMusicTrack = 6;
}
}
//----- (00457393) --------------------------------------------------------
void __fastcall music_start(int nTrack)
{
//int v1; // esi
//int v2; // eax
//int v3; // edi
//v1 = nTrack;
music_stop();
if ( sglpDS && gbMusicOn )
{
//_LOBYTE(v2) = SFileOpenFile(sgszMusicTracks[v1], &sgpMusicTrack);
//v3 = v2;
sound_create_primary_buffer((int)sgpMusicTrack);
if ( SFileOpenFile(sgszMusicTracks[nTrack], &sgpMusicTrack) )
{
SFileDdaBeginEx(sgpMusicTrack, 0x40000, 0x40000, 0, sglMusicVolume, 0, 0);
sgnMusicTrack = nTrack;
}
else
{
sgpMusicTrack = 0;
}
}
}
// 4A22D4: using guessed type char gbMusicOn;
//----- (004573FE) --------------------------------------------------------
void __fastcall sound_disable_music(bool disable)
{
if ( disable )
{
music_stop();
}
else if ( sgnMusicTrack != 6 )
{
music_start(sgnMusicTrack);
}
}
//----- (00457418) --------------------------------------------------------
int __fastcall sound_get_or_set_music_volume(int volume)
{
if ( volume != 1 )
{
sglMusicVolume = volume;
if ( sgpMusicTrack )
SFileDdaSetVolume(sgpMusicTrack, volume, 0);
}
return sglMusicVolume;
}
//----- (0045743B) --------------------------------------------------------
int __fastcall sound_get_or_set_sound_volume(int volume)
{
int result; // eax
result = volume;
if ( volume == 1 )
return sglSoundVolume;
sglSoundVolume = volume;
return result;
}

56
Source/sound.h Normal file
View File

@ -0,0 +1,56 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//sound
extern float sound_cpp_init_value;
extern IDirectSoundBuffer *DSBs[8];
extern IDirectSound *sglpDS;
extern char gbSndInited;
extern int sglMusicVolume;
extern int sglSoundVolume;
extern HMODULE hDsound_dll; // idb
extern void *sgpMusicTrack;
extern IDirectSoundBuffer *sglpDSB;
void __cdecl sound_cpp_init();
void __fastcall snd_update(bool bStopAll);
void __fastcall snd_stop_snd(TSnd *pSnd);
bool __fastcall snd_playing(TSnd *pSnd);
void __fastcall snd_play_snd(TSnd *pSnd, int lVolume, int lPan);
IDirectSoundBuffer *__fastcall sound_dup_channel(IDirectSoundBuffer *DSB);
bool __fastcall sound_file_reload(TSnd *sound_file, IDirectSoundBuffer *DSB);
TSnd *__fastcall sound_file_load(char *path);
void __fastcall sound_CreateSoundBuffer(TSnd *sound_file);
void __fastcall sound_file_cleanup(TSnd *sound_file);
void __fastcall snd_init(HWND hWnd);
void __fastcall sound_load_volume(char *value_name, int *value);
void __fastcall sound_create_primary_buffer(int music_track);
int __fastcall sound_DirectSoundCreate(GUID *guid, IDirectSound **DS, int always_null);
void __cdecl sound_cleanup();
void __fastcall sound_store_volume(char *key, int value);
void __cdecl music_stop();
void __fastcall music_start(int nTrack);
void __fastcall sound_disable_music(bool disable);
int __fastcall sound_get_or_set_music_volume(int volume);
int __fastcall sound_get_or_set_sound_volume(int volume);
/* data */
extern int sound_inf; // weak
/* rdata */
extern char gbMusicOn; // weak
extern char gbSoundOn; // weak
extern char gbDupSounds; // weak
extern int sgnMusicTrack;
extern char *sgszMusicTracks[6];
extern RECT8 QSRect[2]; /* psx version? */

406
Source/spells.cpp Normal file
View File

@ -0,0 +1,406 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
SpellData spelldata[37] =
{
{ SPL_NULL, 0, STYPE_FIRE, NULL, NULL, 0, 0, 0, 0, 0, 0, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_FIREBOLT, 6, STYPE_FIRE, "Firebolt", "Firebolt", 1, 1, 1, 0, 15, IS_CAST2, { MIS_FIREBOLT, 0, 0 }, 1, 3, 40, 80, 1000, 50 },
{ SPL_HEAL, 5, STYPE_MAGIC, "Healing", NULL, 1, 1, 0, 1, 17, IS_CAST8, { MIS_HEAL, 0, 0 }, 3, 1, 20, 40, 1000, 50 },
{ SPL_LIGHTNING, 10, STYPE_LIGHTNING, "Lightning", NULL, 4, 3, 1, 0, 20, IS_CAST4, { MIS_LIGHTCTRL, 0, 0 }, 1, 6, 20, 60, 3000, 150 },
{ SPL_FLASH, 30, STYPE_LIGHTNING, "Flash", NULL, 5, 4, 0, 0, 33, IS_CAST4, { MIS_FLASH, MIS_FLASH2, 0 }, 2, 16, 20, 40, 7500, 500 },
{ SPL_IDENTIFY, 13, STYPE_MAGIC, "Identify", "Identify", -1, -1, 0, 1, 23, IS_CAST6, { MIS_IDENTIFY, 0, 0 }, 2, 1, 8, 12, 0, 100 },
{ SPL_FIREWALL, 28, STYPE_FIRE, "Fire Wall", NULL, 3, 2, 1, 0, 27, IS_CAST2, { MIS_FIREWALLC, 0, 0 }, 2, 16, 8, 16, 6000, 400 },
{ SPL_TOWN, 35, STYPE_MAGIC, "Town Portal", NULL, 3, 3, 1, 0, 20, IS_CAST6, { MIS_TOWN, 0, 0 }, 3, 18, 8, 12, 3000, 200 },
{ SPL_STONE, 60, STYPE_MAGIC, "Stone Curse", NULL, 6, 5, 1, 0, 51, IS_CAST2, { MIS_STONE, 0, 0 }, 3, 40, 8, 16, 12000, 800 },
{ SPL_INFRA, 40, STYPE_MAGIC, "Infravision", NULL, -1, -1, 0, 0, 36, IS_CAST8, { MIS_INFRA, 0, 0 }, 5, 20, 0, 0, 0, 600 },
{ SPL_RNDTELEPORT, 12, STYPE_MAGIC, "Phasing", NULL, 7, 6, 0, 0, 39, IS_CAST2, { MIS_RNDTELEPORT, 0, 0 }, 2, 4, 40, 80, 3500, 200 },
{ SPL_MANASHIELD, 33, STYPE_MAGIC, "Mana Shield", NULL, 6, 5, 0, 0, 25, IS_CAST2, { MIS_MANASHIELD, 0, 0 }, 0, 33, 4, 10, 16000, 1200 },
{ SPL_FIREBALL, 16, STYPE_FIRE, "Fireball", NULL, 8, 7, 1, 0, 48, IS_CAST2, { MIS_FIREBALL, 0, 0 }, 1, 10, 40, 80, 8000, 300 },
{ SPL_GUARDIAN, 50, STYPE_FIRE, "Guardian", NULL, 9, 8, 1, 0, 61, IS_CAST2, { MIS_GUARDIAN, 0, 0 }, 2, 30, 16, 32, 14000, 950 },
{ SPL_CHAIN, 30, STYPE_LIGHTNING, "Chain Lightning", NULL, 8, 7, 0, 0, 54, IS_CAST2, { MIS_CHAIN, 0, 0 }, 1, 18, 20, 60, 11000, 750 },
{ SPL_WAVE, 35, STYPE_FIRE, "Flame Wave", NULL, 9, 8, 1, 0, 54, IS_CAST2, { MIS_WAVE, 0, 0 }, 3, 20, 20, 40, 10000, 650 },
{ SPL_DOOMSERP, 0, STYPE_LIGHTNING, "Doom Serpents", NULL, -1, -1, 0, 0, 0, IS_CAST2, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_BLODRIT, 0, STYPE_MAGIC, "Blood Ritual", NULL, -1, -1, 0, 0, 0, IS_CAST2, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_NOVA, 60, STYPE_MAGIC, "Nova", NULL, -1, 10, 0, 0, 87, IS_CAST4, { MIS_NOVA, 0, 0 }, 3, 35, 16, 32, 21000, 1300 },
{ SPL_INVISIBIL, 0, STYPE_MAGIC, "Invisibility", NULL, -1, -1, 0, 0, 0, IS_CAST2, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_FLAME, 11, STYPE_FIRE, "Inferno", NULL, 3, 2, 1, 0, 20, IS_CAST2, { MIS_FLAMEC, 0, 0 }, 1, 6, 20, 40, 2000, 100 },
{ SPL_GOLEM, 100, STYPE_FIRE, "Golem", NULL, 11, 9, 0, 0, 81, IS_CAST2, { MIS_GOLEM, 0, 0 }, 6, 60, 16, 32, 18000, 1100 },
{ SPL_BLODBOIL, 0, STYPE_LIGHTNING, "Blood Boil", NULL, -1, -1, 1, 0, 0, IS_CAST8, { 0, 0, 0 }, 0, 0, 0, 0, 0, 0 },
{ SPL_TELEPORT, 35, STYPE_MAGIC, "Teleport", NULL, 14, 12, 1, 0, 105, IS_CAST6, { MIS_TELEPORT, 0, 0 }, 3, 15, 16, 32, 20000, 1250 },
{ SPL_APOCA, 150, STYPE_FIRE, "Apocalypse", NULL, -1, 15, 0, 0, 149, IS_CAST2, { MIS_APOCA, 0, 0 }, 6, 90, 8, 12, 30000, 2000 },
{ SPL_ETHEREALIZE, 100, STYPE_MAGIC, "Etherealize", NULL, -1, -1, 0, 0, 93, IS_CAST2, { MIS_ETHEREALIZE, 0, 0 }, 0, 100, 2, 6, 26000, 1600 },
{ SPL_REPAIR, 0, STYPE_MAGIC, "Item Repair", "Item Repair", -1, -1, 0, 1, -1, IS_CAST6, { MIS_REPAIR, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_RECHARGE, 0, STYPE_MAGIC, "Staff Recharge", "Staff Recharge", -1, -1, 0, 1, -1, IS_CAST6, { MIS_RECHARGE, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_DISARM, 0, STYPE_MAGIC, "Trap Disarm", "Trap Disarm", -1, -1, 0, 0, -1, IS_CAST6, { MIS_DISARM, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_ELEMENT, 35, STYPE_FIRE, "Elemental", NULL, 8, 6, 0, 0, 68, IS_CAST2, { MIS_ELEMENT, 0, 0 }, 2, 20, 20, 60, 10500, 700 },
{ SPL_CBOLT, 6, STYPE_LIGHTNING, "Charged Bolt", NULL, 1, 1, 1, 0, 25, IS_CAST2, { MIS_CBOLT, 0, 0 }, 1, 6, 40, 80, 1000, 50 },
{ SPL_HBOLT, 7, STYPE_MAGIC, "Holy Bolt", NULL, 1, 1, 1, 0, 20, IS_CAST2, { MIS_HBOLT, 0, 0 }, 1, 3, 40, 80, 1000, 50 },
{ SPL_RESURRECT, 20, STYPE_MAGIC, "Resurrect", NULL, -1, 5, 0, 1, 30, IS_CAST8, { MIS_RESURRECT, 0, 0 }, 0, 20, 4, 10, 4000, 250 },
{ SPL_TELEKINESIS, 15, STYPE_MAGIC, "Telekinesis", NULL, 2, 2, 0, 0, 33, IS_CAST2, { MIS_TELEKINESIS, 0, 0 }, 2, 8, 20, 40, 2500, 200 },
{ SPL_HEALOTHER, 5, STYPE_MAGIC, "Heal Other", NULL, 1, 1, 0, 1, 17, IS_CAST8, { MIS_HEALOTHER, 0, 0 }, 3, 1, 20, 40, 1000, 50 },
{ SPL_FLARE, 25, STYPE_MAGIC, "Blood Star", NULL, 14, 13, 0, 0, 70, IS_CAST2, { MIS_FLARE, 0, 0 }, 2, 14, 20, 60, 27500, 1800 },
{ SPL_BONESPIRIT, 24, STYPE_MAGIC, "Bone Spirit", NULL, 9, 7, 0, 0, 34, IS_CAST2, { MIS_BONESPIRIT, 0, 0 }, 1, 12, 20, 60, 11500, 800 }
};
//----- (0045744E) --------------------------------------------------------
int __fastcall GetManaAmount(int id, int sn)
{
int v2; // eax
int v3; // esi
int v4; // ecx
bool v5; // zf
bool v6; // sf
int v7; // ecx
int v8; // ecx
int v9; // edx
v2 = id;
v3 = 0;
v4 = plr[id]._pSplLvl[sn] + plr[id]._pISplLvlAdd - 1;
v5 = v4 == 0;
v6 = v4 < 0;
if ( v4 < 0 )
{
v4 = 0;
v5 = 1;
v6 = 0;
}
if ( !v6 && !v5 )
v3 = v4 * spelldata[sn].sManaAdj;
if ( sn == SPL_FIREBOLT )
v3 >>= 1;
if ( sn == SPL_RESURRECT && v4 > 0 )
v3 = v4 * ((unsigned int)spelldata[SPL_RESURRECT].sManaCost >> 3);
_LOBYTE(v7) = spelldata[sn].sManaCost;
if ( (_BYTE)v7 == -1 )
v7 = _LOBYTE(plr[v2]._pMaxManaBase);
else
v7 = (unsigned char)v7;
v8 = (v7 - v3) << 6;
if ( sn == SPL_HEAL )
v8 = (spelldata[SPL_HEAL].sManaCost + 2 * plr[v2]._pLevel - v3) << 6;
if ( sn == SPL_HEALOTHER )
v8 = (spelldata[SPL_HEAL].sManaCost + 2 * plr[v2]._pLevel - v3) << 6;
if ( _LOBYTE(plr[v2]._pClass) == 1 )
v8 -= v8 >> 2;
v9 = spelldata[sn].sMinMana;
if ( v9 > v8 >> 6 )
v8 = v9 << 6;
return v8 * (100 - plr[v2]._pISplCost) / 100;
}
//----- (0045753A) --------------------------------------------------------
void __fastcall UseMana(int id, int sn)
{
int v2; // esi
int v3; // eax
if ( id == myplr )
{
v2 = id;
switch ( plr[id]._pSplType )
{
case RSPLTYPE_SPELL:
#ifdef _DEBUG
if ( !debug_mode_key_inverted_v )
{
#endif
v3 = GetManaAmount(id, sn);
plr[v2]._pMana -= v3;
plr[v2]._pManaBase -= v3;
drawmanaflag = 1;
#ifdef _DEBUG
}
#endif
break;
case RSPLTYPE_SCROLL:
RemoveScroll(id);
break;
case RSPLTYPE_CHARGES:
UseStaffCharge(id);
break;
}
}
}
//----- (00457584) --------------------------------------------------------
bool __fastcall CheckSpell(int id, int sn, char st, bool manaonly)
{
bool result; // al
int v5; // edi
int v6; // esi
result = 1;
v5 = sn;
v6 = id;
#ifdef _DEBUG
if ( debug_mode_key_inverted_v )
return 1;
#endif
if ( !manaonly && pcurs != 1 )
return 0;
if ( st )
{
if ( GetSpellLevel(id, sn) <= 0 )
return 0;
result = plr[v6]._pMana >= GetManaAmount(v6, v5);
}
return result;
}
//----- (004575D5) --------------------------------------------------------
void __fastcall CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl)
{
int v8; // eax
signed int v9; // edi
unsigned char *v10; // esi
int v11; // esi
int midir; // [esp+8h] [ebp-8h]
int ids; // [esp+Ch] [ebp-4h]
ids = id;
if ( caster )
{
if ( caster != 1 )
goto LABEL_7;
v8 = monster[id]._mdir;
}
else
{
caster = 0;
midir = plr[id]._pdir;
if ( spl != SPL_FIREWALL )
goto LABEL_7;
v8 = plr[id]._pVar3;
}
midir = v8;
LABEL_7:
v9 = 0;
v10 = spelldata[spl].sMissiles;
if ( *v10 )
{
do
{
if ( v9 >= 3 )
break;
AddMissile(sx, sy, dx, dy, midir, (unsigned char)v10[v9++], caster, ids, 0, spllvl);
}
while ( v10[v9] );
}
if ( *v10 == MIS_TOWN )
UseMana(ids, SPL_TOWN);
if ( *v10 == MIS_CBOLT )
{
UseMana(ids, SPL_CBOLT);
if ( (spllvl >> 1) + 3 > 0 )
{
v11 = (spllvl >> 1) + 3;
do
{
AddMissile(sx, sy, dx, dy, midir, MIS_CBOLT, caster, ids, 0, spllvl);
--v11;
}
while ( v11 );
}
}
}
//----- (004576B1) --------------------------------------------------------
void __fastcall DoResurrect(int pnum, int rid)
{
int v2; // ebx
int v3; // esi
int v4; // esi
signed int v5; // edx
int v6; // eax
v2 = rid;
v3 = pnum;
if ( (_BYTE)rid != LOBYTE(-1) )
AddMissile(plr[rid].WorldX, plr[rid].WorldY, plr[rid].WorldX, plr[rid].WorldY, 0, MIS_RESURRECTBEAM, 0, pnum, 0, 0);
if ( v3 == myplr )
SetCursor(CURSOR_HAND);
if ( (_BYTE)v2 != LOBYTE(-1) )
{
v4 = v2;
if ( !plr[v2]._pHitPoints )
{
if ( v2 == myplr )
{
deathflag = 0;
gamemenu_off();
drawhpflag = 1;
drawmanaflag = 1;
}
ClrPlrPath(v2);
plr[v4].destAction = -1;
plr[v4]._pInvincible = 0;
PlacePlayer(v2);
v5 = 640;
if ( plr[v4]._pMaxHPBase < 640 )
v5 = plr[v4]._pMaxHPBase;
SetPlayerHitPoints(v2, v5);
v6 = plr[v4]._pMaxHPBase - plr[v4]._pMaxHP;
plr[v4]._pMana = 0;
plr[v4]._pHPBase = plr[v4]._pHitPoints + v6;
plr[v4]._pManaBase = plr[v4]._pMaxManaBase - plr[v4]._pMaxMana;
CalcPlrInv(v2, 1u);
if ( plr[v4].plrlevel == currlevel )
StartStand(v2, plr[v4]._pdir);
else
plr[v4]._pmode = 0;
}
}
}
//----- (004577CB) --------------------------------------------------------
void __fastcall PlacePlayer(int pnum)
{
int v1; // ebx
unsigned int v2; // eax
int v3; // edi
int v4; // esi
int v5; // eax
bool v6; // zf
signed int v7; // [esp+Ch] [ebp-18h]
int p; // [esp+10h] [ebp-14h]
int v9; // [esp+14h] [ebp-10h]
signed int v10; // [esp+18h] [ebp-Ch]
signed int v11; // [esp+1Ch] [ebp-8h]
unsigned int i; // [esp+20h] [ebp-4h]
signed int v13; // [esp+20h] [ebp-4h]
p = pnum;
v1 = pnum;
if ( plr[pnum].plrlevel == currlevel )
{
v2 = 0;
for ( i = 0; ; v2 = i )
{
v3 = plr[v1].WorldX + *(int *)((char *)plrxoff2 + v2);
v4 = plr[v1].WorldY + *(int *)((char *)plryoff2 + v2);
if ( PosOkPlayer(p, v3, v4) )
break;
i += 4;
if ( i >= 0x20 )
break;
}
if ( !PosOkPlayer(p, v3, v4) )
{
v11 = 0;
v5 = -1;
v13 = 1;
v7 = -1;
do
{
if ( v11 )
break;
v9 = v5;
while ( v5 <= v13 && !v11 )
{
v4 = v9 + plr[v1].WorldY;
v10 = v7;
do
{
if ( v11 )
break;
v3 = v10 + plr[v1].WorldX;
if ( PosOkPlayer(p, v10 + plr[v1].WorldX, v4) )
v11 = 1;
++v10;
}
while ( v10 <= v13 );
v5 = ++v9;
}
++v13;
v5 = v7-- - 1;
}
while ( v7 > -50 );
}
plr[v1].WorldX = v3;
v6 = p == myplr;
plr[v1].WorldY = v4;
dPlayer[v3][v4] = p + 1;
if ( v6 )
{
ViewX = v3;
ViewY = v4;
}
}
}
//----- (004578EE) --------------------------------------------------------
void __fastcall DoHealOther(int pnum, int rid)
{
int v2; // ebx
int v3; // esi
int v4; // ebx
int v5; // ecx
int v6; // edi
int v7; // ecx
char v8; // bl
int v9; // eax
int *v10; // eax
int v11; // esi
int id; // [esp+8h] [ebp-8h]
int v13; // [esp+Ch] [ebp-4h]
signed int v14; // [esp+Ch] [ebp-4h]
int i; // [esp+Ch] [ebp-4h]
v2 = pnum;
v13 = rid;
id = pnum;
if ( pnum == myplr )
SetCursor(CURSOR_HAND);
if ( (_BYTE)v13 != LOBYTE(-1) )
{
v3 = v13;
if ( (signed int)(plr[v13]._pHitPoints & 0xFFFFFFC0) > 0 )
{
_LOBYTE(pnum) = 57;
v4 = v2;
v14 = 0;
v6 = (random(pnum, 10) + 1) << 6;
if ( plr[v4]._pLevel > 0 )
{
do
{
_LOBYTE(v5) = 57;
v6 += (random(v5, 4) + 1) << 6;
++v14;
}
while ( v14 < plr[v4]._pLevel );
}
for ( i = 0; i < GetSpellLevel(id, SPL_HEALOTHER); ++i )
{
_LOBYTE(v7) = 57;
v6 += (random(v7, 6) + 1) << 6;
}
v8 = plr[v4]._pClass;
if ( !v8 )
v6 *= 2;
if ( v8 == 1 )
v6 += v6 >> 1;
plr[v3]._pHitPoints += v6;
v9 = plr[v3]._pMaxHP;
if ( plr[v3]._pHitPoints > v9 )
plr[v3]._pHitPoints = v9;
v10 = &plr[v3]._pHPBase;
v11 = plr[v3]._pMaxHPBase;
*v10 += v6;
if ( *v10 > v11 )
*v10 = v11;
drawhpflag = 1;
}
}
}

22
Source/spells.h Normal file
View File

@ -0,0 +1,22 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
int __fastcall GetManaAmount(int id, int sn);
void __fastcall UseMana(int id, int sn);
bool __fastcall CheckSpell(int id, int sn, char st, bool manaonly);
void __fastcall CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl);
void __fastcall DoResurrect(int pnum, int rid);
void __fastcall PlacePlayer(int pnum);
void __fastcall DoHealOther(int pnum, int rid);
/* rdata */
extern SpellData spelldata[37];

4345
Source/stores.cpp Normal file

File diff suppressed because it is too large Load Diff

146
Source/stores.h Normal file
View File

@ -0,0 +1,146 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//stores
extern int stextup; // weak
extern int storenumh; // weak
extern int stextlhold; // weak
extern ItemStruct boyitem;
extern int stextshold; // idb
extern ItemStruct premiumitem[6];
extern void *pSTextBoxCels;
extern int premiumlevel; // idb
extern int talker; // weak
extern STextStruct stext[24];
extern char stextsize; // weak
extern int stextsmax; // weak
extern int InStoreFlag; // idb
extern ItemStruct storehold[48];
extern int gossipstart; // weak
extern ItemStruct witchitem[20];
extern int stextscrl; // weak
extern int numpremium; // idb
extern ItemStruct healitem[20];
extern ItemStruct golditem;
extern char storehidx[48];
extern void *pSTextSlidCels;
extern int stextvhold; // weak
extern int stextsel; // weak
extern char stextscrldbtn; // weak
extern int gossipend; // weak
extern void *pCelBuff;
extern int stextsval; // idb
extern int boylevel; // weak
extern ItemStruct smithitem[20];
extern int stextdown; // weak
extern char stextscrlubtn; // weak
extern char stextflag; // weak
void __cdecl InitStores();
void __cdecl SetupTownStores();
void __cdecl FreeStoreMem();
void __cdecl DrawSTextBack();
void __fastcall PrintSString(int x, int y, unsigned char cjustflag, char *str, int col, int val);
void __fastcall DrawSLine(int y);
void __fastcall DrawSArrows(int a1, int a2);
void __cdecl DrawSTextHelp();
void __fastcall ClearSText(int s, int e);
void __fastcall AddSLine(int y);
void __fastcall AddSTextVal(int y, int val);
void __fastcall OffsetSTextY(int y, int yo);
void __fastcall AddSText(int x, int y, unsigned char j, char *str, int clr, int sel);
void __cdecl StoreAutoPlace();
void __cdecl S_StartSmith();
void __fastcall S_ScrollSBuy(int idx);
void __fastcall PrintStoreItem(ItemStruct *x, int l, char iclr);
void __cdecl S_StartSBuy();
void __fastcall S_ScrollSPBuy(int idx);
bool __cdecl S_StartSPBuy();
bool __fastcall SmithSellOk(int i);
void __fastcall S_ScrollSSell(int idx);
void __cdecl S_StartSSell();
bool __fastcall SmithRepairOk(int i);
void __cdecl S_StartSRepair();
void __fastcall AddStoreHoldRepair(ItemStruct *itm, int i);
void __cdecl S_StartWitch();
void __fastcall S_ScrollWBuy(int idx);
void __cdecl S_StartWBuy();
bool __fastcall WitchSellOk(int i);
void __cdecl S_StartWSell();
bool __fastcall WitchRechargeOk(int i);
void __fastcall AddStoreHoldRecharge(ItemStruct itm, int i);
void __cdecl S_StartWRecharge();
void __cdecl S_StartNoMoney();
void __cdecl S_StartNoRoom();
void __cdecl S_StartConfirm();
void __cdecl S_StartBoy();
void __cdecl S_StartBBoy();
void __cdecl S_StartHealer();
void __fastcall S_ScrollHBuy(int idx);
void __cdecl S_StartHBuy();
void __cdecl S_StartStory();
bool __fastcall IdItemOk(ItemStruct *i);
void __fastcall AddStoreHoldId(ItemStruct itm, int i);
void __cdecl S_StartSIdentify();
void __cdecl S_StartIdShow();
void __cdecl S_StartTalk();
void __cdecl S_StartTavern();
void __cdecl S_StartBarMaid();
void __cdecl S_StartDrunk();
void __fastcall StartStore(char s);
void __cdecl DrawSText();
void __cdecl STextESC();
void __cdecl STextUp();
void __cdecl STextDown();
void __cdecl STextPrior();
void __cdecl STextNext();
void __cdecl S_SmithEnter();
void __fastcall SetGoldCurs(int pnum, int i);
void __fastcall SetSpdbarGoldCurs(int pnum, int i);
void __fastcall TakePlrsMoney(int cost);
void __cdecl SmithBuyItem();
void __cdecl S_SBuyEnter();
void __cdecl SmithBuyPItem();
void __cdecl S_SPBuyEnter();
bool __fastcall StoreGoldFit(int idx);
void __fastcall PlaceStoreGold(int v);
void __cdecl StoreSellItem();
void __cdecl S_SSellEnter();
void __cdecl SmithRepairItem();
void __cdecl S_SRepairEnter();
void __cdecl S_WitchEnter();
void __cdecl WitchBuyItem();
void __cdecl S_WBuyEnter();
void __cdecl S_WSellEnter();
void __cdecl WitchRechargeItem();
void __cdecl S_WRechargeEnter();
void __cdecl S_BoyEnter();
void __cdecl BoyBuyItem();
void __cdecl HealerBuyItem();
void __cdecl S_BBuyEnter();
void __cdecl StoryIdItem();
void __cdecl S_ConfirmEnter();
void __cdecl S_HealerEnter();
void __cdecl S_HBuyEnter();
void __cdecl S_StoryEnter();
void __cdecl S_SIDEnter();
void __cdecl S_TalkEnter();
void __cdecl S_TavernEnter();
void __cdecl S_BarmaidEnter();
void __cdecl S_DrunkEnter();
void __cdecl STextEnter();
void __cdecl CheckStoreBtn();
void __cdecl ReleaseStoreBtn();
/* rdata */
extern int SStringY[24];
extern char *talkname[9];

403
Source/sync.cpp Normal file
View File

@ -0,0 +1,403 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
short sync_word_6AA708[200];
int dword_6AA898; // weak
short sync_word_6AA89C[200];
int dword_6AAA2C[2];
int sgnSyncPInv; // weak
//----- (0045C199) --------------------------------------------------------
int __fastcall sync_all_monsters(TSyncHeader *packet, int size)
{
int result; // eax
TSyncHeader *v3; // esi
int v4; // ebx
TSyncMonster *v5; // edi
unsigned int v6; // [esp+4h] [ebp-4h]
result = size;
if ( nummonsters >= 1 && (unsigned int)size >= 0x2B )
{
v3 = packet;
v6 = size - 38;
v4 = 0;
packet->bCmd = CMD_SYNCDATA;
v5 = (TSyncMonster *)(&packet->wPInvCI + 1);
packet->bLevel = currlevel;
packet->wLen = 0;
SyncPlrInv(packet);
sync_one_monster();
if ( nummonsters > 0 )
{
do
{
if ( v6 < 5 || (v4 >= 2 || !sync_monster_active2(v5)) && !sync_monster_active(v5) )
break;
v3->wLen += 5;
v6 -= 5;
++v5;
++v4;
}
while ( v4 < nummonsters );
}
result = v6;
}
return result;
}
//----- (0045C21E) --------------------------------------------------------
void __cdecl sync_one_monster()
{
int i; // ebx
int v1; // edi
int v2; // esi
short v3; // bp
short v4; // ax
bool v5; // zf
short *v6; // edx
short *v7; // eax
for ( i = 0; i < nummonsters; ++i )
{
v1 = monstactive[i];
v2 = monstactive[i];
v3 = abs(plr[myplr].WorldY - monster[v2]._my);
v4 = abs(plr[myplr].WorldX - monster[v2]._mx);
v5 = _LOBYTE(monster[v2]._msquelch) == 0;
v6 = &sync_word_6AA708[v1];
*v6 = v4 + v3;
if ( v5 )
{
*v6 = v4 + v3 + 4096;
}
else
{
v7 = &sync_word_6AA89C[v1];
if ( *v7 )
--*v7;
}
}
}
//----- (0045C2C4) --------------------------------------------------------
int __fastcall sync_monster_active(TSyncMonster *packet)
{
unsigned int v1; // ebx
int v2; // esi
int v3; // edx
int v4; // eax
v1 = -1;
v2 = 0;
v3 = -1;
if ( nummonsters <= 0 )
return 0;
do
{
v4 = monstactive[v2];
if ( (unsigned short)sync_word_6AA708[v4] < v1 && (unsigned short)sync_word_6AA89C[v4] < 0xFFFEu )
{
v1 = (unsigned short)sync_word_6AA708[v4];
v3 = monstactive[v2];
}
++v2;
}
while ( v2 < nummonsters );
if ( v3 == -1 )
return 0;
sync_monster_pos(packet, v3);
return 1;
}
//----- (0045C317) --------------------------------------------------------
int __fastcall sync_monster_pos(TSyncMonster *packet, int mon_id)
{
int v2; // ebx
TSyncMonster *v3; // esi
int v4; // edi
int result; // eax
short v6; // cx
char v7; // cl
v2 = mon_id;
v3 = packet;
v4 = mon_id;
packet->_mndx = mon_id;
packet->_mx = monster[mon_id]._mx;
packet->_my = monster[mon_id]._my;
packet->_menemy = encode_enemy(mon_id);
result = v2;
v6 = sync_word_6AA708[v2];
if ( (unsigned short)v6 > 0xFFu )
_LOBYTE(v6) = -1;
v3->_mdelta = v6;
v7 = monster[v4]._msquelch;
sync_word_6AA708[result] = -1;
sync_word_6AA89C[result] = -(v7 != 0) - 1;
return result * 2;
}
//----- (0045C386) --------------------------------------------------------
int __fastcall sync_monster_active2(TSyncMonster *packet)
{
int v1; // edx
unsigned int v2; // ebp
int v3; // eax
int v4; // esi
int v6; // [esp+8h] [ebp-4h]
v1 = -1;
v2 = 65534;
if ( nummonsters <= 0 )
return 0;
v3 = dword_6AA898;
v6 = nummonsters;
do
{
if ( v3 >= nummonsters )
v3 = 0;
v4 = monstactive[v3];
if ( (unsigned short)sync_word_6AA89C[v4] < v2 )
{
v2 = (unsigned short)sync_word_6AA89C[v4];
v1 = monstactive[v3];
}
++v3;
--v6;
}
while ( v6 );
dword_6AA898 = v3;
if ( v1 == -1 )
return 0;
sync_monster_pos(packet, v1);
return 1;
}
// 6AA898: using guessed type int dword_6AA898;
//----- (0045C3E6) --------------------------------------------------------
char __fastcall SyncPlrInv(TSyncHeader *pItem)
{
int v1; // edx
int v2; // eax
int v3; // eax
short v4; // dx
short v5; // bx
ItemStruct *v6; // eax
if ( numitems <= 0 )
{
pItem->bItemI = -1;
}
else
{
v1 = dword_6AAA2C[0];
if ( dword_6AAA2C[0] >= numitems )
v1 = 0;
v2 = itemactive[v1];
dword_6AAA2C[0] = v1 + 1;
pItem->bItemI = v2;
v3 = v2;
pItem->bItemX = item[v3]._ix;
pItem->bItemY = item[v3]._iy;
*(_WORD *)(&pItem->bItemY + 1) = item[v3].IDidx;
if ( item[v3].IDidx == IDI_EAR )
{
_LOBYTE(v4) = 0;
_HIBYTE(v4) = item[v3]._iName[7];
_LOBYTE(v5) = 0;
*(unsigned short *)((char *)&pItem->wItemIndx + 1) = item[v3]._iName[8] | v4;
*(_DWORD *)((char *)&pItem->wItemCI + 1) = item[v3]._iName[12] | ((item[v3]._iName[11] | ((item[v3]._iName[10] | (item[v3]._iName[9] << 8)) << 8)) << 8);
BYTE1(pItem->dwItemSeed) = item[v3]._iName[13];
BYTE2(pItem->dwItemSeed) = item[v3]._iName[14];
_HIBYTE(pItem->dwItemSeed) = item[v3]._iName[15];
pItem->bItemId = item[v3]._iName[16];
pItem->bItemDur = item[v3]._iName[17];
_HIBYTE(v5) = item[v3]._iName[18];
*(_WORD *)&pItem->bItemMDur = _LOWORD(item[v3]._ivalue) | v5 | ((_LOWORD(item[v3]._iCurs) - 19) << 6);
*(_DWORD *)&pItem->bItemMCh = item[v3]._iName[22] | ((item[v3]._iName[21] | ((item[v3]._iName[20] | (item[v3]._iName[19] << 8)) << 8)) << 8);
}
else
{
*(unsigned short *)((char *)&pItem->wItemIndx + 1) = item[v3]._iCreateInfo;
*(_DWORD *)((char *)&pItem->wItemCI + 1) = item[v3]._iSeed;
BYTE1(pItem->dwItemSeed) = item[v3]._iIdentified;
BYTE2(pItem->dwItemSeed) = item[v3]._iDurability;
_HIBYTE(pItem->dwItemSeed) = item[v3]._iMaxDur;
pItem->bItemId = item[v3]._iCharges;
pItem->bItemDur = item[v3]._iMaxCharges;
if ( !item[v3].IDidx )
*(_WORD *)&pItem->bItemMDur = item[v3]._ivalue;
}
}
v6 = &plr[myplr].InvBody[sgnSyncPInv];
if ( v6->_itype == -1 )
{
_LOBYTE(pItem->dwItemBuff) = -1;
}
else
{
_LOBYTE(pItem->dwItemBuff) = sgnSyncPInv;
*(_WORD *)((char *)&pItem->dwItemBuff + 1) = v6->IDidx;
*(_WORD *)((char *)&pItem->dwItemBuff + 3) = v6->_iCreateInfo;
*(_DWORD *)(&pItem->bPInvLoc + 1) = v6->_iSeed;
_LOBYTE(v6) = v6->_iIdentified;
_HIBYTE(pItem->wPInvCI) = (_BYTE)v6;
}
if ( ++sgnSyncPInv >= 7 )
sgnSyncPInv = 0;
return (char)v6;
}
// 6AAA34: using guessed type int sgnSyncPInv;
//----- (0045C5C7) --------------------------------------------------------
int __fastcall SyncData(int pnum, TSyncHeader *packet)
{
TSyncHeader *v2; // esi
TSyncMonster *v3; // edi
int v4; // ebp
unsigned short v5; // ax
unsigned int v6; // ebx
v2 = packet;
v3 = (TSyncMonster *)(&packet->wPInvCI + 1);
v4 = pnum;
if ( packet->bCmd != CMD_SYNCDATA )
TermMsg("bad sync command");
if ( gbBufferMsgs != 1 && v4 != myplr )
{
v5 = v2->wLen;
if ( v5 >= 5u )
{
v6 = v5 / 5u;
do
{
if ( currlevel == v2->bLevel )
sync_monster_data(v4, v3);
delta_sync_monster((TCmdLocParam1 *)v3, v2->bLevel);
++v3;
--v6;
}
while ( v6 );
}
}
return v2->wLen + 38;
}
// 676194: using guessed type char gbBufferMsgs;
//----- (0045C63B) --------------------------------------------------------
void __fastcall sync_monster_data(int pnum, TSyncMonster *packet)
{
TSyncMonster *v2; // edi
int v3; // ecx
int v4; // ebx
int v5; // esi
int v6; // ST18_4
unsigned int v7; // ecx
unsigned int v8; // eax
int v9; // eax
int v10; // ecx
signed int v11; // ST14_4
int v12; // eax
int v13; // eax
int v14; // eax
//int v15; // eax
int v16; // eax
int md; // [esp+Ch] [ebp-8h]
int mda; // [esp+Ch] [ebp-8h]
v2 = packet;
md = pnum;
v3 = 0;
v4 = (unsigned char)packet->_mndx;
v5 = v4;
if ( monster[v5]._mhitpoints )
{
if ( nummonsters > 0 )
{
do
{
if ( monstactive[v3] == v4 )
break;
++v3;
}
while ( v3 < nummonsters );
}
v6 = abs(plr[myplr].WorldY - monster[v5]._my);
v7 = abs(plr[myplr].WorldX - monster[v5]._mx) + v6;
if ( v7 > 0xFF )
v7 = 255;
v8 = (unsigned char)v2->_mdelta;
if ( v7 >= v8 && (v7 != v8 || md <= myplr) )
{
v9 = (unsigned char)v2->_mx;
if ( monster[v5]._mfutx != v9 || monster[v5]._mfuty != (unsigned char)v2->_my )
{
v10 = monster[v5]._mmode;
if ( v10 != MM_CHARGE && v10 != MM_STONE )
{
v11 = abs(monster[v5]._mx - v9);
v12 = abs(monster[v5]._my - (unsigned char)v2->_my);
if ( v11 > 2 || v12 > 2 )
{
if ( dMonster[0][(unsigned char)v2->_my + 112 * (unsigned char)v2->_mx] )
{
LABEL_23:
decode_enemy(v4, (unsigned char)v2->_menemy);
return;
}
M_ClearSquares(v4);
dMonster[0][(unsigned char)v2->_my + 112 * (unsigned char)v2->_mx] = v4 + 1;
monster[v5]._mx = (unsigned char)v2->_mx;
monster[v5]._my = (unsigned char)v2->_my;
decode_enemy(v4, (unsigned char)v2->_menemy);
v16 = GetDirection(
(unsigned char)v2->_mx,
(unsigned char)v2->_my,
(unsigned char)monster[v5]._menemyx,
(unsigned char)monster[v5]._menemyy);
M_StartStand(v4, v16);
}
else
{
v13 = monster[v5]._mmode;
if ( v13 >= MM_WALK && v13 <= MM_WALK3 )
goto LABEL_23;
v14 = GetDirection(
monster[v5]._mx,
monster[v5]._my,
(unsigned char)v2->_mx,
(unsigned char)v2->_my);
mda = v14;
//_LOBYTE(v15) = DirOK(v4, v14);
if ( !DirOK(v4, v14) )
goto LABEL_23;
M_ClearSquares(v4);
dMonster[0][monster[v5]._my + 112 * monster[v5]._mx] = v4 + 1;
M_WalkDir(v4, mda);
}
_LOBYTE(monster[v5]._msquelch) = -1;
goto LABEL_23;
}
}
}
}
}
//----- (0045C84B) --------------------------------------------------------
void __cdecl sync_clear_pkt()
{
dword_6AA898 = 16 * myplr;
memset(sync_word_6AA89C, 255, 0x190u);
}
// 6AA898: using guessed type int dword_6AA898;

27
Source/sync.h Normal file
View File

@ -0,0 +1,27 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//sync
extern short sync_word_6AA708[200];
extern int dword_6AA898; // weak
extern short sync_word_6AA89C[200];
extern int dword_6AAA2C[2];
extern int sgnSyncPInv; // weak
int __fastcall sync_all_monsters(TSyncHeader *packet, int size);
void __cdecl sync_one_monster();
int __fastcall sync_monster_active(TSyncMonster *packet);
int __fastcall sync_monster_pos(TSyncMonster *packet, int mon_id);
int __fastcall sync_monster_active2(TSyncMonster *packet);
char __fastcall SyncPlrInv(TSyncHeader *pItem);
int __fastcall SyncData(int pnum, TSyncHeader *packet);
void __fastcall sync_monster_data(int pnum, TSyncMonster *packet);
void __cdecl sync_clear_pkt();

519
Source/textdat.cpp Normal file
View File

@ -0,0 +1,519 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
TextDataStruct alltext[259] =
{
{ " Ahh, the story of our King, is it? The tragic fall of Leoric was a harsh blow to this land. The people always loved the King, and now they live in mortal fear of him. The question that I keep asking myself is how he could have fallen so far from the Light, as Leoric had always been the holiest of men. Only the vilest powers of Hell could so utterly destroy a man from within... |",
1, 5, TSFX_STORY1 },
{ "The village needs your help, good master! Some months ago King Leoric's son, Prince Albrecht, was kidnapped. The King went into a rage and scoured the village for his missing child. With each passing day, Leoric seemed to slip deeper into madness. He sought to blame innocent townsfolk for the boy's disappearance and had them brutally executed. Less than half of us survived his insanity...\n \nThe King's Knights and Priests tried to placate him, but he turned against them and sadly, they were forced to kill him. With his dying breath the King called down a terrible curse upon his former followers. He vowed that they would serve him in darkness forever...\n \nThis is where things take an even darker twist than I thought possible! Our former King has risen from his eternal sleep and now commands a legion of undead minions within the Labyrinth. His body was buried in a tomb three levels beneath the Cathedral. Please, good master, put his soul at ease by destroying his now cursed form... |",
1, 5, TSFX_TAVERN21 },
{ "As I told you, good master, the King was entombed three levels below. He's down there, waiting in the putrid darkness for his chance to destroy this land... |",
1, 6, TSFX_TAVERN22 },
{ "The curse of our King has passed, but I fear that it was only part of a greater evil at work. However, we may yet be saved from the darkness that consumes our land, for your victory is a good omen. May Light guide you on your way, good master. |",
1, 5, TSFX_TAVERN23 },
{ "The loss of his son was too much for King Leoric. I did what I could to ease his madness, but in the end it overcame him. A black curse has hung over this kingdom from that day forward, but perhaps if you were to free his spirit from his earthly prison, the curse would be lifted... |",
1, 5, TSFX_HEALER1 },
{ "I don't like to think about how the King died. I like to remember him for the kind and just ruler that he was. His death was so sad and seemed very wrong, somehow. |",
1, 6, TSFX_BMAID1 },
{ "I made many of the weapons and most of the armor that King Leoric used to outfit his knights. I even crafted a huge two-handed sword of the finest mithril for him, as well as a field crown to match. I still cannot believe how he died, but it must have been some sinister force that drove him insane! |",
1, 5, TSFX_SMITH1 },
{ "I don't care about that. Listen, no skeleton is gonna be MY king. Leoric is King. King, so you hear me? HAIL TO THE KING! |",
1, 5, TSFX_DRUNK1 },
{ "The dead who walk among the living follow the cursed King. He holds the power to raise yet more warriors for an ever growing army of the undead. If you do not stop his reign, he will surely march across this land and slay all who still live here. |",
1, 5, TSFX_WITCH1 },
{ "Look, I'm running a business here. I don't sell information, and I don't care about some King that's been dead longer than I've been alive. If you need something to use against this King of the undead, then I can help you out... |",
1, 5, TSFX_PEGBOY1 },
{ "The warmth of life has entered my tomb. Prepare yourself, mortal, to serve my Master for eternity! |",
0, 5, USFX_SKING1 },
{ "I see that this strange behavior puzzles you as well. I would surmise that since many demons fear the light of the sun and believe that it holds great power, it may be that the rising sun depicted on the sign you speak of has led them to believe that it too holds some arcane powers. Hmm, perhaps they are not all as smart as we had feared... |",
1, 5, TSFX_STORY2 },
{ "Master, I have a strange experience to relate. I know that you have a great knowledge of those monstrosities that inhabit the labyrinth, and this is something that I cannot understand for the very life of me... I was awakened during the night by a scraping sound just outside of my tavern. When I looked out from my bedroom, I saw the shapes of small demon-like creatures in the inn yard. After a short time, they ran off, but not before stealing the sign to my inn. I don't know why the demons would steal my sign but leave my family in peace... 'tis strange, no? |",
1, 5, TSFX_TAVERN24 },
{ "Oh, you didn't have to bring back my sign, but I suppose that it does save me the expense of having another one made. Well, let me see, what could I give you as a fee for finding it? Hmmm, what have we here... ah, yes! This cap was left in one of the rooms by a magician who stayed here some time ago. Perhaps it may be of some value to you. |",
1, 5, TSFX_TAVERN25 },
{ "My goodness, demons running about the village at night, pillaging our homes - is nothing sacred? I hope that Ogden and Garda are all right. I suppose that they would come to see me if they were hurt... |",
1, 5, TSFX_HEALER2 },
{ "Oh my! Is that where the sign went? My Grandmother and I must have slept right through the whole thing. Thank the Light that those monsters didn't attack the inn. |",
1, 6, TSFX_BMAID2 },
{ "Demons stole Ogden's sign, you say? That doesn't sound much like the atrocities I've heard of - or seen. \n \nDemons are concerned with ripping out your heart, not your signpost. |",
1, 6, TSFX_SMITH2 },
{ "You know what I think? Somebody took that sign, and they gonna want lots of money for it. If I was Ogden... and I'm not, but if I was... I'd just buy a new sign with some pretty drawing on it. Maybe a nice mug of ale or a piece of cheese... |",
1, 5, TSFX_DRUNK2 },
{ "No mortal can truly understand the mind of the demon. \n \nNever let their erratic actions confuse you, as that too may be their plan. |",
1, 6, TSFX_WITCH2 },
{ "What - is he saying I took that? I suppose that Griswold is on his side, too. \n \nLook, I got over simple sign stealing months ago. You can't turn a profit on a piece of wood. |",
1, 6, TSFX_PEGBOY2 },
{ "Hey - You that one that kill all! You get me Magic Banner or we attack! You no leave with life! You kill big uglies and give back Magic. Go past corner and door, find uglies. You give, you go! |",
1, 5, USFX_SNOT1 },
{ "You kill uglies, get banner. You bring to me, or else... |",
1, 6, USFX_SNOT2 },
{ "You give! Yes, good! Go now, we strong. We kill all with big Magic! |",
1, 6, USFX_SNOT3 },
{ "This does not bode well, for it confirms my darkest fears. While I did not allow myself to believe the ancient legends, I cannot deny them now. Perhaps the time has come to reveal who I am.\n \nMy true name is Deckard Cain the Elder, and I am the last descendant of an ancient Brotherhood that was dedicated to safeguarding the secrets of a timeless evil. An evil that quite obviously has now been released.\n \nThe Archbishop Lazarus, once King Leoric's most trusted advisor, led a party of simple townsfolk into the Labyrinth to find the King's missing son, Albrecht. Quite some time passed before they returned, and only a few of them escaped with their lives.\n \nCurse me for a fool! I should have suspected his veiled treachery then. It must have been Lazarus himself who kidnapped Albrecht and has since hidden him within the Labyrinth. I do not understand why the Archbishop turned to the darkness, or what his interest is in the child. unless he means to sacrifice him to his dark masters!\n \nThat must be what he has planned! The survivors of his 'rescue party' say that Lazarus was last seen running into the deepest bowels of the labyrinth. You must hurry and save the prince from the sacrificial blade of this demented fiend! |",
1, 3, TSFX_STORY36 },
{ "You must hurry and rescue Albrecht from the hands of Lazarus. The prince and the people of this kingdom are counting on you! |",
1, 5, TSFX_STORY37 },
{ "Your story is quite grim, my friend. Lazarus will surely burn in Hell for his horrific deed. The boy that you describe is not our prince, but I believe that Albrecht may yet be in danger. The symbol of power that you speak of must be a portal in the very heart of the labyrinth.\n \nKnow this, my friend - The evil that you move against is the dark Lord of Terror. He is known to mortal men as Diablo. It was he who was imprisoned within the Labyrinth many centuries ago and I fear that he seeks to once again sow chaos in the realm of mankind. You must venture through the portal and destroy Diablo before it is too late! |",
1, 5, TSFX_STORY38 },
{ "Lazarus was the Archbishop who led many of the townspeople into the labyrinth. I lost many good friends that day, and Lazarus never returned. I suppose he was killed along with most of the others. If you would do me a favor, good master - please do not talk to Farnham about that day. |",
1, 6, TSFX_TAVERN1 },
{ "|", 1, 5, TSFX_STORY38 },
{ "|", 1, 5, TSFX_STORY38 },
{ "I was shocked when I heard of what the townspeople were planning to do that night. I thought that of all people, Lazarus would have had more sense than that. He was an Archbishop, and always seemed to care so much for the townsfolk of Tristram. So many were injured, I could not save them all... |",
1, 5, TSFX_HEALER3 },
{ "I remember Lazarus as being a very kind and giving man. He spoke at my mother's funeral, and was supportive of my grandmother and myself in a very troubled time. I pray every night that somehow, he is still alive and safe. |",
1, 5, TSFX_BMAID3 },
{ "I was there when Lazarus led us into the labyrinth. He spoke of holy retribution, but when we started fighting those hellspawn, he did not so much as lift his mace against them. He just ran deeper into the dim, endless chambers that were filled with the servants of darkness! |",
1, 5, TSFX_SMITH3 },
{ "They stab, then bite, then they're all around you. Liar! LIAR! They're all dead! Dead! Do you hear me? They just keep falling and falling... their blood spilling out all over the floor... all his fault... |",
1, 5, TSFX_DRUNK3 },
{ "I did not know this Lazarus of whom you speak, but I do sense a great conflict within his being. He poses a great danger, and will stop at nothing to serve the powers of darkness which have claimed him as theirs. |",
1, 5, TSFX_WITCH3 },
{ "Yes, the righteous Lazarus, who was sooo effective against those monsters down there. Didn't help save my leg, did it? Look, I'll give you a free piece of advice. Ask Farnham, he was there. |",
1, 5, TSFX_PEGBOY3 },
{ "Abandon your foolish quest. All that awaits you is the wrath of my Master! You are too late to save the child. Now you will join him in Hell! |",
0, 5, USFX_LAZ1 },
{ " |", 0, 5, USFX_LAZ1 },
{ "Hmm, I don't know what I can really tell you about this that will be of any help. The water that fills our wells comes from an underground spring. I have heard of a tunnel that leads to a great lake - perhaps they are one and the same. Unfortunately, I do not know what would cause our water supply to be tainted. |",
1, 5, TSFX_STORY4 },
{ "I have always tried to keep a large supply of foodstuffs and drink in our storage cellar, but with the entire town having no source of fresh water, even our stores will soon run dry. \n \nPlease, do what you can or I don't know what we will do. |",
1, 6, TSFX_TAVERN2 },
{ "I'm glad I caught up to you in time! Our wells have become brackish and stagnant and some of the townspeople have become ill drinking from them. Our reserves of fresh water are quickly running dry. I believe that there is a passage that leads to the springs that serve our town. Please find what has caused this calamity, or we all will surely perish. |",
1, 5, TSFX_HEALER20 },
{ "Please, you must hurry. Every hour that passes brings us closer to having no water to drink. \n \nWe cannot survive for long without your help. |",
1, 6, TSFX_HEALER21 },
{ "What's that you say - the mere presence of the demons had caused the water to become tainted? Oh, truly a great evil lurks beneath our town, but your perseverance and courage gives us hope. Please take this ring - perhaps it will aid you in the destruction of such vile creatures. |",
1, 5, TSFX_HEALER22 },
{ "My grandmother is very weak, and Garda says that we cannot drink the water from the wells. Please, can you do something to help us? |",
1, 6, TSFX_BMAID4 },
{ "Pepin has told you the truth. We will need fresh water badly, and soon. I have tried to clear one of the smaller wells, but it reeks of stagnant filth. It must be getting clogged at the source. |",
1, 5, TSFX_SMITH4 },
{ "You drink water? |", 1, 8, TSFX_DRUNK4 },
{ "The people of Tristram will die if you cannot restore fresh water to their wells. \n \nKnow this - demons are at the heart of this matter, but they remain ignorant of what they have spawned. |",
1, 6, TSFX_WITCH4 },
{ "For once, I'm with you. My business runs dry - so to speak - if I have no market to sell to. You better find out what is going on, and soon! |",
1, 6, TSFX_PEGBOY4 },
{ "A book that speaks of a chamber of human bones? Well, a Chamber of Bone is mentioned in certain archaic writings that I studied in the libraries of the East. These tomes inferred that when the Lords of the underworld desired to protect great treasures, they would create domains where those who died in the attempt to steal that treasure would be forever bound to defend it. A twisted, but strangely fitting, end? |",
1, 4, TSFX_STORY7 },
{ "I am afraid that I don't know anything about that, good master. Cain has many books that may be of some help. |",
1, 6, TSFX_TAVERN5 },
{ "This sounds like a very dangerous place. If you venture there, please take great care. |",
1, 6, TSFX_HEALER5 },
{ "I am afraid that I haven't heard anything about that. Perhaps Cain the Storyteller could be of some help. |",
1, 6, TSFX_BMAID6 },
{ "I know nothing of this place, but you may try asking Cain. He talks about many things, and it would not surprise me if he had some answers to your question. |",
1, 6, TSFX_SMITH7 },
{ "Okay, so listen. There's this chamber of wood, see. And his wife, you know - her - tells the tree... cause you gotta wait. Then I says, that might work against him, but if you think I'm gonna PAY for this... you... uh... yeah. |",
1, 5, TSFX_DRUNK7 },
{ "You will become an eternal servant of the dark lords should you perish within this cursed domain. \n \nEnter the Chamber of Bone at your own peril. |",
1, 6, TSFX_WITCH7 },
{ "A vast and mysterious treasure, you say? Maybe I could be interested in picking up a few things from you... or better yet, don't you need some rare and expensive supplies to get you through this ordeal? |",
1, 5, TSFX_PEGBOY7 },
{ "It seems that the Archbishop Lazarus goaded many of the townsmen into venturing into the Labyrinth to find the King's missing son. He played upon their fears and whipped them into a frenzied mob. None of them were prepared for what lay within the cold earth... Lazarus abandoned them down there - left in the clutches of unspeakable horrors - to die. |",
1, 5, TSFX_STORY10 },
{ "Yes, Farnham has mumbled something about a hulking brute who wielded a fierce weapon. I believe he called him a butcher. |",
1, 6, TSFX_TAVERN8 },
{ "By the Light, I know of this vile demon. There were many that bore the scars of his wrath upon their bodies when the few survivors of the charge led by Lazarus crawled from the Cathedral. I don't know what he used to slice open his victims, but it could not have been of this world. It left wounds festering with disease and even I found them almost impossible to treat. Beware if you plan to battle this fiend... |",
1, 5, TSFX_HEALER8 },
{ "When Farnham said something about a butcher killing people, I immediately discounted it. But since you brought it up, maybe it is true. |",
1, 6, TSFX_BMAID8 },
{ "I saw what Farnham calls the Butcher as it swathed a path through the bodies of my friends. He swung a cleaver as large as an axe, hewing limbs and cutting down brave men where they stood. I was separated from the fray by a host of small screeching demons and somehow found the stairway leading out. I never saw that hideous beast again, but his blood-stained visage haunts me to this day. |",
1, 5, TSFX_SMITH10 },
{ "Big! Big cleaver killing all my friends. Couldn't stop him, had to run away, couldn't save them. Trapped in a room with so many bodies... so many friends... NOOOOOOOOOO! |",
1, 5, TSFX_DRUNK10 },
{ "The Butcher is a sadistic creature that delights in the torture and pain of others. You have seen his handiwork in the drunkard Farnham. His destruction will do much to ensure the safety of this village. |",
1, 5, TSFX_WITCH10 },
{ "I know more than you'd think about that grisly fiend. His little friends got a hold of me and managed to get my leg before Griswold pulled me out of that hole. \n \nI'll put it bluntly - kill him before he kills you and adds your corpse to his collection. |",
1, 6, TSFX_PEGBOY10 },
{ "Please, listen to me. The Archbishop Lazarus, he led us down here to find the lost prince. The bastard led us into a trap! Now everyone is dead...killed by a demon he called the Butcher. Avenge us! Find this Butcher and slay him so that our souls may finally rest... |",
1, 5, TSFX_WOUND },
{ " |", 1, 5, USFX_CLEAVER },
{ "You recite an interesting rhyme written in a style that reminds me of other works. Let me think now - what was it?\n \n...Darkness shrouds the Hidden. Eyes glowing unseen with only the sounds of razor claws briefly scraping to torment those poor souls who have been made sightless for all eternity. The prison for those so damned is named the Halls of the Blind... |",
1, 5, TSFX_STORY12 },
{ "I never much cared for poetry. Occasionally, I had cause to hire minstrels when the inn was doing well, but that seems like such a long time ago now. \n \nWhat? Oh, yes... uh, well, I suppose you could see what someone else knows. |",
1, 6, TSFX_TAVERN10 },
{ "This does seem familiar, somehow. I seem to recall reading something very much like that poem while researching the history of demonic afflictions. It spoke of a place of great evil that... wait - you're not going there are you? |",
1, 5, TSFX_HEALER10 },
{ "If you have questions about blindness, you should talk to Pepin. I know that he gave my grandmother a potion that helped clear her vision, so maybe he can help you, too. |",
1, 6, TSFX_BMAID10 },
{ "I am afraid that I have neither heard nor seen a place that matches your vivid description, my friend. Perhaps Cain the Storyteller could be of some help. |",
1, 6, TSFX_SMITH12 },
{ "Look here... that's pretty funny, huh? Get it? Blind - look here? |",
1, 6, TSFX_DRUNK12 },
{ "This is a place of great anguish and terror, and so serves its master well. \n \nTread carefully or you may yourself be staying much longer than you had anticipated. |",
1, 6, TSFX_WITCH12 },
{ "Lets see, am I selling you something? No. Are you giving me money to tell you about this? No. Are you now leaving and going to talk to the storyteller who lives for this kind of thing? Yes. |",
1, 5, TSFX_PEGBOY11 },
{ "You claim to have spoken with Lachdanan? He was a great hero during his life. Lachdanan was an honorable and just man who served his King faithfully for years. But of course, you already know that.\n \nOf those who were caught within the grasp of the King's Curse, Lachdanan would be the least likely to submit to the darkness without a fight, so I suppose that your story could be true. If I were in your place, my friend, I would find a way to release him from his torture. |",
1, 5, TSFX_STORY13 },
{ "You speak of a brave warrior long dead! I'll have no such talk of speaking with departed souls in my inn yard, thank you very much. |",
1, 6, TSFX_TAVERN11 },
{ "A golden elixir, you say. I have never concocted a potion of that color before, so I can't tell you how it would effect you if you were to try to drink it. As your healer, I strongly advise that should you find such an elixir, do as Lachdanan asks and DO NOT try to use it. |",
1, 5, TSFX_HEALER11 },
{ "I've never heard of a Lachdanan before. I'm sorry, but I don't think that I can be of much help to you. |",
1, 7, TSFX_BMAID11 },
{ "If it is actually Lachdanan that you have met, then I would advise that you aid him. I dealt with him on several occasions and found him to be honest and loyal in nature. The curse that fell upon the followers of King Leoric would fall especially hard upon him. |",
1, 5, TSFX_SMITH13 },
{ " Lachdanan is dead. Everybody knows that, and you can't fool me into thinking any other way. You can't talk to the dead. I know! |",
1, 5, TSFX_DRUNK13 },
{ "You may meet people who are trapped within the Labyrinth, such as Lachdanan. \n \nI sense in him honor and great guilt. Aid him, and you aid all of Tristram. |",
1, 6, TSFX_WITCH13 },
{ "Wait, let me guess. Cain was swallowed up in a gigantic fissure that opened beneath him. He was incinerated in a ball of hellfire, and can't answer your questions anymore. Oh, that isn't what happened? Then I guess you'll be buying something or you'll be on your way. |",
1, 5, TSFX_PEGBOY12 },
{ "Please, don't kill me, just hear me out. I was once Captain of King Leoric's Knights, upholding the laws of this land with justice and honor. Then his dark Curse fell upon us for the role we played in his tragic death. As my fellow Knights succumbed to their twisted fate, I fled from the King's burial chamber, searching for some way to free myself from the Curse. I failed...\n \nI have heard of a Golden Elixir that could lift the Curse and allow my soul to rest, but I have been unable to find it. My strength now wanes, and with it the last of my humanity as well. Please aid me and find the Elixir. I will repay your efforts - I swear upon my honor. |",
1, 3, USFX_LACH1 },
{ "You have not found the Golden Elixir. I fear that I am doomed for eternity. Please, keep trying... |",
1, 6, USFX_LACH2 },
{ "You have saved my soul from damnation, and for that I am in your debt. If there is ever a way that I can repay you from beyond the grave I will find it, but for now - take my helm. On the journey I am about to take I will have little use for it. May it protect you against the dark powers below. Go with the Light, my friend... |",
1, 4, USFX_LACH3 },
{ "Griswold speaks of The Anvil of Fury - a legendary artifact long searched for, but never found. Crafted from the metallic bones of the Razor Pit demons, the Anvil of Fury was smelt around the skulls of the five most powerful magi of the underworld. Carved with runes of power and chaos, any weapon or armor forged upon this Anvil will be immersed into the realm of Chaos, imbedding it with magical properties. It is said that the unpredictable nature of Chaos makes it difficult to know what the outcome of this smithing will be... |",
1, 4, TSFX_STORY14 },
{ "Don't you think that Griswold would be a better person to ask about this? He's quite handy, you know. |",
1, 7, TSFX_TAVERN12 },
{ "If you had been looking for information on the Pestle of Curing or the Silver Chalice of Purification, I could have assisted you, my friend. However, in this matter, you would be better served to speak to either Griswold or Cain. |",
1, 6, TSFX_HEALER12 },
{ "Griswold's father used to tell some of us when we were growing up about a giant anvil that was used to make mighty weapons. He said that when a hammer was struck upon this anvil, the ground would shake with a great fury. Whenever the earth moves, I always remember that story. |",
1, 5, TSFX_BMAID12 },
{ "Greetings! It's always a pleasure to see one of my best customers! I know that you have been venturing deeper into the Labyrinth, and there is a story I was told that you may find worth the time to listen to...\n \nOne of the men who returned from the Labyrinth told me about a mystic anvil that he came across during his escape. His description reminded me of legends I had heard in my youth about the burning Hellforge where powerful weapons of magic are crafted. The legend had it that deep within the Hellforge rested the Anvil of Fury! This Anvil contained within it the very essence of the demonic underworld...\n \nIt is said that any weapon crafted upon the burning Anvil is imbued with great power. If this anvil is indeed the Anvil of Fury, I may be able to make you a weapon capable of defeating even the darkest lord of Hell! \n \nFind the Anvil for me, and I'll get to work! |",
1, 5, TSFX_SMITH21 },
{ "Nothing yet, eh? Well, keep searching. A weapon forged upon the Anvil could be your best hope, and I am sure that I can make you one of legendary proportions. |",
1, 5, TSFX_SMITH22 },
{ "I can hardly believe it! This is the Anvil of Fury - good work, my friend. Now we'll show those bastards that there are no weapons in Hell more deadly than those made by men! Take this and may Light protect you. |",
1, 5, TSFX_SMITH23 },
{ "Griswold can't sell his anvil. What will he do then? And I'd be angry too if someone took my anvil! |",
1, 6, TSFX_DRUNK14 },
{ "There are many artifacts within the Labyrinth that hold powers beyond the comprehension of mortals. Some of these hold fantastic power that can be used by either the Light or the Darkness. Securing the Anvil from below could shift the course of the Sin War towards the Light. |",
1, 5, TSFX_WITCH14 },
{ "If you were to find this artifact for Griswold, it could put a serious damper on my business here. Awwww, you'll never find it. |",
1, 6, TSFX_PEGBOY13 },
{ "The Gateway of Blood and the Halls of Fire are landmarks of mystic origin. Wherever this book you read from resides it is surely a place of great power.\n \nLegends speak of a pedestal that is carved from obsidian stone and has a pool of boiling blood atop its bone encrusted surface. There are also allusions to Stones of Blood that will open a door that guards an ancient treasure...\n \nThe nature of this treasure is shrouded in speculation, my friend, but it is said that the ancient hero Arkaine placed the holy armor Valor in a secret vault. Arkaine was the first mortal to turn the tide of the Sin War and chase the legions of darkness back to the Burning Hells.\n \nJust before Arkaine died, his armor was hidden away in a secret vault. It is said that when this holy armor is again needed, a hero will arise to don Valor once more. Perhaps you are that hero... |",
1, 3, TSFX_STORY15 },
{ "Every child hears the story of the warrior Arkaine and his mystic armor known as Valor. If you could find its resting place, you would be well protected against the evil in the Labyrinth. |",
1, 6, TSFX_TAVERN13 },
{ "Hmm... it sounds like something I should remember, but I've been so busy learning new cures and creating better elixirs that I must have forgotten. Sorry... |",
1, 6, TSFX_HEALER13 },
{ "The story of the magic armor called Valor is something I often heard the boys talk about. You had better ask one of the men in the village. |",
1, 6, TSFX_BMAID13 },
{ "The armor known as Valor could be what tips the scales in your favor. I will tell you that many have looked for it - including myself. Arkaine hid it well, my friend, and it will take more than a bit of luck to unlock the secrets that have kept it concealed oh, lo these many years. |",
1, 5, TSFX_SMITH14 },
{ "Zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... |", 1, 7, TSFX_DRUNK15 },
{ "Should you find these Stones of Blood, use them carefully. \n \nThe way is fraught with danger and your only hope rests within your self trust. |",
1, 6, TSFX_WITCH15 },
{ "You intend to find the armor known as Valor? \n \nNo one has ever figured out where Arkaine stashed the stuff, and if my contacts couldn't find it, I seriously doubt you ever will either. |",
1, 6, TSFX_PEGBOY14 },
{ "I know of only one legend that speaks of such a warrior as you describe. His story is found within the ancient chronicles of the Sin War...\n \nStained by a thousand years of war, blood and death, the Warlord of Blood stands upon a mountain of his tattered victims. His dark blade screams a black curse to the living; a tortured invitation to any who would stand before this Executioner of Hell.\n \nIt is also written that although he was once a mortal who fought beside the Legion of Darkness during the Sin War, he lost his humanity to his insatiable hunger for blood. |",
1, 5, TSFX_STORY18 },
{ "I am afraid that I haven't heard anything about such a vicious warrior, good master. I hope that you do not have to fight him, for he sounds extremely dangerous. |",
1, 6, TSFX_TAVERN16 },
{ "Cain would be able to tell you much more about something like this than I would ever wish to know. |",
1, 7, TSFX_HEALER16 },
{ "If you are to battle such a fierce opponent, may Light be your guide and your defender. I will keep you in my thoughts. |",
1, 6, TSFX_BMAID16 },
{ "Dark and wicked legends surrounds the one Warlord of Blood. Be well prepared, my friend, for he shows no mercy or quarter. |",
1, 6, TSFX_SMITH17 },
{ "Always you gotta talk about Blood? What about flowers, and sunshine, and that pretty girl that brings the drinks. Listen here, friend - you're obsessive, you know that? |",
1, 5, TSFX_DRUNK17 },
{ "His prowess with the blade is awesome, and he has lived for thousands of years knowing only warfare. I am sorry... I can not see if you will defeat him. |",
1, 5, TSFX_WITCH18 },
{ "I haven't ever dealt with this Warlord you speak of, but he sounds like he's going through a lot of swords. Wouldn't mind supplying his armies... |",
1, 6, TSFX_PEGBOY17 },
{ "My blade sings for your blood, mortal, and by my dark masters it shall not be denied. |",
0, 6, USFX_WARLRD1 },
{ "Griswold speaks of the Heaven Stone that was destined for the enclave located in the east. It was being taken there for further study. This stone glowed with an energy that somehow granted vision beyond that which a normal man could possess. I do not know what secrets it holds, my friend, but finding this stone would certainly prove most valuable. |",
1, 5, TSFX_STORY20 },
{ "The caravan stopped here to take on some supplies for their journey to the east. I sold them quite an array of fresh fruits and some excellent sweetbreads that Garda has just finished baking. Shame what happened to them... |",
1, 6, TSFX_TAVERN18 },
{ "I don't know what it is that they thought they could see with that rock, but I will say this. If rocks are falling from the sky, you had better be careful! |",
1, 6, TSFX_HEALER18 },
{ "Well, a caravan of some very important people did stop here, but that was quite a while ago. They had strange accents and were starting on a long journey, as I recall. \n \nI don't see how you could hope to find anything that they would have been carrying. |",
1, 6, TSFX_BMAID18 },
{ "Stay for a moment - I have a story you might find interesting. A caravan that was bound for the eastern kingdoms passed through here some time ago. It was supposedly carrying a piece of the heavens that had fallen to earth! The caravan was ambushed by cloaked riders just north of here along the roadway. I searched the wreckage for this sky rock, but it was nowhere to be found. If you should find it, I believe that I can fashion something useful from it. |",
1, 5, TSFX_SMITH24 },
{ "I am still waiting for you to bring me that stone from the heavens. I know that I can make something powerful out of it. |",
1, 6, TSFX_SMITH25 },
{ "Let me see that - aye... aye, it is as I believed. Give me a moment...\n \nAh, Here you are. I arranged pieces of the stone within a silver ring that my father left me. I hope it serves you well. |",
1, 5, TSFX_SMITH26 },
{ "I used to have a nice ring; it was a really expensive one, with blue and green and red and silver. Don't remember what happened to it, though. I really miss that ring... |",
1, 5, TSFX_DRUNK19 },
{ "The Heaven Stone is very powerful, and were it any but Griswold who bid you find it, I would prevent it. He will harness its powers and its use will be for the good of us all. |",
1, 5, TSFX_WITCH20 },
{ "If anyone can make something out of that rock, Griswold can. He knows what he is doing, and as much as I try to steal his customers, I respect the quality of his work. |",
1, 6, TSFX_PEGBOY18 },
{ "The witch Adria seeks a black mushroom? I know as much about Black Mushrooms as I do about Red Herrings. Perhaps Pepin the Healer could tell you more, but this is something that cannot be found in any of my stories or books. |",
1, 5, TSFX_STORY21 },
{ "Let me just say this. Both Garda and I would never, EVER serve black mushrooms to our honored guests. If Adria wants some mushrooms in her stew, then that is her business, but I can't help you find any. Black mushrooms... disgusting! |",
1, 5, TSFX_TAVERN19 },
{ "The witch told me that you were searching for the brain of a demon to assist me in creating my elixir. It should be of great value to the many who are injured by those foul beasts, if I can just unlock the secrets I suspect that its alchemy holds. If you can remove the brain of a demon when you kill it, I would be grateful if you could bring it to me. |",
1, 5, TSFX_HEALER26 },
{ "Excellent, this is just what I had in mind. I was able to finish the elixir without this, but it can't hurt to have this to study. Would you please carry this to the witch? I believe that she is expecting it. |",
1, 5, TSFX_HEALER27 },
{ "I think Ogden might have some mushrooms in the storage cellar. Why don't you ask him? |",
1, 7, TSFX_BMAID19 },
{ "If Adria doesn't have one of these, you can bet that's a rare thing indeed. I can offer you no more help than that, but it sounds like... a huge, gargantuan, swollen, bloated mushroom! Well, good hunting, I suppose. |",
1, 5, TSFX_SMITH19 },
{ "Ogden mixes a MEAN black mushroom, but I get sick if I drink that. Listen, listen... here's the secret - moderation is the key! |",
1, 5, TSFX_DRUNK20 },
{ "What do we have here? Interesting, it looks like a book of reagents. Keep your eyes open for a black mushroom. It should be fairly large and easy to identify. If you find it, bring it to me, won't you? |",
1, 5, TSFX_WITCH22 },
{ "It's a big, black mushroom that I need. Now run off and get it for me so that I can use it for a special concoction that I am working on. |",
1, 6, TSFX_WITCH23 },
{ "Yes, this will be perfect for a brew that I am creating. By the way, the healer is looking for the brain of some demon or another so he can treat those who have been afflicted by their poisonous venom. I believe that he intends to make an elixir from it. If you help him find what he needs, please see if you can get a sample of the elixir for me. |",
1, 5, TSFX_WITCH24 },
{ "Why have you brought that here? I have no need for a demon's brain at this time. I do need some of the elixir that the Healer is working on. He needs that grotesque organ that you are holding, and then bring me the elixir. Simple when you think about it, isn't it? |",
1, 5, TSFX_WITCH25 },
{ "What? Now you bring me that elixir from the healer? I was able to finish my brew without it. Why don't you just keep it... |",
1, 6, TSFX_WITCH26 },
{ "I don't have any mushrooms of any size or color for sale. How about something a bit more useful? |",
1, 6, TSFX_PEGBOY19 },
{ "So, the legend of the Map is real. Even I never truly believed any of it! I suppose it is time that I told you the truth about who I am, my friend. You see, I am not all that I seem...\n \nMy true name is Deckard Cain the Elder, and I am the last descendant of an ancient Brotherhood that was dedicated to keeping and safeguarding the secrets of a timeless evil. An evil that quite obviously has now been released...\n \nThe evil that you move against is the dark Lord of Terror - known to mortal men as Diablo. It was he who was imprisoned within the Labyrinth many centuries ago. The Map that you hold now was created ages ago to mark the time when Diablo would rise again from his imprisonment. When the two stars on that map align, Diablo will be at the height of his power. He will be all but invincible...\n \nYou are now in a race against time, my friend! Find Diablo and destroy him before the stars align, for we may never have a chance to rid the world of his evil again! |",
1, 2, TSFX_STORY22 },
{ "Our time is running short! I sense his dark power building and only you can stop him from attaining his full might. |",
1, 6, TSFX_STORY23 },
{ "I am sure that you tried your best, but I fear that even your strength and will may not be enough. Diablo is now at the height of his earthly power, and you will need all your courage and strength to defeat him. May the Light protect and guide you, my friend. I will help in any way that I am able. |",
1, 5, TSFX_STORY24 },
{ "If the witch can't help you and suggests you see Cain, what makes you think that I would know anything? It sounds like this is a very serious matter. You should hurry along and see the storyteller as Adria suggests. |",
1, 6, TSFX_TAVERN20 },
{ "I can't make much of the writing on this map, but perhaps Adria or Cain could help you decipher what this refers to. \n \nI can see that it is a map of the stars in our sky, but any more than that is beyond my talents. |",
1, 6, TSFX_HEALER19 },
{ "The best person to ask about that sort of thing would be our storyteller. \n \nCain is very knowledgeable about ancient writings, and that is easily the oldest looking piece of paper that I have ever seen. |",
1, 6, TSFX_BMAID20 },
{ "I have never seen a map of this sort before. Where'd you get it? Although I have no idea how to read this, Cain or Adria may be able to provide the answers that you seek. |",
1, 6, TSFX_SMITH20 },
{ "Listen here, come close. I don't know if you know what I know, but you have really got somethin' here. That's a map. |",
1, 5, TSFX_DRUNK21 },
{ "Oh, I'm afraid this does not bode well at all. This map of the stars portends great disaster, but its secrets are not mine to tell. The time has come for you to have a very serious conversation with the Storyteller... |",
1, 5, TSFX_WITCH21 },
{ "I've been looking for a map, but that certainly isn't it. You should show that to Adria - she can probably tell you what it is. I'll say one thing; it looks old, and old usually means valuable. |",
1, 5, TSFX_PEGBOY20 },
{ "Pleeeease, no hurt. No Kill. Keep alive and next time good bring to you. |",
1, 6, USFX_GARBUD1 },
{ "Something for you I am making. Again, not kill Gharbad. Live and give good. \n \nYou take this as proof I keep word... |",
1, 6, USFX_GARBUD2 },
{ "Nothing yet! Almost done. \n \nVery powerful, very strong. Live! Live! \n \nNo pain and promise I keep! |",
1, 6, USFX_GARBUD3 },
{ "This too good for you. Very Powerful! You want - you take! |",
1, 6, USFX_GARBUD4 },
{ "What?! Why are you here? All these interruptions are enough to make one insane. Here, take this and leave me to my work. Trouble me no more! |",
1, 6, USFX_ZHAR1 },
{ "Arrrrgh! Your curiosity will be the death of you!!! |", 1, 7, USFX_ZHAR2 },
{ "Hello, my friend. Stay awhile and listen... |", 0, 5, TSFX_STORY25 },
{ "While you are venturing deeper into the Labyrinth you may find tomes of great knowledge hidden there. \n \nRead them carefully for they can tell you things that even I cannot. |",
1, 6, TSFX_STORY26 },
{ "I know of many myths and legends that may contain answers to questions that may arise in your journeys into the Labyrinth. If you come across challenges and questions to which you seek knowledge, seek me out and I will tell you what I can. |",
1, 5, TSFX_STORY27 },
{ "Griswold - a man of great action and great courage. I bet he never told you about the time he went into the Labyrinth to save Wirt, did he? He knows his fair share of the dangers to be found there, but then again - so do you. He is a skilled craftsman, and if he claims to be able to help you in any way, you can count on his honesty and his skill. |",
1, 5, TSFX_STORY28 },
{ "Ogden has owned and run the Rising Sun Inn and Tavern for almost four years now. He purchased it just a few short months before everything here went to hell. He and his wife Garda do not have the money to leave as they invested all they had in making a life for themselves here. He is a good man with a deep sense of responsibility. |",
1, 5, TSFX_STORY29 },
{ "Poor Farnham. He is a disquieting reminder of the doomed assembly that entered into the Cathedral with Lazarus on that dark day. He escaped with his life, but his courage and much of his sanity were left in some dark pit. He finds comfort only at the bottom of his tankard nowadays, but there are occasional bits of truth buried within his constant ramblings. |",
1, 5, TSFX_STORY30 },
{ "The witch, Adria, is an anomaly here in Tristram. She arrived shortly after the Cathedral was desecrated while most everyone else was fleeing. She had a small hut constructed at the edge of town, seemingly overnight, and has access to many strange and arcane artifacts and tomes of knowledge that even I have never seen before. |",
1, 5, TSFX_STORY31 },
{ "The story of Wirt is a frightening and tragic one. He was taken from the arms of his mother and dragged into the labyrinth by the small, foul demons that wield wicked spears. There were many other children taken that day, including the son of King Leoric. The Knights of the palace went below, but never returned. The Blacksmith found the boy, but only after the foul beasts had begun to torture him for their sadistic pleasures. |",
1, 5, TSFX_STORY33 },
{ "Ah, Pepin. I count him as a true friend - perhaps the closest I have here. He is a bit addled at times, but never a more caring or considerate soul has existed. His knowledge and skills are equaled by few, and his door is always open. |",
1, 5, TSFX_STORY34 },
{ "Gillian is a fine woman. Much adored for her high spirits and her quick laugh, she holds a special place in my heart. She stays on at the tavern to support her elderly grandmother who is too sick to travel. I sometimes fear for her safety, but I know that any man in the village would rather die than see her harmed. |",
1, 5, TSFX_STORY35 },
{ "Greetings, good master. Welcome to the Tavern of the Rising Sun! |",
0, 5, TSFX_TAVERN36 },
{ "Many adventurers have graced the tables of my tavern, and ten times as many stories have been told over as much ale. The only thing that I ever heard any of them agree on was this old axiom. Perhaps it will help you. You can cut the flesh, but you must crush the bone. |",
1, 5, TSFX_TAVERN37 },
{ "Griswold the blacksmith is extremely knowledgeable about weapons and armor. If you ever need work done on your gear, he is definitely the man to see. |",
1, 6, TSFX_TAVERN38 },
{ "Farnham spends far too much time here, drowning his sorrows in cheap ale. I would make him leave, but he did suffer so during his time in the Labyrinth. |",
1, 6, TSFX_TAVERN39 },
{ "Adria is wise beyond her years, but I must admit - she frightens me a little. \n \nWell, no matter. If you ever have need to trade in items of sorcery, she maintains a strangely well-stocked hut just across the river. |",
1, 6, TSFX_TAVERN40 },
{ "If you want to know more about the history of our village, the storyteller Cain knows quite a bit about the past. |",
1, 6, TSFX_TAVERN41 },
{ "Wirt is a rapscallion and a little scoundrel. He was always getting into trouble, and it's no surprise what happened to him. \n \nHe probably went fooling about someplace that he shouldn't have been. I feel sorry for the boy, but I don't abide the company that he keeps. |",
1, 6, TSFX_TAVERN43 },
{ "Pepin is a good man - and certainly the most generous in the village. He is always attending to the needs of others, but trouble of some sort or another does seem to follow him wherever he goes... |",
1, 6, TSFX_TAVERN44 },
{ "Gillian, my Barmaid? If it were not for her sense of duty to her grand-dam, she would have fled from here long ago. \n \nGoodness knows I begged her to leave, telling her that I would watch after the old woman, but she is too sweet and caring to have done so. |",
1, 6, TSFX_TAVERN45 },
{ "What ails you, my friend? |", 0, 5, TSFX_HEALER37 },
{ "I have made a very interesting discovery. Unlike us, the creatures in the Labyrinth can heal themselves without the aid of potions or magic. If you hurt one of the monsters, make sure it is dead or it very well may regenerate itself. |",
1, 5, TSFX_HEALER38 },
{ "Before it was taken over by, well, whatever lurks below, the Cathedral was a place of great learning. There are many books to be found there. If you find any, you should read them all, for some may hold secrets to the workings of the Labyrinth. |",
1, 5, TSFX_HEALER39 },
{ "Griswold knows as much about the art of war as I do about the art of healing. He is a shrewd merchant, but his work is second to none. Oh, I suppose that may be because he is the only blacksmith left here. |",
1, 5, TSFX_HEALER40 },
{ "Cain is a true friend and a wise sage. He maintains a vast library and has an innate ability to discern the true nature of many things. If you ever have any questions, he is the person to go to. |",
1, 5, TSFX_HEALER41 },
{ "Even my skills have been unable to fully heal Farnham. Oh, I have been able to mend his body, but his mind and spirit are beyond anything I can do. |",
1, 5, TSFX_HEALER42 },
{ "While I use some limited forms of magic to create the potions and elixirs I store here, Adria is a true sorceress. She never seems to sleep, and she always has access to many mystic tomes and artifacts. I believe her hut may be much more than the hovel it appears to be, but I can never seem to get inside the place. |",
1, 5, TSFX_HEALER43 },
{ "Poor Wirt. I did all that was possible for the child, but I know he despises that wooden peg that I was forced to attach to his leg. His wounds were hideous. No one - and especially such a young child - should have to suffer the way he did. |",
1, 5, TSFX_HEALER45 },
{ "I really don't understand why Ogden stays here in Tristram. He suffers from a slight nervous condition, but he is an intelligent and industrious man who would do very well wherever he went. I suppose it may be the fear of the many murders that happen in the surrounding countryside, or perhaps the wishes of his wife that keep him and his family where they are. |",
1, 5, TSFX_HEALER46 },
{ "Ogden's barmaid is a sweet girl. Her grandmother is quite ill, and suffers from delusions. \n \nShe claims that they are visions, but I have no proof of that one way or the other. |",
1, 6, TSFX_HEALER47 },
{ "Good day! How may I serve you? |", 0, 5, TSFX_BMAID31 },
{ "My grandmother had a dream that you would come and talk to me. She has visions, you know and can see into the future. |",
1, 6, TSFX_BMAID32 },
{ "The woman at the edge of town is a witch! She seems nice enough, and her name, Adria, is very pleasing to the ear, but I am very afraid of her. \n \nIt would take someone quite brave, like you, to see what she is doing out there. |",
1, 6, TSFX_BMAID33 },
{ "Our Blacksmith is a point of pride to the people of Tristram. Not only is he a master craftsman who has won many contests within his guild, but he received praises from our King Leoric himself - may his soul rest in peace. Griswold is also a great hero; just ask Cain. |",
1, 5, TSFX_BMAID34 },
{ "Cain has been the storyteller of Tristram for as long as I can remember. He knows so much, and can tell you just about anything about almost everything. |",
1, 6, TSFX_BMAID35 },
{ "Farnham is a drunkard who fills his belly with ale and everyone else's ears with nonsense. \n \nI know that both Pepin and Ogden feel sympathy for him, but I get so frustrated watching him slip farther and farther into a befuddled stupor every night. |",
1, 6, TSFX_BMAID36 },
{ "Pepin saved my grandmother's life, and I know that I can never repay him for that. His ability to heal any sickness is more powerful than the mightiest sword and more mysterious than any spell you can name. If you ever are in need of healing, Pepin can help you. |",
1, 5, TSFX_BMAID37 },
{ "I grew up with Wirt's mother, Canace. Although she was only slightly hurt when those hideous creatures stole him, she never recovered. I think she died of a broken heart. Wirt has become a mean-spirited youngster, looking only to profit from the sweat of others. I know that he suffered and has seen horrors that I cannot even imagine, but some of that darkness hangs over him still. |",
1, 5, TSFX_BMAID39 },
{ "Ogden and his wife have taken me and my grandmother into their home and have even let me earn a few gold pieces by working at the inn. I owe so much to them, and hope one day to leave this place and help them start a grand hotel in the east. |",
1, 5, TSFX_BMAID40 },
{ "Well, what can I do for ya? |", 0, 5, TSFX_SMITH44 },
{ "If you're looking for a good weapon, let me show this to you. Take your basic blunt weapon, such as a mace. Works like a charm against most of those undying horrors down there, and there's nothing better to shatter skinny little skeletons! |",
1, 5, TSFX_SMITH45 },
{ "The axe? Aye, that's a good weapon, balanced against any foe. Look how it cleaves the air, and then imagine a nice fat demon head in its path. Keep in mind, however, that it is slow to swing - but talk about dealing a heavy blow! |",
1, 5, TSFX_SMITH46 },
{ "Look at that edge, that balance. A sword in the right hands, and against the right foe, is the master of all weapons. Its keen blade finds little to hack or pierce on the undead, but against a living, breathing enemy, a sword will better slice their flesh! |",
1, 5, TSFX_SMITH47 },
{ "Your weapons and armor will show the signs of your struggles against the Darkness. If you bring them to me, with a bit of work and a hot forge, I can restore them to top fighting form. |",
1, 6, TSFX_SMITH48 },
{ "While I have to practically smuggle in the metals and tools I need from caravans that skirt the edges of our damned town, that witch, Adria, always seems to get whatever she needs. If I knew even the smallest bit about how to harness magic as she did, I could make some truly incredible things. |",
1, 5, TSFX_SMITH49 },
{ "Gillian is a nice lass. Shame that her gammer is in such poor health or I would arrange to get both of them out of here on one of the trading caravans. |",
1, 6, TSFX_SMITH50 },
{ "Sometimes I think that Cain talks too much, but I guess that is his calling in life. If I could bend steel as well as he can bend your ear, I could make a suit of court plate good enough for an Emperor! |",
1, 5, TSFX_SMITH51 },
{ "I was with Farnham that night that Lazarus led us into Labyrinth. I never saw the Archbishop again, and I may not have survived if Farnham was not at my side. I fear that the attack left his soul as crippled as, well, another did my leg. I cannot fight this battle for him now, but I would if I could. |",
1, 5, TSFX_SMITH52 },
{ "A good man who puts the needs of others above his own. You won't find anyone left in Tristram - or anywhere else for that matter - who has a bad thing to say about the healer. |",
1, 6, TSFX_SMITH53 },
{ "That lad is going to get himself into serious trouble... or I guess I should say, again. I've tried to interest him in working here and learning an honest trade, but he prefers the high profits of dealing in goods of dubious origin. I cannot hold that against him after what happened to him, but I do wish he would at least be careful. |",
1, 5, TSFX_SMITH55 },
{ "The Innkeeper has little business and no real way of turning a profit. He manages to make ends meet by providing food and lodging for those who occasionally drift through the village, but they are as likely to sneak off into the night as they are to pay him. If it weren't for the stores of grains and dried meats he kept in his cellar, why, most of us would have starved during that first year when the entire countryside was overrun by demons. |",
1, 5, TSFX_SMITH56 },
{ "Can't a fella drink in peace? |", 0, 5, TSFX_DRUNK27 },
{ "The gal who brings the drinks? Oh, yeah, what a pretty lady. So nice, too. |",
1, 6, TSFX_DRUNK28 },
{ "Why don't that old crone do somethin' for a change. Sure, sure, she's got stuff, but you listen to me... she's unnatural. I ain't never seen her eat or drink - and you can't trust somebody who doesn't drink at least a little. |",
1, 5, TSFX_DRUNK29 },
{ "Cain isn't what he says he is. Sure, sure, he talks a good story... some of 'em are real scary or funny... but I think he knows more than he knows he knows. |",
1, 5, TSFX_DRUNK30 },
{ "Griswold? Good old Griswold. I love him like a brother! We fought together, you know, back when... we... Lazarus... Lazarus... Lazarus!!! |",
1, 5, TSFX_DRUNK31 },
{ "Hehehe, I like Pepin. He really tries, you know. Listen here, you should make sure you get to know him. Good fella like that with people always wantin' help. Hey, I guess that would be kinda like you, huh hero? I was a hero too... |",
1, 5, TSFX_DRUNK32 },
{ "Wirt is a kid with more problems than even me, and I know all about problems. Listen here - that kid is gotta sweet deal, but he's been there, you know? Lost a leg! Gotta walk around on a piece of wood. So sad, so sad... |",
1, 5, TSFX_DRUNK34 },
{ "Ogden is the best man in town. I don't think his wife likes me much, but as long as she keeps tappin' kegs, I'll like her just fine. Seems like I been spendin' more time with Ogden than most, but he's so good to me... |",
1, 5, TSFX_DRUNK35 },
{ "I wanna tell ya sumthin', 'cause I know all about this stuff. It's my specialty. This here is the best... theeeee best! That other ale ain't no good since those stupid dogs... |",
1, 5, TSFX_DRUNK23 },
{ "No one ever lis... listens to me. Somewhere - I ain't too sure - but somewhere under the church is a whole pile o' gold. Gleamin' and shinin' and just waitin' for someone to get it. |",
1, 5, TSFX_DRUNK24 },
{ "I know you gots your own ideas, and I know you're not gonna believe this, but that weapon you got there - it just ain't no good against those big brutes! Oh, I don't care what Griswold says, they can't make anything like they used to in the old days... |",
1, 5, TSFX_DRUNK25 },
{ "If I was you... and I ain't... but if I was, I'd sell all that stuff you got and get out of here. That boy out there... He's always got somethin good, but you gotta give him some gold or he won't even show you what he's got. |",
1, 5, TSFX_DRUNK26 },
{ "I sense a soul in search of answers... |", 0, 5, TSFX_WITCH38 },
{ "Wisdom is earned, not given. If you discover a tome of knowledge, devour its words. Should you already have knowledge of the arcane mysteries scribed within a book, remember - that level of mastery can always increase. |",
1, 5, TSFX_WITCH39 },
{ "The greatest power is often the shortest lived. You may find ancient words of power written upon scrolls of parchment. The strength of these scrolls lies in the ability of either apprentice or adept to cast them with equal ability. Their weakness is that they must first be read aloud and can never be kept at the ready in your mind. Know also that these scrolls can be read but once, so use them with care. |",
1, 5, TSFX_WITCH40 },
{ "Though the heat of the sun is beyond measure, the mere flame of a candle is of greater danger. No energies, no matter how great, can be used without the proper focus. For many spells, ensorcelled Staves may be charged with magical energies many times over. I have the ability to restore their power - but know that nothing is done without a price. |",
1, 5, TSFX_WITCH41 },
{ "The sum of our knowledge is in the sum of its people. Should you find a book or scroll that you cannot decipher, do not hesitate to bring it to me. If I can make sense of it I will share what I find. |",
1, 5, TSFX_WITCH42 },
{ "To a man who only knows Iron, there is no greater magic than Steel. The blacksmith Griswold is more of a sorcerer than he knows. His ability to meld fire and metal is unequaled in this land. |",
1, 5, TSFX_WITCH43 },
{ "Corruption has the strength of deceit, but innocence holds the power of purity. The young woman Gillian has a pure heart, placing the needs of her matriarch over her own. She fears me, but it is only because she does not understand me. |",
1, 5, TSFX_WITCH44 },
{ "A chest opened in darkness holds no greater treasure than when it is opened in the light. The storyteller Cain is an enigma, but only to those who do not look. His knowledge of what lies beneath the cathedral is far greater than even he allows himself to realize. |",
1, 5, TSFX_WITCH45 },
{ "The higher you place your faith in one man, the farther it has to fall. Farnham has lost his soul, but not to any demon. It was lost when he saw his fellow townspeople betrayed by the Archbishop Lazarus. He has knowledge to be gleaned, but you must separate fact from fantasy. |",
1, 5, TSFX_WITCH46 },
{ "The hand, the heart and the mind can perform miracles when they are in perfect harmony. The healer Pepin sees into the body in a way that even I cannot. His ability to restore the sick and injured is magnified by his understanding of the creation of elixirs and potions. He is as great an ally as you have in Tristram. |",
1, 5, TSFX_WITCH47 },
{ "There is much about the future we cannot see, but when it comes it will be the children who wield it. The boy Wirt has a blackness upon his soul, but he poses no threat to the town or its people. His secretive dealings with the urchins and unspoken guilds of nearby towns gain him access to many devices that cannot be easily found in Tristram. While his methods may be reproachful, Wirt can provide assistance for your battle against the encroaching Darkness. |",
1, 4, TSFX_WITCH49 },
{ "Earthen walls and thatched canopy do not a home create. The innkeeper Ogden serves more of a purpose in this town than many understand. He provides shelter for Gillian and her matriarch, maintains what life Farnham has left to him, and provides an anchor for all who are left in the town to what Tristram once was. His tavern, and the simple pleasures that can still be found there, provide a glimpse of a life that the people here remember. It is that memory that continues to feed their hopes for your success. |",
1, 4, TSFX_WITCH50 },
{ "Pssst... over here... |", 0, 5, TSFX_PEGBOY32 },
{ "Not everyone in Tristram has a use - or a market - for everything you will find in the labyrinth. Not even me, as hard as that is to believe. \n \nSometimes, only you will be able to find a purpose for some things. |",
1, 6, TSFX_PEGBOY33 },
{ "Don't trust everything the drunk says. Too many ales have fogged his vision and his good sense. |",
1, 6, TSFX_PEGBOY34 },
{ "In case you haven't noticed, I don't buy anything from Tristram. I am an importer of quality goods. If you want to peddle junk, you'll have to see Griswold, Pepin or that witch, Adria. I'm sure that they will snap up whatever you can bring them... |",
1, 5, TSFX_PEGBOY35 },
{ "I guess I owe the blacksmith my life - what there is of it. Sure, Griswold offered me an apprenticeship at the smithy, and he is a nice enough guy, but I'll never get enough money to... well, let's just say that I have definite plans that require a large amount of gold. |",
1, 5, TSFX_PEGBOY36 },
{ "If I were a few years older, I would shower her with whatever riches I could muster, and let me assure you I can get my hands on some very nice stuff. Gillian is a beautiful girl who should get out of Tristram as soon as it is safe. Hmmm... maybe I'll take her with me when I go... |",
1, 5, TSFX_PEGBOY37 },
{ "Cain knows too much. He scares the life out of me - even more than that woman across the river. He keeps telling me about how lucky I am to be alive, and how my story is foretold in legend. I think he's off his crock. |",
1, 5, TSFX_PEGBOY38 },
{ "Farnham - now there is a man with serious problems, and I know all about how serious problems can be. He trusted too much in the integrity of one man, and Lazarus led him into the very jaws of death. Oh, I know what it's like down there, so don't even start telling me about your plans to destroy the evil that dwells in that Labyrinth. Just watch your legs... |",
1, 5, TSFX_PEGBOY39 },
{ "As long as you don't need anything reattached, old Pepin is as good as they come. \n \nIf I'd have had some of those potions he brews, I might still have my leg... |",
1, 6, TSFX_PEGBOY40 },
{ "Adria truly bothers me. Sure, Cain is creepy in what he can tell you about the past, but that witch can see into your past. She always has some way to get whatever she needs, too. Adria gets her hands on more merchandise than I've seen pass through the gates of the King's Bazaar during High Festival. |",
1, 5, TSFX_PEGBOY42 },
{ "Ogden is a fool for staying here. I could get him out of town for a very reasonable price, but he insists on trying to make a go of it with that stupid tavern. I guess at the least he gives Gillian a place to work, and his wife Garda does make a superb Shepherd's pie... |",
1, 5, TSFX_PEGBOY43 },
{ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written. |",
1, 5, PS_WARR1 },
{ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken... |",
1, 6, PS_WARR10 },
{ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind. |\n",
1, 5, PS_WARR11 },
{ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and man alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood. |",
1, 5, PS_WARR12 },
{ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written. |",
1, 5, PS_MAGE1 },
{ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken... |",
1, 6, PS_MAGE10 },
{ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind. |\n",
1, 4, PS_MAGE11 },
{ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and man alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood. |",
1, 5, PS_MAGE12 },
{ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written. |",
1, 5, PS_ROGUE1 },
{ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken... |",
1, 5, PS_ROGUE10 },
{ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind. |\n",
1, 5, PS_ROGUE11 },
{ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and man alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood. |",
1, 5, PS_ROGUE12 },
{ " |", 0, 5, TSFX_COW1 },
{ " |", 0, 5, TSFX_COW2 },
{ "Take heed and bear witness to the truths that lie herein, for they are the last legacy of the Horadrim. There is a war that rages on even now, beyond the fields that we know - between the utopian kingdoms of the High Heavens and the chaotic pits of the Burning Hells. This war is known as the Great Conflict, and it has raged and burned longer than any of the stars in the sky. Neither side ever gains sway for long as the forces of Light and Darkness constantly vie for control over all creation. |",
1, 5, PS_NAR1 },
{ "Take heed and bear witness to the truths that lie herein, for they are the last legacy of the Horadrim. When the Eternal Conflict between the High Heavens and the Burning Hells falls upon mortal soil, it is called the Sin War. Angels and Demons walk amongst humanity in disguise, fighting in secret, away from the prying eyes of mortals. Some daring, powerful mortals have even allied themselves with either side, and helped to dictate the course of the Sin War. |",
1, 4, PS_NAR2 },
{ "Take heed and bear witness to the truths that lie herein, for they are the last legacy of the Horadrim. Nearly three hundred years ago, it came to be known that the Three Prime Evils of the Burning Hells had mysteriously come to our world. The Three Brothers ravaged the lands of the east for decades, while humanity was left trembling in their wake. Our Order - the Horadrim - was founded by a group of secretive magi to hunt down and capture the Three Evils once and for all.\n \nThe original Horadrim captured two of the Three within powerful artifacts known as Soulstones and buried them deep beneath the desolate eastern sands. The third Evil escaped capture and fled to the west with many of the Horadrim in pursuit. The Third Evil - known as Diablo, the Lord of Terror - was eventually captured, his essence set in a Soulstone and buried within this Labyrinth.\n \nBe warned that the soulstone must be kept from discovery by those not of the faith. If Diablo were to be released, he would seek a body that is easily controlled as he would be very weak - perhaps that of an old man or a child. |",
1, 3, PS_NAR3 },
{ "So it came to be that there was a great revolution within the Burning Hells known as The Dark Exile. The Lesser Evils overthrew the Three Prime Evils and banished their spirit forms to the mortal realm. The demons Belial (the Lord of Lies) and Azmodan (the Lord of Sin) fought to claim rulership of Hell during the absence of the Three Brothers. All of Hell polarized between the factions of Belial and Azmodan while the forces of the High Heavens continually battered upon the very Gates of Hell. |",
1, 4, PS_NAR4 },
{ "Many demons traveled to the mortal realm in search of the Three Brothers. These demons were followed to the mortal plane by Angels who hunted them throughout the vast cities of the East. The Angels allied themselves with a secretive Order of mortal magi named the Horadrim, who quickly became adept at hunting demons. They also made many dark enemies in the underworlds. |",
1, 5, PS_NAR5 },
{ "So it came to be that the Three Prime Evils were banished in spirit form to the mortal realm and after sewing chaos across the East for decades, they were hunted down by the cursed Order of the mortal Horadrim. The Horadrim used artifacts called Soulstones to contain the essence of Mephisto, the Lord of Hatred and his brother Baal, the Lord of Destruction. The youngest brother - Diablo, the Lord of Terror - escaped to the west.\n \nEventually the Horadrim captured Diablo within a Soulstone as well, and buried him under an ancient, forgotten Cathedral. There, the Lord of Terror sleeps and awaits the time of his rebirth. Know ye that he will seek a body of youth and power to possess - one that is innocent and easily controlled. He will then arise to free his Brothers and once more fan the flames of the Sin War... |",
1, 3, PS_NAR6 },
{ "All praises to Diablo - Lord of Terror and Survivor of The Dark Exile. When he awakened from his long slumber, my Lord and Master spoke to me of secrets that few mortals know. He told me the kingdoms of the High Heavens and the pits of the Burning Hells engage in an eternal war. He revealed the powers that have brought this discord to the realms of man. My lord has named the battle for this world and all who exist here the Sin War. |",
1, 4, PS_NAR7 },
{ "Glory and Approbation to Diablo - Lord of Terror and Leader of the Three. My Lord spoke to me of his two Brothers, Mephisto and Baal, who were banished to this world long ago. My Lord wishes to bide his time and harness his awesome power so that he may free his captive brothers from their tombs beneath the sands of the east. Once my Lord releases his Brothers, the Sin War will once again know the fury of the Three. |",
1, 4, PS_NAR8 },
{ "Hail and Sacrifice to Diablo - Lord of Terror and Destroyer of Souls. When I awoke my Master from his sleep, he attempted to possess a mortal's form. Diablo attempted to claim the body of King Leoric, but my Master was too weak from his imprisonment. My Lord required a simple and innocent anchor to this world, and so found the boy Albrecht to be perfect for the task. While the good King Leoric was left maddened by Diablo's unsuccessful possession, I kidnapped his son Albrecht and brought him before my Master. I now await Diablo's call and pray that I will be rewarded when he at last emerges as the Lord of this world. |",
1, 3, PS_NAR9 },
{ "Thank goodness you've returned!\nMuch has changed since you lived here, my friend. All was peaceful until the dark riders came and destroyed our village. Many were cut down where they stood, and those who took up arms were slain or dragged away to become slaves - or worse. The church at the edge of town has been desecrated and is being used for dark rituals. The screams that echo in the night are inhuman, but some of our townsfolk may yet survive. Follow the path that lies between my tavern and the blacksmith shop to find the church and save who you can. \n \nPerhaps I can tell you more if we speak again. Good luck.|",
1, 5, TSFX_TAVERN0 }
};
int gdwAllTextEntries = 259; /* unused */

13
Source/textdat.h Normal file
View File

@ -0,0 +1,13 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
extern TextDataStruct alltext[259];
extern int gdwAllTextEntries;

1562
Source/themes.cpp Normal file

File diff suppressed because it is too large Load Diff

68
Source/themes.h Normal file
View File

@ -0,0 +1,68 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//themes
extern int numthemes; // idb
extern bool armorFlag; // weak
extern int ThemeGoodIn[4];
extern bool weaponFlag; // weak
extern bool treasureFlag; // weak
extern bool mFountainFlag; // weak
extern bool cauldronFlag; // weak
extern bool tFountainFlag; // weak
extern int zharlib; // weak
extern int themex; // idb
extern int themey; // idb
extern int themeVar1; // idb
extern ThemeStruct themes[50];
extern bool pFountainFlag; // weak
extern bool bFountainFlag; // weak
extern bool bCrossFlag; // weak
bool __fastcall TFit_Shrine(int i);
bool __fastcall TFit_Obj5(int t);
bool __fastcall TFit_SkelRoom(int t);
bool __fastcall TFit_GoatShrine(int t);
bool __fastcall CheckThemeObj3(int xp, int yp, int t, int f);
bool __fastcall TFit_Obj3(int t);
bool __fastcall CheckThemeReqs(int t);
bool __fastcall SpecialThemeFit(int i, int t);
bool __fastcall CheckThemeRoom(int tv);
void __cdecl InitThemes();
void __cdecl HoldThemeRooms();
void __fastcall PlaceThemeMonsts(int t, int f);
void __fastcall Theme_Barrel(int t);
void __fastcall Theme_Shrine(int t);
void __fastcall Theme_MonstPit(int t);
void __fastcall Theme_SkelRoom(int t);
void __fastcall Theme_Treasure(int t);
void __fastcall Theme_Library(int t);
void __fastcall Theme_Torture(int t);
void __fastcall Theme_BloodFountain(int t);
void __fastcall Theme_Decap(int t);
void __fastcall Theme_PurifyingFountain(int t);
void __fastcall Theme_ArmorStand(int t);
void __fastcall Theme_GoatShrine(int t);
void __fastcall Theme_Cauldron(int t);
void __fastcall Theme_MurkyFountain(int t);
void __fastcall Theme_TearFountain(int t);
void __fastcall Theme_BrnCross(int t);
void __fastcall Theme_WeaponRack(int t);
void __cdecl UpdateL4Trans();
void __cdecl CreateThemeRooms();
/* rdata */
extern int ThemeGood[4];
extern int trm5x[25];
extern int trm5y[25];
extern int trm3x[9];
extern int trm3y[9];

87
Source/tmsg.cpp Normal file
View File

@ -0,0 +1,87 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
TMsg *sgpTimedMsgHead;
//----- (0045E08C) --------------------------------------------------------
int __fastcall tmsg_get(unsigned char *pbMsg, char bLen)
{
unsigned char *v2; // ebx
DWORD v3; // eax
TMsg *v4; // esi
size_t dwMaxLen; // edi
v2 = pbMsg;
if ( !sgpTimedMsgHead )
return 0;
v3 = GetTickCount();
v4 = sgpTimedMsgHead;
if ( (signed int)(*(_DWORD *)&sgpTimedMsgHead[1] - v3) >= 0 )
return 0;
//sgpTimedMsgHead = (TMsg *)*sgpTimedMsgHead; /* fix */
dwMaxLen = (unsigned char)v4[2].hdr.next;
memcpy(v2, (char *)&v4[2] + 1, dwMaxLen);
mem_free_dbg(v4);
return dwMaxLen;
}
//----- (0045E0D7) --------------------------------------------------------
void __fastcall tmsg_add(unsigned char *pbMsg, char bLen)
{
char v2; // bl
unsigned char *v3; // ebp
size_t v4; // edi
TMsg *v5; // eax
TMsg *v6; // esi
TMsg *v8; // ecx
TMsg **v9; // eax
v2 = bLen;
v3 = pbMsg;
v4 = (unsigned char)bLen;
v5 = (TMsg *)DiabloAllocPtr((unsigned char)bLen + 12);
v6 = v5;
// *v5 = 0; /* fix */
v6[2].hdr.next = v2;
v6[1].hdr.next = GetTickCount() + 500;
memcpy((char *)&v6[2] + 1, v3, v4);
v8 = sgpTimedMsgHead;
v9 = &sgpTimedMsgHead;
/*while ( v8 )
{
v9 = (TMsg **)v8;
v8 = (TMsg *)*v8;
} fix */
*v9 = v6;
}
//----- (0045E12A) --------------------------------------------------------
void __cdecl tmsg_cleanup()
{
TMsg *v0; // eax
//TMsg *v1; // esi
v0 = sgpTimedMsgHead;
if ( sgpTimedMsgHead )
{
/* do
{
v1 = (TMsg *)*v0;
sgpTimedMsgHead = 0;
mem_free_dbg(v0);
v0 = v1;
sgpTimedMsgHead = v1;
}
while ( v1 ); fix */
}
}

17
Source/tmsg.h Normal file
View File

@ -0,0 +1,17 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//tmsg
extern TMsg *sgpTimedMsgHead;
int __fastcall tmsg_get(unsigned char *pbMsg, char bLen);
void __fastcall tmsg_add(unsigned char *pbMsg, char bLen);
void __cdecl tmsg_cleanup();

1753
Source/town.cpp Normal file

File diff suppressed because it is too large Load Diff

30
Source/town.h Normal file
View File

@ -0,0 +1,30 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
void __fastcall town_clear_upper_buf(int a1);
void __fastcall town_clear_low_buf(int y_related);
void __fastcall town_draw_clipped_e_flag(void *buffer, int x, int y, int sx, int sy);
void __fastcall town_draw_clipped_town(void *unused, int x, int y, int sx, int sy, int some_flag);
void __fastcall town_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag);
void __fastcall town_draw_clipped_e_flag_2(void *buffer, int x, int y, int a4, int a5, int sx, int sy);
void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, int sx, int sy, int some_flag);
void __fastcall town_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall town_draw_e_flag(void *buffer, int x, int y, int a4, int dir, int sx, int sy);
void __fastcall town_draw_town_all(void *buffer, int x, int y, int a4, int dir, int sx, int sy, int some_flag);
void __fastcall town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall T_DrawGame(int x, int y);
void __fastcall T_DrawZoom(int x, int y);
void __fastcall T_DrawView(int StartX, int StartY);
void __cdecl town_init_dpiece_defs_map();
void __fastcall T_FillSector(unsigned char *P3Tiles, unsigned char *pSector, int xi, int yi, int w, int h);
void __fastcall T_FillTile(unsigned char *P3Tiles, int xx, int yy, int t);
void __cdecl T_Pass3();
void __fastcall CreateTown(int entry);

1541
Source/towners.cpp Normal file

File diff suppressed because it is too large Load Diff

69
Source/towners.h Normal file
View File

@ -0,0 +1,69 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//towners
extern int storeflag; // weak
extern int sgnCowMsg; // weak
extern int numtowners; // idb
extern int sgdwCowClicks; // weak
extern int bannerflag; // weak // unused 0x6AAC28
extern int boyloadflag; // weak
extern void *pCowCels; // idb
extern TownerStruct towner[16];
int __fastcall GetActiveTowner(int t);
void __fastcall SetTownerGPtrs(void *pData, void **pAnim);
void __fastcall NewTownerAnim(int tnum, void *pAnim, int numFrames, int Delay);
void __fastcall InitTownerInfo(int i, int w, bool sel, int t, int x, int y, int ao, int tp);
void __fastcall InitQstSnds(int i);
void __cdecl InitSmith();
void __cdecl InitBarOwner();
void __cdecl InitTownDead();
void __cdecl InitWitch();
void __cdecl InitBarmaid();
void __cdecl InitBoy();
void __cdecl InitHealer();
void __cdecl InitTeller();
void __cdecl InitDrunk();
void __cdecl InitCows();
void __cdecl InitTowners();
void __cdecl FreeTownerGFX();
void __fastcall TownCtrlMsg(int i);
void __cdecl TownBlackSmith();
void __cdecl TownBarOwner();
void __cdecl TownDead();
void __cdecl TownHealer();
void __cdecl TownStory();
void __cdecl TownDrunk();
void __cdecl TownBoy();
void __cdecl TownWitch();
void __cdecl TownBarMaid();
void __cdecl TownCow();
void __cdecl ProcessTowners();
ItemStruct *__fastcall PlrHasItem(int pnum, int item, int *i);
void __fastcall TownerTalk(int t);
void __fastcall TalkToTowner(int p, int t);
void __fastcall CowSFX(int pnum);
/* data */
extern int snSFX[3][3];
/* rdata */
extern char AnimOrder[6][148];
extern int TownCowX[3];
extern int TownCowY[3];
extern int TownCowDir[3];
extern int cowoffx[8];
extern int cowoffy[8];
extern QuestTalkData Qtalklist[11];
extern int CowPlaying;

89
Source/track.cpp Normal file
View File

@ -0,0 +1,89 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
bool sgbIsScrolling; // weak
int track_cpp_init_value; // weak
int sgdwLastWalk; // weak
bool sgbIsWalking; // weak
int track_inf = 0x7F800000; // weak
//----- (004618AA) --------------------------------------------------------
struct track_cpp_init
{
track_cpp_init()
{
track_cpp_init_value = track_inf;
}
} _track_cpp_init;
// 4802D0: using guessed type int track_inf;
// 6ABABC: using guessed type int track_cpp_init_value;
//----- (004618B5) --------------------------------------------------------
void __cdecl track_process()
{
int v0; // eax
DWORD v1; // eax
if ( sgbIsWalking )
{
if ( cursmx >= 0 && cursmx < 111 && cursmy >= 0 && cursmy < 111 )
{
v0 = myplr;
if ( (plr[myplr]._pVar8 > 6 || plr[v0]._pmode == PM_STAND)
&& (cursmx != plr[v0]._ptargx || cursmy != plr[v0]._ptargy) )
{
v1 = GetTickCount();
if ( v1 - sgdwLastWalk >= 300 )
{
sgdwLastWalk = v1;
NetSendCmdLoc(1u, CMD_WALKXY, cursmx, cursmy);
if ( !sgbIsScrolling )
sgbIsScrolling = 1;
}
}
}
}
}
// 6ABAB8: using guessed type char sgbIsScrolling;
// 6ABAC0: using guessed type int sgdwLastWalk;
// 6ABAC4: using guessed type int sgbIsWalking;
//----- (00461953) --------------------------------------------------------
void __fastcall track_repeat_walk(bool rep)
{
if ( sgbIsWalking != rep )
{
sgbIsWalking = rep;
if ( rep )
{
sgbIsScrolling = 0;
sgdwLastWalk = GetTickCount() - 50;
NetSendCmdLoc(1u, CMD_WALKXY, cursmx, cursmy);
}
else if ( sgbIsScrolling )
{
sgbIsScrolling = 0;
}
}
}
// 6ABAB8: using guessed type char sgbIsScrolling;
// 6ABAC0: using guessed type int sgdwLastWalk;
// 6ABAC4: using guessed type int sgbIsWalking;
//----- (0046199F) --------------------------------------------------------
bool __cdecl track_isscrolling()
{
return sgbIsScrolling;
}
// 6ABAB8: using guessed type char sgbIsScrolling;

25
Source/track.h Normal file
View File

@ -0,0 +1,25 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//track
extern bool sgbIsScrolling; // weak
extern int track_cpp_init_value; // weak
extern int sgdwLastWalk; // weak
extern bool sgbIsWalking; // weak
void __cdecl track_cpp_init();
void __cdecl track_process();
void __fastcall track_repeat_walk(bool rep);
bool __cdecl track_isscrolling();
/* data */
extern int track_inf; // weak

1412
Source/trigs.cpp Normal file

File diff suppressed because it is too large Load Diff

54
Source/trigs.h Normal file
View File

@ -0,0 +1,54 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//trigs
extern int trigflag[5];
extern TriggerStruct trigs[5];
extern int TWarpFrom; // weak
void __cdecl InitNoTriggers();
void __cdecl InitTownTriggers();
void __cdecl InitL1Triggers();
void __cdecl InitL2Triggers();
void __cdecl InitL3Triggers();
void __cdecl InitL4Triggers();
void __cdecl InitSKingTriggers();
void __cdecl InitSChambTriggers();
void __cdecl InitPWaterTriggers();
void __cdecl InitVPTriggers();
unsigned char __cdecl ForceTownTrig();
unsigned char __cdecl ForceL1Trig();
unsigned char __cdecl ForceL2Trig();
unsigned char __cdecl ForceL3Trig();
unsigned char __cdecl ForceL4Trig();
void __cdecl Freeupstairs();
unsigned char __cdecl ForceSKingTrig();
unsigned char __cdecl ForceSChambTrig();
unsigned char __cdecl ForcePWaterTrig();
void __cdecl CheckTrigForce();
void __cdecl CheckTriggers();
/* rdata */
extern int TownDownList[11];
extern int TownWarp1List[13];
extern int L1UpList[12];
extern int L1DownList[10];
extern int L2UpList[3];
extern int L2DownList[5];
extern int L2TWarpUpList[3];
extern int L3UpList[15];
extern int L3DownList[9];
extern int L3TWarpUpList[14];
extern int L4UpList[4];
extern int L4DownList[6];
extern int L4TWarpUpList[4];
extern int L4PentaList[33];

340
Source/wave.cpp Normal file
View File

@ -0,0 +1,340 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
#include "../types.h"
int wave_cpp_init_value; // weak
int wave_inf = 0x7F800000; // weak
//----- (00462C72) --------------------------------------------------------
struct wave_cpp_init
{
wave_cpp_init()
{
wave_cpp_init_value = wave_inf;
}
} _wave_cpp_init;
// 4802D4: using guessed type int wave_inf;
// 6ABB34: using guessed type int wave_cpp_init_value;
//----- (00462C7D) --------------------------------------------------------
bool __fastcall WCloseFile(void *file)
{
return SFileCloseFile(file);
}
//----- (00462C84) --------------------------------------------------------
int __fastcall WGetFileSize(HANDLE hsFile, unsigned long *a2)
{
unsigned long *v2; // edi
HANDLE i; // esi
int result; // eax
int a2a; // [esp+8h] [ebp-4h]
a2a = 0;
v2 = a2;
for ( i = hsFile; ; WGetFileArchive(i, &a2a, 0) )
{
result = SFileGetFileSize(i, v2);
if ( result )
break;
}
return result;
}
//----- (00462CAF) --------------------------------------------------------
void __fastcall WGetFileArchive(HANDLE hsFile, int *a2, char *dwInitParam)
{
int *v3; // esi
HANDLE v4; // edi
//int v5; // eax
//int v6; // eax
HANDLE archive; // [esp+8h] [ebp-4h]
v3 = a2;
v4 = hsFile;
if ( (unsigned int)*a2 >= 5 )
FileErrDlg(dwInitParam);
if ( v4 && SFileGetFileArchive(v4, &archive) && archive != diabdat_mpq )
{
Sleep(0x14u);
++*v3;
}
else
{
//_LOBYTE(v6) = InsertCDDlg();
if ( !InsertCDDlg() )
FileErrDlg(dwInitParam);
}
}
//----- (00462D06) --------------------------------------------------------
int __fastcall WOpenFile(char *dwInitParam, HANDLE *phsFile, int a3)
{
HANDLE *v3; // edi
char *i; // esi
// int v5; // eax
int a2a; // [esp+8h] [ebp-4h]
a2a = 0;
v3 = phsFile;
for ( i = dwInitParam; ; WGetFileArchive(0, &a2a, i) )
{
//_LOBYTE(v5) = SFileOpenFile(i, v3);
if ( SFileOpenFile(i, v3) )
return 1;
if ( a3 && SErrGetLastError() == 2 )
break;
}
return 0;
}
//----- (00462D48) --------------------------------------------------------
char __fastcall WReadFile(HANDLE hsFile, char *buf, int a3)
{
char *v3; // ebx
HANDLE v4; // edi
int v5; // eax
int nread; // [esp+Ch] [ebp-Ch]
int offset; // [esp+10h] [ebp-8h]
int a2a; // [esp+14h] [ebp-4h]
v3 = buf;
v4 = hsFile;
a2a = 0;
for ( offset = WSetFilePointer(hsFile, 0, 0, 1); ; WSetFilePointer(v4, offset, 0, 0) )
{
v5 = SFileReadFile(v4, v3, a3, (unsigned long *)&nread, 0);
if ( v5 )
break;
WGetFileArchive(v4, &a2a, 0);
}
return v5;
}
//----- (00462D9A) --------------------------------------------------------
int __fastcall WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence)
{
int v4; // edi
HANDLE i; // esi
int result; // eax
int a2; // [esp+8h] [ebp-4h]
a2 = 0;
v4 = offset;
for ( i = file1; ; WGetFileArchive(i, &a2, 0) )
{
result = SFileSetFilePointer(i, v4, file2, whence);
if ( result != -1 )
break;
}
return result;
}
//----- (00462DCE) --------------------------------------------------------
int __fastcall LoadWaveFormat(HANDLE hsFile, WAVEFORMATEX *pwfx)
{
WAVEFORMATEX *v2; // esi
int v3; // esi
MEMFILE wave_file; // [esp+4h] [ebp-1Ch]
v2 = pwfx;
AllocateMemFile(hsFile, &wave_file, 0);
v3 = ReadWaveFile(&wave_file, v2, 0);
FreeMemFile(&wave_file);
return v3;
}
//----- (00462DFC) --------------------------------------------------------
void *__fastcall AllocateMemFile(HANDLE hsFile, MEMFILE *pMemFile, unsigned int a3)
{
MEMFILE *v3; // esi
HANDLE v4; // edi
unsigned int v5; // eax
unsigned int v6; // ecx
void *result; // eax
v3 = pMemFile;
v4 = hsFile;
memset(pMemFile, 0, 0x1Cu);
v5 = WGetFileSize(v4, 0);
v6 = 4096;
v3->end = v5;
if ( a3 > 0x1000 )
v6 = a3;
v3->buf_len = v6;
if ( v6 >= v5 )
v6 = v5;
v3->buf_len = v6;
result = DiabloAllocPtr(v6);
v3->file = (int)v4;
v3->buf = (char *)result;
return result;
}
//----- (00462E45) --------------------------------------------------------
void __fastcall FreeMemFile(MEMFILE *pMemFile)
{
MEMFILE *v1; // eax
char *v2; // ecx
v1 = pMemFile;
v2 = pMemFile->buf;
v1->buf = 0;
mem_free_dbg(v2);
}
//----- (00462E53) --------------------------------------------------------
int __fastcall ReadWaveFile(MEMFILE *pMemFile, WAVEFORMATEX *pwfx, int *a3)
{
WAVEFORMATEX *v3; // esi
MEMFILE *v4; // edi
WORD v5; // ax
int result; // eax
int a2a[5]; // [esp+8h] [ebp-2Ch]
PCMWAVEFORMAT v8; // [esp+1Ch] [ebp-18h]
int v9[2]; // [esp+2Ch] [ebp-8h]
v3 = pwfx;
v4 = pMemFile;
if ( !ReadMemFile(pMemFile, a2a, 0xCu)
|| a2a[0] != 'FFIR'
|| a2a[2] != 'EVAW'
|| !ReadWaveSection(v4, ' tmf', v9)
|| v9[0] < 0x10u
|| !ReadMemFile(v4, &v8, 0x10u)
|| SeekMemFile(v4, v9[0] - 16, FILE_CURRENT) == -1 )
{
return 0;
}
v5 = v8.wf.wFormatTag;
v3->cbSize = 0;
v3->wFormatTag = v5;
v3->nChannels = v8.wf.nChannels;
v3->nSamplesPerSec = v8.wf.nSamplesPerSec;
v3->nAvgBytesPerSec = v8.wf.nAvgBytesPerSec;
v3->nBlockAlign = v8.wf.nBlockAlign;
v3->wBitsPerSample = v8.wBitsPerSample;
if ( a3 )
result = ReadWaveSection(v4, 'atad', a3);
else
result = 1;
return result;
}
//----- (00462F1D) --------------------------------------------------------
int __fastcall ReadMemFile(MEMFILE *pMemFile, void *lpBuf, size_t a3)
{
size_t v3; // ebx
void *v4; // ebp
MEMFILE *v5; // esi
size_t v6; // edi
v3 = a3;
v4 = lpBuf;
v5 = pMemFile;
if ( !a3 )
return 1;
while ( 1 )
{
if ( !v5->bytes_to_read )
FillMemFile(v5);
v6 = v5->bytes_to_read;
if ( v3 < v6 )
v6 = v3;
if ( !v6 )
break;
memcpy(v4, &v5->buf[v5->dist], v6);
v5->offset += v6;
v5->dist += v6;
v5->bytes_to_read -= v6;
v3 -= v6;
if ( !v3 )
return 1;
}
return 0;
}
//----- (00462F73) --------------------------------------------------------
void __fastcall FillMemFile(MEMFILE *pMemFile)
{
MEMFILE *v1; // esi
unsigned int v2; // edi
v1 = pMemFile;
WSetFilePointer((HANDLE)pMemFile->file, pMemFile->offset, 0, 0);
v2 = v1->end - v1->offset;
if ( v1->buf_len < v2 )
v2 = v1->buf_len;
if ( v2 )
WReadFile((HANDLE)v1->file, v1->buf, v2);
v1->dist = 0;
v1->bytes_to_read = v2;
}
//----- (00462FAE) --------------------------------------------------------
int __fastcall SeekMemFile(MEMFILE *pMemFile, unsigned int lDist, int dwMethod)
{
unsigned int v3; // eax
v3 = pMemFile->bytes_to_read;
if ( lDist >= v3 )
{
pMemFile->bytes_to_read = 0;
}
else
{
pMemFile->dist += lDist;
pMemFile->bytes_to_read = v3 - lDist;
}
pMemFile->offset += lDist;
return pMemFile->offset;
}
//----- (00462FCC) --------------------------------------------------------
int __fastcall ReadWaveSection(MEMFILE *pMemFile, int a2, int *a3)
{
int v3; // esi
MEMFILE *v4; // edi
int v6; // eax
int a2a[2]; // [esp+8h] [ebp-8h]
v3 = a2;
v4 = pMemFile;
while ( 1 )
{
if ( !ReadMemFile(v4, a2a, 8u) )
return 0;
if ( a2a[0] == v3 )
break;
if ( SeekMemFile(v4, a2a[1], FILE_CURRENT) == -1 )
return 0;
}
*a3 = a2a[1];
v6 = SeekMemFile(v4, 0, FILE_CURRENT);
a3[1] = v6;
return v6 != -1;
}
//----- (00463023) --------------------------------------------------------
void *__fastcall LoadWaveFile(HANDLE hsFile, WAVEFORMATEX *pwfx, int *a3)
{
WAVEFORMATEX *v3; // esi
MEMFILE wave_file; // [esp+4h] [ebp-1Ch]
v3 = pwfx;
AllocateMemFile(hsFile, &wave_file, 0xFFFFFFFF);
if ( ReadWaveFile(&wave_file, v3, a3) )
return wave_file.buf;
FreeMemFile(&wave_file);
return 0;
}

36
Source/wave.h Normal file
View File

@ -0,0 +1,36 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
//wave
extern int wave_cpp_init_value; // weak
//int dword_6ABB9C; // weak
void __cdecl wave_cpp_init();
bool __fastcall WCloseFile(void *file);
int __fastcall WGetFileSize(HANDLE hsFile, unsigned long *a2);
void __fastcall WGetFileArchive(HANDLE hsFile, int *a2, char *dwInitParam);
int __fastcall WOpenFile(char *dwInitParam, HANDLE *phsFile, int a3);
char __fastcall WReadFile(HANDLE hsFile, char *buf, int a3);
int __fastcall WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence);
int __fastcall LoadWaveFormat(HANDLE hsFile, WAVEFORMATEX *pwfx);
void *__fastcall AllocateMemFile(HANDLE hsFile, MEMFILE *pMemFile, unsigned int a3);
void __fastcall FreeMemFile(MEMFILE *pMemFile);
int __fastcall ReadWaveFile(MEMFILE *pMemFile, WAVEFORMATEX *pwfx, int *a3);
int __fastcall ReadMemFile(MEMFILE *pMemFile, void *lpBuf, size_t a3);
void __fastcall FillMemFile(MEMFILE *pMemFile);
int __fastcall SeekMemFile(MEMFILE *pMemFile, unsigned int lDist, int dwMethod);
int __fastcall ReadWaveSection(MEMFILE *pMemFile, int a2, int *a3);
void *__fastcall LoadWaveFile(HANDLE hsFile, WAVEFORMATEX *pwfx, int *a3);
void __fastcall j_engine_mem_free(void *ptr);
/* data */
extern int wave_inf; // weak

10468
Source/world.cpp Normal file

File diff suppressed because it is too large Load Diff

29
Source/world.h Normal file
View File

@ -0,0 +1,29 @@
/*
* UNPUBLISHED -- Rights reserved under the copyright laws of the
* United States. Use of a copyright notice is precautionary only and
* does not imply publication or disclosure.
*
* THIS DOCUMENTATION CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION
* OF BLIZZARD ENTERTAINMENT. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF BLIZZARD ENTERTAINMENT.
*/
void __fastcall drawTopArchesUpperScreen(void *a1);
void __fastcall drawBottomArchesUpperScreen(void *a1, int a2);
void __fastcall drawUpperScreen(void *a1);
void __fastcall drawTopArchesLowerScreen(void *a1);
void __fastcall drawBottomArchesLowerScreen(void *a1, int a2);
void __fastcall drawLowerScreen(void *a1);
void __fastcall world_draw_black_tile(char *dst_buf);
/* rdata */
extern int world_4B325C;
extern unsigned char world_4B3260[5];
extern int world_4B3265;
extern int world_4B3269[5];
extern int tile_draw_masks[3][32];
extern int world_4B33FD[48];
extern int world_4B34BD[17];
extern int world_4B3501[17];