struct MonsterRegion

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
misiek1294
Junior Member
Paladin
Posts: 168
Joined: Mon Dec 29, 2014 3:58 pm
Poland

struct MonsterRegion

Post by misiek1294 » Tue Jul 21, 2015 2:35 pm

Anyone have this struct reference ? I needed counter information , this keep the total number of monsters or just in the field of view character?

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: struct MonsterRegion

Post by Necrolis » Tue Jul 21, 2015 2:42 pm

From my notes for 1.10

Code: Select all

DWORD nBossCount;			// +2C8 - how many uniques were spawned
    DWORD nMonCount;			// +2CC
    DWORD nKillCount;			// +2D0
Just note that the counters get bugged by certain things, like ressurected monsters (anything that breaks DoE in effect, cause these are the counters it uses).
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
misiek1294
Junior Member
Paladin
Posts: 168
Joined: Mon Dec 29, 2014 3:58 pm
Poland

Re: struct MonsterRegion

Post by misiek1294 » Tue Jul 21, 2015 2:46 pm

Thanks Necrolis, but atm counter stores only in the visual field does not form throughout lvl, any info about this ? Game must have other count for example A1Q1 , i looking in dll but found nothing;/

lolet
Posts: 95
Joined: Sat Sep 04, 2010 8:43 pm

Re: struct MonsterRegion

Post by lolet » Tue Jul 21, 2015 4:05 pm

I've got a little bit more info

Code: Select all

00000000 MonsterNode     struc ; (sizeof=0x34, standard type)
00000000 nTxtRecord      dw ?
00000002 bRarity         db ?
00000003 _1              db ?
00000004 _2              dd ?
00000008 _3              dd ?
0000000C _4              dd ?
00000010 _5              dd ?
00000014 _6              dd ?
00000018 _7              dd ?
0000001C _8              dd ?
00000020 _9              dd ?
00000024 _10             dd ?
00000028 _11             dd ?
0000002C _12             dd ?
00000030 _13             dd ?
00000034 MonsterNode     ends

00000000 MonsterRegion   struc ; (sizeof=0x2E4)
00000000 nAct            db ?
00000001 f1              db 3 dup(?)
00000004 nRooms    dd ?
00000008 _2              dd ?
0000000C nActiveRooms    dd ?
00000010 nNodes          db ?
00000011 mRaritySum      db ?
00000012 nSpawned        db ?
00000013 f11             db ?
00000014 hNodes          MonsterNode 13 dup(?)
000002B8 bMonDensity     dd ?
000002BC bMonUniqMin     db ?
000002BD bMonUniqMax     db ?
000002BE bMonWndr        db ?
000002BF f2BF            db ?
000002C0 nLevel          dd ?
000002C4 nOtherMonsterCounter dd ?
000002C8 nUniqueMonsters_NS dd ?
000002CC nMonsters       dd ?
000002D0 nMonstersDead   dd ?
000002D4 dword2D4        dd ?
000002D8 nQuest          db ?
000002D9 f2D9            db 3 dup(?)
000002DC dwMonLvl        dd ?
000002E0 dwMonLvlCopy    dd ?
000002E4 MonsterRegion   ends
How The Blood Moor quest checks the remaining monsters count:

Code: Select all

int nActiveRooms = D2Common_GetActiveRooms_10555(pGame->pDrlgAct[nAct],  D2LVL_BLOOD_MOOR); // 1.13d (Act*, nLevel)
if ( nActiveRooms > pRegion->nRooms || pRegion->nMonstersDead != pRegion->nMonsters ) {
   int nRemainingMonsters = pRegion->nMonsters - pRegion->nMonstersDead;
} else {
// all monsters are dead
}

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: struct MonsterRegion

Post by kidpaddle94 » Wed Jul 22, 2015 3:18 am

Code: Select all

