well, seems I'm finally done replacing the core of D2's quest system(server side)
here is the entire map of QUESTS.CPP from D2Game:
Code: Select all
6FC93B60 to 6FC93B84 -> QuestFreeChainRecord();
6FC93B85 to 6FC93B8F -> Free Space
6FC93B90 to 6FC93BCF -> GetQuestData();
6FC93BD0 to 6FC93C2F -> QuestAttachLevelChainRecord();
6FC93C32 to 6FC93C3F -> Free Space
6FC93C40 to 6FC93D54 -> QuestCreateChainRecord();
6FC93D57 to 6FC93D5F -> Free Space
6FC93D60 to 6FC93DBD -> QuestInitScrollTextChain();
6FC93DC0 to 6FC93FC1 -> QuestInit();
6FC93FC6 to 6FC93FCF -> Free Space
6FC93FD0 to 6FC94073 -> QuestFree();
6FC94074 to 6FC9407F -> Free Space
6FC94080 to 6FC940A7 -> QuestGetGlobalSeed();
6FC940AC to 6FC940AF -> Free Space
6FC940B0 to 6FC9420F -> QuestParseKill();
6FC94210 to 6FC9427C -> QuestStatusCycler();
6FC94281 to 6FC9428F -> Free Space
6FC94290 to 6FC942C3 -> QuestChangeLevel();
6FC942C6 to 6FC942CF -> Free Space
6FC942D0 to 6FC9437F -> QuestEventCallback();
6FC94384 to 6FC9438F -> Free Space
6FC94390 to 6FC9449C -> QuestDroppedWithItem();
6FC944A1 to 6FC944AF -> Free Space
6FC944B0 to 6FC944EC -> QuestNPCActivate();
6FC944EF to 6FC944EF -> Free Space
6FC944F0 to 6FC9451B -> QuestNPCDeactivate();
6FC9451E to 6FC9451F -> Free Space
6FC94520 to 6FC94549 -> QuestItemPickedUp();
6FC9454C to 6FC9454F -> Free Space
6FC94550 to 6FC94579 -> QuestItemDropped();
6FC9457C to 6FC9457F -> Free Space
6FC94580 to 6FC94686 -> QuestUpdater();
6FC9468B to 6FC9468F -> Free Space
6FC94690 to 6FC94704 -> QuestCreateTimer();
6FC94707 to 6FC9470F -> Free Space
6FC94710 to 6FC947E8 -> QuestRefreshStatus();
6FC947EB to 6FC947EF -> Free Space
6FC947F0 to 6FC94A25 -> QuestStatusCallback();
6FC94A26 to 6FC94A2F -> Free Space
6FC94A30 to 6FC94A40 -> QuestDebugOutput();
6FC94A43 to 6FC94A4F -> Free Space
6FC94A50 to 6FC94B14 -> QuestDeleteItem();
6FC94B17 to 6FC94B1F -> Free Space
6FC94B20 to 6FC94C98 -> QuestStatusCyclerEx();
6FC94C9B to 6FC94C9F -> Free Space
6FC94CA0 to 6FC94CDF -> QuestUnitIterate();
6FC94CE4 to 6FC94CEF -> Free Space
6FC94CF0 to 6FC94D2E -> QuestStateDebug();
6FC94D31 to 6FC94D3F -> Free Space
6FC94D40 to 6FC94DA5 -> QuestNPCMessage();
6FC94DA8 to 6FC94DAF -> Free Space
6FC94DB0 to 6FC95358 -> QuestSequenceCycler();
6FC9535B to 6FC9535F -> Free Space
D2Game.#10037 6FC95360 to 6FC95396 -> QuestCheckFirstPickedSet();
6FC95399 to 6FC9539F -> Free Space
D2Game.#10038 6FC953A0 to 6FC9541E -> QuestCheckNotIntroQuest();
6FC95421 to 6FC9542F -> Free Space
6FC95430 to 6FC95487 -> QuestSendCurrentFlags();
6FC95488 to 6FC9548F -> Free Space
6FC95490 to 6FC956AF -> QuestActiveCycler();
6FC956B4 to 6FC956BF -> Free Space
6FC956C0 to 6FC956FA -> QuestSetGlobalState();
6FC956FD to 6FC956FF -> Free Space
6FC95700 to 6FC9573A -> QuestGetGlobalState();
6FC9573D to 6FC9573F -> Free Space
6FC95740 to 6FC9578D -> QuestWarrivSpawn();
6FC95790 to 6FC957F7 -> QuestUseClueItem();
6FC957FA to 6FC957FF -> Free Space
6FC95800 to 6FC95826 -> QuestJerhynPositon();
6FC9582B to 6FC9582F -> Free Space
6FC95830 to 6FC95856 -> QuestJerhynPositonEx();
6FC9585B to 6FC9585F -> Free Space
6FC95860 to 6FC95918 -> QuestObjectInitFN(); 1(TaintedAlter), 2(MalusStand) & 3(CainGibbit)
6FC95920 to 6FC95927 -> QuestDisableSequences();
6FC95928 to 6FC9592F -> Free Space
6FC95930 to 6FC95CBD -> QuestObjectEvents();
6FC95CBE to 6FC95CBF -> Free Space
6FC95CC0 to 6FC95D03 -> QuestEssanTomeStandInit();
6FC95D08 to 6FC95D0F -> Free Space
6FC95D10 to 6FC95DAF -> QuestSetJadeFigurineBoss();
6FC95DB0 to 6FC95DED -> QuestSetGoldenBirdSpawn();
6FC95DEE to 6FC95DEF -> Free Space
6FC95DF0 to 6FC95F1E -> QuestCreateItem();
6FC95F21 to 6FC95F2F -> Free Space
6FC95F30 to 6FC960B8 -> QuestUpdateNPCIntros();
6FC960BC to 6FC960BF -> Free Space
6FC960C0 to 6FC964AA -> QuestActChange();
6FC964AD to 6FC964AF -> Free Space
6FC964B0 to 6FC96575 -> QuestDeleteItem();
6FC96578 to 6FC9657F -> Free Space
6FC96580 to 6FC967C3 -> QuestsHellPortalActChange();
6FC967C6 to 6FC967CF -> Free Space
6FC967D0 to 6FC96807 -> QuestsSetIntroFlags();
6FC9680A to 6FC9680F -> Free Space
6FC96810 to 6FC9683D -> QuestAddPlayerGUID();
6FC9683E to 6FC9683F -> Free Space
6FC96840 to 6FC96879 -> QuestsFastRemovePlayerGUID();
6FC9687A to 6FC9687F -> Free Space
6FC96880 to 6FC968A4 -> QuestsQuickCheckPlayerGUID();
6FC968A5 to 6FC968AF -> Free Space
6FC968B0 to 6FC968D9 -> QuestsCheckPlayerGUID();
6FC968DA to 6FC968DF -> Free Space
6FC968E0 to 6FC968E9 -> QuestsResetPlayerGUIDCount();
6FC968EA to 6FC968EF -> Free Space
6FC968F0 to 6FC9693D -> QuestsQuickRemovePlayerGUID();
6FC9693E to 6FC9693F -> Free Space
6FC96940 to 6FC96C72 -> QuestGetFreePosition();
6FC96C75 to 6FC96C7F -> Free Space
6FC96C80 to 6FC96D13 -> QuestsRemovePlayerGUID();
6FC96D14 to 6FC96D1F -> Free Space
6FC96D20 to 6FC96D58 -> QuestsUpdatePlayerFlags();
6FC96D59 to 6FC96D5F -> Free Space
6FC96D60 to 6FC96E0E -> QuestGUIDUpdate();
6FC96E11 to 6FC96E1F -> Free Space
6FC96E20 to 6FC96E72 -> QuestsSendScrollMessage();
6FC96E75 to 6FC96E7F -> Free Space
6FC96E80 to 6FC96E97 -> QuestsTriggerFX();
6FC96E98 to 6FC96E9F -> Free Space
6FC96EA0 to 6FC96F0A -> QuestsFXIterate();
6FC96F0D to 6FC96F0F -> Free Space
6FC96F10 to 6FC9700E -> QuestNPCActivate();
6FC97011 to 6FC9701F -> Free Space
6FC97020 to 6FC97036 -> QuestPortalCheck();
6FC97039 to 6FC9703F -> Free Space
6FC97040 to 6FC970D2 -> QuestSetObjectSelection();
6FC970D3 to 6FC970DF -> Free Space
6FC970E0 to 6FC97119 -> QuestSendLogUpdate();
6FC9711A to 6FC9711F -> Free Space
6FC97120 to 6FC97187 -> QuestSendLogUpdateEx();
6FC9718A to 6FC9718F -> Free Space
6FC97190 to 6FC973CD -> QuestSpawnCriticalMonster();
6FC973D0 to 6FC973F2 -> QuestMonsterSpawn();
6FC973F7 to 6FC973FF -> Free Space
6FC97400 to 6FC974A3 -> QuestLevelWarpCheck();
6FC974A4 to 6FC974AF -> Free Space
6FC974B0 to 6FC97590 -> QuestSpawnMonster();
6FC97593 to 6FC9759F -> Free Space
6FC975A0 to 6FC975CE -> QuestMapPresetSpawn();
//There is ALOT more after this, these are quest specific and intro quests
here is proper definitions for all the functions:
Code: Select all
//****************************************************//
// Client Side Quest Core //
//****************************************************//
extern BYTE gnClientQuestsStatus[MAX_QUESTS];
extern BOOL gbClientQuestsInited;
void __fastcall QUESTS_InitClient(D2QuestListPacketStrc* pPacket);
BOOL __stdcall QUESTS_CheckInited(D2PoolManagerStrc* pMemPool);
BYTE __stdcall QUESTS_CheckStatus(D2PoolManagerStrc* pMemPool, int nQuest);
//****************************************************//
// Server Side Quest Core //
//****************************************************//
extern D2QuestInitStrc* sgpQuestInit;
extern int* gnQuestsToInit;
extern D2QuestIntroInitStrc gpIntroQuests[];
extern int gnIntroQuests;
extern const int gnActIntroductions[];
void __stdcall QUESTS_CopyFlagsEx(D2QuestFlagStrc* pBuffer, BYTE* pFlagDest, size_t nSize, BOOL bFlipBits);
void __stdcall QUESTS_CopyFlags(D2QuestFlagStrc* pBuffer, BYTE* pFlagDest, size_t nSize, BOOL bUnused = FALSE);
void __fastcall QUESTS_EnableFlag(D2QuestFlagStrc* pQuestData, DWORD nQuest, DWORD nFlag);
void __fastcall QUESTS_DisableFlag(D2QuestFlagStrc* pQuestData, DWORD nQuest, DWORD nFlag);
BOOL __fastcall QUESTS_CheckFlag(D2QuestFlagStrc* pQuestData, DWORD nQuest, DWORD nFlag);
DWORD __stdcall QUESTS_UpdateFlags(D2QuestFlagStrc* pQuestFlags, int nQuest);
D2QuestFlagStrc* __stdcall QUESTS_CreateFlags(D2PoolManagerStrc* pMemPool);
void __stdcall QUESTS_FreeFlags(D2PoolManagerStrc* pMemPool, D2QuestFlagStrc* pQuestFlags);
//Main
D2QuestDataStrc* __fastcall QUESTS_GetDataEx(D2GameStrc* pGame, int nQuest);
D2SeedStrc* __fastcall QUESTS_GetGlobalSeed(D2GameStrc* pGame);
void __fastcall QUESTS_Updater(D2GameStrc* pGame);
void __fastcall QUESTS_EventCallback(D2QuestArgStrc* pArgs, bool bCheckActive, bool bCheckAct);
void __fastcall QUESTS_StatusCallback(D2GameStrc* pGame, D2UnitStrc* pPlayer);
void __fastcall QUESTS_StatusCycler(D2QuestArgStrc* pArgs, bool bForceActive);
void __fastcall QUESTS_StatusCyclerEx(D2GameStrc* pGame, D2UnitStrc* pPlayer, BYTE nQuestNo);
BOOL __fastcall QUESTS_ActiveCycler(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pNPC);
void __fastcall QUESTS_Init(D2GameStrc* pGame);
void __fastcall QUESTS_Free(D2GameStrc* pGame);
BOOL __fastcall QUESTS_CreateChainRecord(D2GameStrc* pGame, D2UnitStrc* pUnit, int nQuestID);
void __fastcall QUESTS_FreeChainRecord(D2GameStrc* pGame, D2QuestChainStrc* pRecord);
void __fastcall QUESTS_SendCurrentFlags(D2GameStrc* pGame, D2ClientStrc* pClient);
void __fastcall QUESTS_ChangeLevel(D2GameStrc* pGame, int nOldLevel, int nNewLevel, D2UnitStrc* pPlayer);
void __fastcall QUESTS_AttachLevelChainRecord(D2GameStrc* pGame, D2UnitStrc* pUnit, DRLGRoom* pRoom, BOOL bDebug);
void __fastcall QUESTS_NPCActivate(D2ClientStrc* pClient, D2UnitStrc* pPlayer, D2UnitStrc* pNPC, D2ScrollTextControlStrc* pTextControl);
void __fastcall QUESTS_DroppedWithItem(D2GameStrc* pGame, D2UnitStrc* pPlayer);
void __fastcall QUESTS_NPCDeactivate(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pNPC);
void __fastcall QUESTS_ItemPickedUp(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pItem);
void __fastcall QUESTS_ItemDropped(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pItem);
void __fastcall QUESTS_CreateTimer(D2QuestDataStrc* pQuest, QUESTUPDATE pfCallback, int nTicks);
void __fastcall QUESTS_DebugOutput(D2GameStrc* pGame, char* szMessage, char* szFile, int nLine);
void __fastcall QUESTS_InitScrollTextChain(D2QuestDataStrc* pQuest, D2ScrollTextControlStrc* pTextControl, int nNPCID, int nIndex);
void __fastcall QUESTS_RefreshStatus(D2QuestDataStrc* pQuest,BYTE* pQuestList, D2QuestFlagStrc* pQuestFlags);
void __fastcall QUESTS_UnitIterate(D2QuestDataStrc* pQuest, int nIterateState, void* pArg, UNITITERATE pfIterate, bool bIterate);
void __fastcall QUESTS_SetMainState(D2QuestDataStrc* pQuest, int nState, char* szFile, int nLine);
void __fastcall QUESTS_NPCMessage(D2GameStrc* pGame, D2UnitStrc* pPlayer, DWORD dwNPCGUID, short nMessage);
void __fastcall QUESTS_SetGlobalState(D2GameStrc* pGame, int nQuest, int nFlag);
void __fastcall QUESTS_GetGlobalState(D2GameStrc* pGame, int nQuest, int nFlag);
void __fastcall QUESTS_WarrivSpawn(D2GameStrc* pGame, D2UnitStrc* pWarriv, int nWarrivID, int nXpos, int nYpos);
BOOL __stdcall QUESTS_CheckInit(D2GameStrc* pGame, int nQuest);
void __fastcall QUESTS_SequenceCycler(D2GameStrc* pGame, D2UnitStrc* pPlayer, BOOL bGameEnter);
void __fastcall QUESTS_UseClueItem(D2GameStrc* pGame, D2UnitStrc* pPlayer, DWORD dwItemGUID);
void __fastcall QUESTS_KillParser(D2GameStrc* pGame, D2UnitStrc* pDefender, D2UnitStrc* pAttacker);
void __stdcall QUESTS_DisableSequencePreInit();
D2UnitStrc* __fastcall QUESTS_CreateItem(D2GameStrc* pGame, D2UnitStrc* pPlayer, DWORD dwCode, int nLevel, BYTE nQuality, BOOL bDroppable);
void __fastcall QUESTS_SendPlayerFlags(D2ClientStrc* pClient, BYTE nType, int nSubType, DWORD dwNPCGUID, D2QuestFlagStrc* fQuestFlags, BYTE nArg);
void __fastcall QUESTS_SetActChange(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pNPC, int nCurrentLevel, int nDestination);
BOOL __fastcall QUESTS_LevelWarpCheck(D2GameStrc* pGame, D2UnitStrc* pPlayer, int nSourceLevel, int nTargetLevel);
void __fastcall QUESTS_UpdateLogEx(D2UnitStrc* pPlayer, int nQuest, BYTE nAct);
void __fastcall QUESTS_UpdateLog(D2UnitStrc* pPlayer, int nQuest);
BOOL __stdcall QUESTS_CheckPickedSet(D2GameStrc* pGame);
void __fastcall QUESTS_DeleteItem(D2GameStrc* pGame, D2UnitStrc* pPlayer, DWORD dwItemCode);
void __fastcall QUESTS_DeleteItemEx(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2InventoryStrc* pInventory, D2UnitStrc* pItem);
D2UnitStrc* __fastcall QUESTS_FindItem(D2GameStrc* pGame, D2UnitStrc* pUnit, DWORD dwCode);
void __fastcall QUESTS_SetJadeFigurineBoss(D2GameStrc* pGame, D2UnitStrc* pMonster);
void __fastcall QUESTS_SetGoldenBirdSpawn(D2GameStrc* pGame, D2UnitStrc* pMonster);
void __fastcall QUESTS_AddPlayerGUID(D2QuestGUIDStrc* pQuestGUID, DWORD dwGUID);
void __fastcall QUESTS_DebugMessage(D2GameStrc* pGame, char* szMessage, int nColour);
void __fastcall QUESTS_UpdateNPCIntros(D2GameStrc* pGame, D2UnitStrc* pPlayer, int nAct);
void __fastcall QUESTS_NPCSpeechActivate(D2GameStrc* pGame, D2UnitStrc* pPlayer, D2UnitStrc* pNPC);
BOOL __fastcall QUESTS_FXIterate(D2GameStrc* pGame, D2UnitStrc* pPlayer, void* pArg);
void __fastcall QUESTS_TriggerFX(D2GameStrc* pGame);
void __fastcall QUESTS_SendScrollMessage(D2GameStrc* pGame, D2UnitStrc* pPlayer, short nMessage);
void __fastcall QUESTS_UpdatePlayerFlags(D2GameStrc* pGame, D2UnitStrc* pPlayer);
void __fastcall QUESTS_RemovePlayerGUID(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
void __fastcall QUESTS_QuickRemovePlayerGUID(D2QuestDataStrc* pQuest, D2UnitStrc* pPlayer);
BOOL __fastcall QUESTS_CheckGUID(D2QuestDataStrc* pQuest, DWORD dwGUID);
void __fastcall QUESTS_ResetGUIDCount(D2QuestGUIDStrc* pGUIDs);
BOOL __fastcall QUESTS_QuickCheckGUID(D2QuestGUIDStrc* pGUIDs, DWORD dwGUID);
BOOL __fastcall QUESTS_FastRemovePlayerGUID(D2QuestGUIDStrc* pGUIDs, DWORD dwGUID);
void __fastcall QUESTS_SetIntroFlags(D2GameStrc* pGame, D2UnitStrc* pPlayer, int* pNPCs, int nNPCs);
BOOL __fastcall QUESTS_SetObjectSelection(D2ObjectOperateStrc* pArgs);
BOOL __stdcall QUESTS_PortalCheck(D2GameStrc* pGame, D2CoordStrc* pCoord, int nLevel, DRLGRoom** ppRoom);
D2UnitStrc* __fastcall QUESTS_SpawnMonster(D2UnitStrc* pUnit, D2GameStrc* pGame, D2CoordStrc* pPosition, int nType, int nIndex);
void __fastcall QUESTS_GUIDUpdate(D2GameStrc* pGame, D2QuestGUIDStrc* pQuestGUID, int nQuest, WORD wSoundCMD);
void __fastcall QUESTS_HellPortalActChange(D2GameStrc* pGame, D2UnitStrc* pPlayer, int nLevel, D2UnitStrc* pObject);
void __fastcall QUESTS_GetFreePosition(DRLGRoom* pRoom, D2CoordStrc* pCoord, int nRadius, WORD fCollision, DRLGRoom** ppRoom, int nUnused);
void __fastcall QUESTS_MapPresetSpawn(D2GameStrc* pGame, D2UnitStrc* pUnit, D2MapAIStrc* pMapAI);
D2UnitStrc* __fastcall QUESTS_SpawnCriticalMonster(D2GameStrc* pGame, int nXpos, int nYpos, DRLGRoom* pRoom, BOOL bSpecialInit, int nMonster);
void __fastcall QUESTS_MonsterSpawn(D2GameStrc* pGame, D2UnitStrc* pMonster);
//Init FNs
void __fastcall QUESTS_TaintedAlterInit(D2ObjectInitStrc* pArgs);
void __fastcall QUESTS_MalusStandInit(D2ObjectInitStrc* pArgs);
void __fastcall QUESTS_CainCageInit(D2ObjectInitStrc* pArgs);
void __fastcall QUESTS_TomeStandInit(D2ObjectInitStrc* pArgs);
void __fastcall QUESTS_JerhynPositionInit(D2ObjectInitStrc* pParams);
void __fastcall QUESTS_JerhynPositionInitEx(D2ObjectInitStrc* pParams);
//Not Finished
void __fastcall QUESTS_ObjectEvents(D2GameStrc* pGame, D2UnitStrc* pUnit);
Updates to the various quest specific stuff:
Act1:
Code: Select all
#pragma pack(1)
struct D2QuestGUIDStrc //sizeof 0x82
{
DWORD dwPlayerGUID[32]; //+00
short nGUIDCount; //+80
};
#pragma pack()
/*=================================================================*/
/* Act Intro */
/*=================================================================*/
extern D2NPCMessageTableStrc ACT1INTRO_NPCMessages[];
void __fastcall ACT1INTRO_Init(D2QuestDataStrc* pQuest);
void __fastcall ACT1INTRO_NPCActivate(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
void __fastcall ACT1INTRO_ScrollMessage(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
bool __fastcall ACT1INTRO_ActiveFilter(D2QuestDataStrc* pQuest, int nNPC, D2UnitStrc* pPlayer, D2QuestFlagStrc* pFlags, D2UnitStrc* pNPC);
bool __fastcall ACT1INTRO_StatusFilter(D2QuestDataStrc* pQuest, D2UnitStrc* pPlayer, D2QuestFlagStrc* pGlobalFlags, D2QuestFlagStrc* pFlags, BYTE* pStatus);
/*=================================================================*/
/* Quest 1 */
/*=================================================================*/
#pragma pack(1)
struct D2DenOfEvilQuestDataStrc //sizeof 0x8C
{
D2QuestGUIDStrc pQuestGUID; //+00
BYTE nUnk[4]; //+84
int nMonstersLeft; //+88
};
#pragma pack()
int __fastcall ACT1Q1_GetMonstersLeft(D2QuestDataStrc* pQuest);
BOOL __fastcall ACT1Q1_CheckState(D2QuestDataStrc* pQuest);
/*=================================================================*/
/* Quest 2 */
/*=================================================================*/
#pragma pack(1)
struct D2BloodRavenQuestDataStrc //sizeof 0xC
{
BYTE nUnk[12]; //+00
};
#pragma pack()
/*=================================================================*/
/* Quest 3 */
/*=================================================================*/
#pragma pack(1)
struct D2MalusQuestDataStrc //sizeof 0xA4
{
BYTE nUnk2; //+00
bool bMalusTaken; //+01
WORD nUnk3; //+02
int nMalusGUID; //+04
BYTE nUnk4; //+08
bool bModeChanged; //+09
BYTE nUnk[142]; //+0A
int nMalusMode; //+98
BYTE nUnk5[8]; //+9C
};
#pragma pack()
void __fastcall ACT1Q3_MalusModeChange(D2QuestDataStrc* pQuest, D2ObjectInitStrc* pArgs);
/*=================================================================*/
/* Quest 4 */
/*=================================================================*/
#pragma pack(1)
struct D2CainQuestDataStrc //sizeof 0x1BC
{
WORD nStoneOrder[5]; //+00
WORD nPad; //+0A
WORD nUnk; //+0C
BYTE nUnk1[34]; //+10
int nPortalGUID; //+30
int nCageGUID; //+34
BYTE nUnk5[14]; //+38
bool bTimerSet; //+46
bool bPortalModeChanged;//+47
bool bCageModeChanged; //+48
BYTE nUnk4; //+49
bool bStonesOrdered; //+4A
BYTE nUnk2[5]; //+4B
bool bCainRescued; //+50
bool b51; //+51
bool b52; //+52
BYTE nUnk7; //+53
int nCageMode; //+54
BYTE nUnk3[8]; //+58
bool bTristCainKilled; //+60
BYTE nUnk9[50]; //+61
bool bTristramTalk; //+93
BYTE nUnk6[32]; //+94
union
{
struct
{
int nPlayerGUID[32]; //+B4
short nGUIDCount; //+134
};
D2QuestGUIDStrc pQuestGUID;
};
BYTE nUnk8[134]; //+136
};
#pragma pack()
#define QUEST_CAIRNSTONES 5
void __fastcall ACT1Q4_RandomizeStoneOrder(D2QuestDataStrc* pQuest);
void __fastcall ACT1Q4_SendStoneOrder(D2GameStrc* pGame, D2UnitStrc* pPlayer);
void __fastcall ACT1Q4_CageModeChange(D2QuestDataStrc* pQuest, D2ObjectInitStrc* pArgs);
BOOL __fastcall ACT1Q4_CheckTristramInteract(D2GameStrc* pGame);
BOOL __fastcall ACT1Q4_BeginQuest(D2GameStrc* pGame, D2UnitStrc* pPlayer, void* pArg);
void __fastcall ACT1Q4_ChangeAct(D2GameStrc* pGame, D2UnitStrc* pPlayer);
BOOL __fastcall ACT1Q4_CompleteQuest(D2GameStrc* pGame, D2UnitStrc* pPlayer, void* pArg);
void __fastcall ACT1Q4_SetupEvents(D2QuestDataStrc* pQuest, BOOL bCreateTimer, BOOL bIterate);
void __fastcall ACT1Q4_FreeInteract(D2UnitStrc* pPlayer);
BOOL __fastcall ACT1Q4_KillCain(D2GameStrc* pGame, D2UnitStrc* pMonster, void* pArg);
BOOL __fastcall ACT1Q4_DelayedKillCain(D2GameStrc* pGame, D2QuestDataStrc* pQuest);
/*=================================================================*/
/* Quest 5 */
/*=================================================================*/
#pragma pack(1)
struct D2CountessQuestDataStrc //sizeof 0x120
{
BYTE nUnk[39]; //+00
DWORD nBookGUID; //+28
BYTE nUnk2[41]; //+2C
bool bBookFound; //+49
BYTE nUnk3[208]; //+50
};
#pragma pack()
void __fastcall ACT1Q5_QuestSetBookGUID(D2GameStrc* pGame, D2QuestDataStrc* pQuest, D2UnitStrc* pUnit);
/*=================================================================*/
/* Quest 4 */
/*=================================================================*/
#pragma pack(1)
struct D2AndarielQuestDataStrc //sizeof 0x198
{
BYTE nUnk[408]; //+00
};
#pragma pack()
Act 2:
Code: Select all
/*=================================================================*/
/* Act Intro */
/*=================================================================*/
extern D2NPCMessageTableStrc ACT2INTRO_NPCMessages[];
void __fastcall ACT2INTRO_Init(D2QuestDataStrc* pQuest);
void __fastcall ACT2INTRO_NPCActivate(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
void __fastcall ACT2INTRO_ScrollMessage(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
bool __fastcall ACT2INTRO_ActiveFilter(D2QuestDataStrc* pQuest, int nNPC, D2UnitStrc* pPlayer, D2QuestFlagStrc* pFlags, D2UnitStrc* pNPC);
bool __fastcall ACT2INTRO_StatusFilter(D2QuestDataStrc* pQuest, D2UnitStrc* pPlayer, D2QuestFlagStrc* pGlobalFlags, D2QuestFlagStrc* pFlags, BYTE* pStatus);
/*=================================================================*/
/* Quest 3 */
/*=================================================================*/
#pragma pack(1)
struct D2TainedSunQuestDataStrc //sizeof 0xA0
{
BYTE nUnk[2]; //+00
bool bRewarded; //+02
bool bBlackened; //+03
BYTE nUnk4; //+04
bool bAlterDestroyed; //+05
BYTE nUnk3[3]; //+06
int nAlterMode; //+08
int nAlterGUID; //+0C
BYTE nUnk2[143]; //+10
};
#pragma pack()
void __fastcall ACT2Q3_AlterModeChage(D2QuestDataStrc* pQuest, D2ObjectInitStrc* pArgs);
void __fastcall ACT2Q3_ActChange(D2GameStrc* pGame, int nAct);
/*=================================================================*/
/* Quest 6 */
/*=================================================================*/
#pragma pack(1)
struct D2DurielQuestDataStrc //sizeof 0x68
{
BYTE nUnk[11]; //+00
bool bTombOpen; //+0B
BYTE nUnk1[40]; //+0C
int nStaffTomb; //+34
BYTE nUnk2[4]; //+38
bool bTombActivate; //+3C
BYTE nUnk3[43]; //+3D
};
#pragma pack()
void __fastcall ACT2Q6_SendStaffTomb(D2GameStrc* pGame, D2UnitStrc* pPlayer);
BOOL __fastcall ACT2Q6_CheckTombClosed(D2GameStrc* pGame, D2UnitStrc* pPlayer);
BOOL __fastcall ACT2Q6_ActivateTomb(D2GameStrc* pGame, D2CoordStrc* pCoord, DRLGRoom** ppRoom);
/*=================================================================*/
/* Quest 7 */
/*=================================================================*/
#pragma pack(1)
struct D2Act2Quest7QuestDataStrc //sizeof 0x1
{
BYTE nUnk; //+00
};
#pragma pack()
/*=================================================================*/
/* Quest 8 */
/*=================================================================*/
#pragma pack(1)
struct D2Act2Quest8QuestDataStrc //sizeof 0x2
{
BYTE nUnk[2]; //+00
};
#pragma pack()
Act 3:
Code: Select all
/*=================================================================*/
/* Act Intro */
/*=================================================================*/
extern D2NPCMessageTableStrc ACT3INTRO_NPCMessages[];
void __fastcall ACT3INTRO_Init(D2QuestDataStrc* pQuest);
void __fastcall ACT3INTRO_NPCActivate(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
void __fastcall ACT3INTRO_ScrollMessage(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
bool __fastcall ACT3INTRO_ActiveFilter(D2QuestDataStrc* pQuest, int nNPC, D2UnitStrc* pPlayer, D2QuestFlagStrc* pFlags, D2UnitStrc* pNPC);
bool __fastcall ACT3INTRO_StatusFilter(D2QuestDataStrc* pQuest, D2UnitStrc* pPlayer, D2QuestFlagStrc* pGlobalFlags, D2QuestFlagStrc* pFlags, BYTE* pStatus);
/*=================================================================*/
/* Quest 1 */
/*=================================================================*/
#pragma pack(1)
struct D2LamEsenQuestDataStrc //sizeof 0xA0
{
BYTE nUnk1[24]; //+00
int nTomeStandMode; //+18
BYTE nUnk[136]; //+1C
};
#pragma pack()
void __fastcall ACT3Q1_TomeModeChange(D2QuestDataStrc* pQuest, D2ObjectInitStrc* pArgs);
/*=================================================================*/
/* Quest 3 */
/*=================================================================*/
#pragma pack(1)
struct D2GidbinQuestDataStrc //sizeof 0x30
{
DWORD dwUnk; //+00
bool bBossSpawned; //+04
BYTE nUnk[43]; //+05
};
#pragma pack()
/*=================================================================*/
/* Quest 4 */
/*=================================================================*/
#pragma pack(1)
struct D2GoldenBirdQuestDataStrc //sizeof 0x1C
{
BYTE nUnk; //+00
bool bGoldenBird; //+01
bool bJadeFigure; //+02
BYTE nUnk2; //+03
int nBossGUID; //+04
DWORD dwUnk; //+08
bool bUnk; //+0C
BYTE nUnk1[15]; //+0D
};
#pragma pack()
void __fastcall ACT3Q4_SetGoldenBirdState(D2QuestDataStrc* pQuest, D2UnitStrc* pUnit);
BOOL __fastcall ACT3Q4_SetJadeFigurineBoss(D2QuestDataStrc* pQuest, D2UnitStrc* pUnit);
/*=================================================================*/
/* Quest 5 */
/*=================================================================*/
#pragma pack(1)
struct D2CouncilQuestDataStrc //sizeof 0x50
{
BYTE nUnk[5]; //+00
bool bMonsterSpawn; //+05
BYTE nUnk2[6]; //+06
bool bOrbSmashed; //+0C
BYTE nUnk1[3]; //+0D
DWORD dwGUID[6]; //+10
BYTE nUnk4[8]; //+28
int nSpawnCount; //+30
int nLastSpawnIndex;//+34
BYTE nUnk3[24]; //+38
};
#pragma pack()
BOOL __fastcall ACT3Q5_TempleClosed(D2GameStrc* pGame, D2UnitStrc* pPlayer);
BOOL __fastcall ACT3Q5_StatusIterate(D2GameStrc* pGame, D2UnitStrc* pUnit, void* pArg);
void __fastcall ACT3Q5_CheckMonsterSpawn(D2GameStrc* pGame, D2UnitStrc* pMonster);
BOOL __fastcall ACT3Q5_PlayerIterate(D2GameStrc* pGame, D2UnitStrc* pPlayer, void* pArg);
/*=================================================================*/
/* Quest 6 */
/*=================================================================*/
#pragma pack(1)
struct D2BlackTempleQuestDataStrc //sizeof 0x34
{
BYTE nUnk; //+00
bool bOpened; //+01
bool bOpenedEx; //+02
BYTE nUnk2; //+03
DWORD dwObjectGUID; //+04
DWORD dwObjectGUIDEx; //+08
int nObjectMode; //+0C
int nObjectModeEx; //+10
BYTE nUnk[32]; //+14
};
#pragma pack()
void __fastcall ACT3Q6_SetObjectModes(D2GameStrc* pGame, D2UnitStrc* pObject);
Act 4:
Code: Select all
/*=================================================================*/
/* Quest 2 - Terrors End */
/*=================================================================*/
struct D2DiabloQuestDataStrc //sizeof 0x4C
{
BYTE nUnk[36]; //+00
D2CoordStrc pSeals[3]; //+24
BYTE nUnk2[16]; //+3C
};
D2UnitStrc* __fastcall ACT4Q2_SpawnMonster(D2GameStrc* pGame, D2UnitStrc* pObject);
Act 5:
Code: Select all
/*=================================================================*/
/* Act Intro */
/*=================================================================*/
extern D2NPCMessageTableStrc ACT5INTRO_NPCMessages[];
void __fastcall ACT5INTRO_Init(D2QuestDataStrc* pQuest);
void __fastcall ACT5INTRO_NPCActivate(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
void __fastcall ACT5INTRO_ScrollMessage(D2QuestDataStrc* pQuest, D2QuestArgStrc* pArgs);
bool __fastcall ACT5INTRO_ActiveFilter(D2QuestDataStrc* pQuest, int nNPC, D2UnitStrc* pPlayer, D2QuestFlagStrc* pFlags, D2UnitStrc* pNPC);
bool __fastcall ACT5INTRO_StatusFilter(D2QuestDataStrc* pQuest, D2UnitStrc* pPlayer, D2QuestFlagStrc* pGlobalFlags, D2QuestFlagStrc* pFlags, BYTE* pStatus);
/*=================================================================*/
/* Quest 1 - The Siege of Harrogath */
/*=================================================================*/
#pragma pack(1)
struct D2SeigeOfHarrogathQuestDataStrc //sizeof 0x18
{
D2MapAIStrc* pLarzukMapAI; //+00
BYTE nUnk3[12]; //+04
DWORD dwLarzukGUID; //+10
BYTE nUnk2; //+14
bool bLarzukSetPath; //+15
BYTE nUnk; //+16
bool bLarzukPathCopied; //+17
};
#pragma pack()
void __fastcall ACT5Q1_SetLarzukPath(D2GameStrc* pGame, D2UnitStrc* pLarzukStart, D2MapAIStrc* pMapAI);
/*=================================================================*/
/* Quest 3 - Prison of Ice */
/*=================================================================*/
#pragma pack(1)
struct D2PrisonOfIceQuestDataStrc //sizeof 0x114
{
BYTE nUnk[241]; //+00
bool bDrehyaSetPath; //+91
BYTE nUnk3; //+92
bool bNilathakSetPath; //+93
DWORD dwDrehyaGUID; //+94
BYTE nUnk4[4]; //+98
DWORD dwNilathakGUID; //+9C
BYTE nUnk6[4]; //+100
D2MapAIStrc* pDrehyaMapAI; //+104
D2MapAIStrc* pNilathakMapAI; //+108
bool bDrehyaPathCopied; //+10C
bool bNilathakPathCopied; //+10C
BYTE nUnk5[6]; //+10E
};
#pragma pack()
void __fastcall ACT5Q3_SetDrehyaPath(D2GameStrc* pGame, D2UnitStrc* pDrehyaStart, D2MapAIStrc* pMapAI);
void __fastcall ACT5Q3_SetNilathakPath(D2GameStrc* pGame, D2UnitStrc* pNilathakStart, D2MapAIStrc* pMapAI);
/*=================================================================*/
/* Quest 5 */
/*=================================================================*/
#pragma pack(1)
struct D2AncientsQuestDataStrc //sizeof 0x64
{
bool bDefeated; //+00
BYTE nUnk[11]; //+01
int nPortalCount; //+0C
bool bAllow; //+10
bool bActivatable; //+11
BYTE nUnk1[82]; //+12
};
#pragma pack()
void __fastcall ACT5Q5_OpenPortals(D2GameStrc* pGame, D2UnitStrc* pDestPortal);
void __fastcall ACT5Q5_ClosePortals(D2GameStrc* pGame, D2UnitStrc* pPortal);
BOOL __fastcall ACT5Q5_ArreatClosed(D2GameStrc* pGame, D2UnitStrc* pPlayer, int nTargetLevel);
/*=================================================================*/
/* Quest 6 */
/*=================================================================*/
#pragma pack(1)
struct D2BaalQuestDataStrc //sizeof 0xA8
{
BYTE nUnk1[133]; //+00
bool bMinionsDefeated; //+86
BYTE nUnk[34]; //+87
};
#pragma pack()
bool __fastcall ACT5Q6_CheckMinionsDefeated(D2QuestDataStrc* pQuest);
void __fastcall ACT5Q6_SetMinionsDefeated(D2QuestDataStrc* pQuest);
void __fastcall ACT5Q6_SetMinionState(D2QuestDataStrc* pQuest, bool bState);
BOOL __fastcall ACT5Q6_ChamberClosed(D2GameStrc* pGame, D2UnitStrc* pPlayer);
Adding new quests to this isn't actually too hard, you just need to expand/redirect/add too the QuestIntroInit or QuestInit tables and increase there respective counts, the init function does all the setup, the filters that the init func sets does all the work