From 8ad915da83f77486c176628f5c4792bf7e4a2d38 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Wed, 18 Sep 2019 17:20:02 -0500 Subject: [PATCH] Fix monsters --- Source/monstdat.cpp | 144 ++++++++++++++++++++++++++++++++++++++++++++ Source/monstdat.h | 4 ++ Source/monster.cpp | 19 +++++- structs.h | 4 ++ 4 files changed, 170 insertions(+), 1 deletion(-) diff --git a/Source/monstdat.cpp b/Source/monstdat.cpp index f06f39076..9c55b6d4f 100644 --- a/Source/monstdat.cpp +++ b/Source/monstdat.cpp @@ -205,6 +205,149 @@ char MonstConvTbl[128] = { * 1 = Avalible in retail and shareware * 2 = avalible in retail only */ +#ifdef HELLFIRE +int MonstAvailTbl[138] = +{ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 2, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 +}; +#else BYTE MonstAvailTbl[112] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -219,6 +362,7 @@ BYTE MonstAvailTbl[112] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0 }; +#endif UniqMonstStruct UniqMonst[] = { // clang-format off diff --git a/Source/monstdat.h b/Source/monstdat.h index a397b64fa..f5dde7a9f 100644 --- a/Source/monstdat.h +++ b/Source/monstdat.h @@ -4,7 +4,11 @@ extern MonsterData monsterdata[]; extern char MonstConvTbl[128]; +#ifdef HELLFIRE +extern int MonstAvailTbl[138]; +#else extern BYTE MonstAvailTbl[112]; +#endif extern UniqMonstStruct UniqMonst[]; #endif /* __MONSTDAT_H__ */ diff --git a/Source/monster.cpp b/Source/monster.cpp index d300e5b38..b6825d608 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -202,6 +202,23 @@ void GetLevelMTypes() return; } +#ifdef HELLFIRE + if ( currlevel == 18 ) + AddMonsterType(117, 1); + if ( currlevel == 19 ) + { + AddMonsterType(117, 1); + AddMonsterType(123, 4); + } + if ( currlevel == 20 ) + AddMonsterType(124, 4); + if ( currlevel == 24 ) + { + AddMonsterType(133, 1); + AddMonsterType(137, 2); + } +#endif + if (!setlevel) { if (QuestStatus(QTYPE_BUTCH)) AddMonsterType(MT_CLEAVER, 2); @@ -237,7 +254,7 @@ void GetLevelMTypes() } nt = 0; - for (i = 0; i < 111; i++) { + for (i = 0; i < NUM_MTYPES; i++) { minl = 15 * monsterdata[i].mMinDLvl / 30 + 1; maxl = 15 * monsterdata[i].mMaxDLvl / 30 + 1; diff --git a/structs.h b/structs.h index a6d12a692..85a10cac0 100644 --- a/structs.h +++ b/structs.h @@ -638,7 +638,11 @@ typedef struct MonsterStruct { // note: missing field _mAFNum } MonsterStruct; typedef struct UniqMonstStruct { +#ifdef HELLFIRE + int mtype; +#else char mtype; +#endif char *mName; char *mTrnName; unsigned char mlevel;