struct D2MonsterRegionStrc
{
	BYTE nAct;							//0x000
	BYTE __001[3];						//0x001
	int nRooms;							//0x004
	DWORD __008;						//0x008
	int nActiveRooms;					//0x00C
	BYTE nMonCount;						//0x010
	BYTE nTotalRarity;					//0x011
	BYTE nSpawnCount;					//0x012
	BYTE __013;							//0x013
	D2MonRegDataStrc MonRegData[13];	//0x014
	DWORD dwMonDen;						//0x2B8
	BYTE nBossMin;						//0x2BC
	BYTE nBossMax;						//0x2BD
	BYTE nMonWander;					//0x2BE
	BYTE __2BF;							//0x2BF
	DWORD dwlevel;						//0x2C0
	DWORD __2C4;						//0x2C4
	DWORD dwUniqueCount;				//0x2C8
	DWORD dwMonSpawnCount;				//0x2CC
	DWORD dwMonKillCount;				//0x2D0
	DWORD __2D4;						//0x2D4
	BYTE nQuest;						//0x2D8
	BYTE __2D9[3];						//0x2D9
	DWORD dwDungeonLevel;				//0x2DC
	DWORD dwDungeonLevelEx;				//0x2E0
};

struct D2MonRegDataStrc
{
	WORD nMonHcIdx;	//0x00
	BYTE nRarity;	//0x02
	BYTE __03[49];	//0x03
};

Code: Select all

int __fastcall MONSTERS_GetMonstersLeftInLevel(D2GameStrc* pGame, int nLevel)
{
	if (!pGame || nLevel < 0) return -1;
	if (nLevel >= TXT_GetLevelsRecordCount()) return -1;

	D2MonsterRegionStrc* pMonReg = pGame->pMonRegion[nLevel];
	if (!pMonReg) return -1;

	return ((pMonReg->dwMonSpawnCount) - (pMonReg->dwMonKillCount));
}
The struct gets filled when the monsters are generated, so you will not get any info until the level and it's population has been generated (which is usually triggered by a player getting in-range of it). See this: viewtopic.php?p=422307#p422307

User avatar
misiek1294
Junior Member
Paladin
Posts: 168
Joined: Mon Dec 29, 2014 3:58 pm
Poland

Re: struct MonsterRegion

Post by misiek1294 » Fri Jul 24, 2015 12:12 pm

kidpaddle94" wrote:

Code: Select all

struct D2MonsterRegionStrc
{
	BYTE nAct;							//0x000
	BYTE __001[3];						//0x001
	int nRooms;							//0x004
	DWORD __008;						//0x008
	int nActiveRooms;					//0x00C
	BYTE nMonCount;						//0x010
	BYTE nTotalRarity;					//0x011
	BYTE nSpawnCount;					//0x012
	BYTE __013;							//0x013
	D2MonRegDataStrc MonRegData[13];	//0x014
	DWORD dwMonDen;						//0x2B8
	BYTE nBossMin;						//0x2BC
	BYTE nBossMax;						//0x2BD
	BYTE nMonWander;					//0x2BE
	BYTE __2BF;							//0x2BF
	DWORD dwlevel;						//0x2C0
	DWORD __2C4;						//0x2C4
	DWORD dwUniqueCount;				//0x2C8
	DWORD dwMonSpawnCount;				//0x2CC
	DWORD dwMonKillCount;				//0x2D0
	DWORD __2D4;						//0x2D4
	BYTE nQuest;						//0x2D8
	BYTE __2D9[3];						//0x2D9
	DWORD dwDungeonLevel;				//0x2DC
	DWORD dwDungeonLevelEx;				//0x2E0
};

struct D2MonRegDataStrc
{
	WORD nMonHcIdx;	//0x00
	BYTE nRarity;	//0x02
	BYTE __03[49];	//0x03
};

Code: Select all

int __fastcall MONSTERS_GetMonstersLeftInLevel(D2GameStrc* pGame, int nLevel)
{
	if (!pGame || nLevel < 0) return -1;
	if (nLevel >= TXT_GetLevelsRecordCount()) return -1;

	D2MonsterRegionStrc* pMonReg = pGame->pMonRegion[nLevel];
	if (!pMonReg) return -1;

	return ((pMonReg->dwMonSpawnCount) - (pMonReg->dwMonKillCount));
}
The struct gets filled when the monsters are generated, so you will not get any info until the level and it's population has been generated (which is usually triggered by a player getting in-range of it). See this: viewtopic.php?p=422307#p422307
Thanks again ;) Works great .

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: struct MonsterRegion

Post by devurandom » Fri Aug 17, 2018 3:11 am

This came in very useful. Works great!

Thank You
:)


UPDATE:

Code: Select all

DWORD MonWanderSpawnCount;	//0x2C4
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

Post Reply

Return to “Code Editing”