struct MonsterRegion
Moderators: Nefarius, Havvoric
- misiek1294
- Paladin
- Posts: 168
- Joined: Mon Dec 29, 2014 3:58 pm
struct MonsterRegion
Anyone have this struct reference ? I needed counter information , this keep the total number of monsters or just in the field of view character?
- Necrolis
- Throne
- Posts: 9125
- Joined: Sat Mar 25, 2006 1:22 pm
- Location: The Land of the Dead
- Contact:
Re: struct MonsterRegion
From my notes for 1.10
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).
Code: Select all
DWORD nBossCount; // +2C8 - how many uniques were spawned
DWORD nMonCount; // +2CC
DWORD nKillCount; // +2D0
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
- misiek1294
- Paladin
- Posts: 168
- Joined: Mon Dec 29, 2014 3:58 pm
Re: struct MonsterRegion
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;/
Re: struct MonsterRegion
I've got a little bit more info
How The Blood Moor quest checks the remaining monsters count:
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
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
}
My CE Tools:
D2 Offset Calculator
D2 Offset Calculator
- kidpaddle94
- Principality
- Posts: 2057
- Joined: Thu Aug 13, 2009 2:54 pm
- Location: localhost
Re: struct MonsterRegion
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));
}
- misiek1294
- Paladin
- Posts: 168
- Joined: Mon Dec 29, 2014 3:58 pm
Re: struct MonsterRegion
Thanks again Works great .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 };
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#p422307Code: 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)); }
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: struct MonsterRegion
This came in very useful. Works great!
Thank You
UPDATE:
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..