Browse Source

Merge a section of the Hellfire item and quest code

pull/973/head
Anders Jenbo 5 years ago
parent
commit
01590d3757
  1. 6
      Source/inv.cpp
  2. 180
      Source/items.cpp
  3. 2
      Source/items.h
  4. 6
      Source/player.cpp
  5. 4
      Source/player.h
  6. 4
      Source/quests.cpp
  7. 2
      Source/scrollrt.cpp
  8. 93
      Source/stores.cpp
  9. 38
      Source/town.cpp
  10. 1004
      Source/towners.cpp
  11. 2
      Source/trigs.cpp
  12. 4
      defs.h
  13. 2
      structs.h

6
Source/inv.cpp

@ -2524,9 +2524,7 @@ void UseStaffCharge(int pnum)
{ {
if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE
&& (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF && (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF
#ifdef HELLFIRE
|| plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE // BUGFIX: myplr->pnum || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE // BUGFIX: myplr->pnum
#endif
) )
&& plr[pnum].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[pnum]._pRSpell && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[pnum]._pRSpell
&& plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) { && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) {
@ -2539,11 +2537,7 @@ BOOL UseStaff()
{ {
if (pcurs == CURSOR_HAND) { if (pcurs == CURSOR_HAND) {
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE
#ifdef HELLFIRE
&& (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE) && (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE)
#else
&& plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF
#endif
&& plr[myplr].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[myplr]._pRSpell && plr[myplr].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[myplr]._pRSpell
&& plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) { && plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) {
return TRUE; return TRUE;

180
Source/items.cpp

@ -136,7 +136,6 @@ const char *const ItemDropNames[] = {
"Bldstn", "Bldstn",
"Fanvil", "Fanvil",
"FLazStaf", "FLazStaf",
#ifdef HELLFIRE
"bombs1", "bombs1",
"halfps1", "halfps1",
"wholeps1", "wholeps1",
@ -145,7 +144,6 @@ const char *const ItemDropNames[] = {
"cows1", "cows1",
"donkys1", "donkys1",
"mooses1", "mooses1",
#endif
}; };
/** Maps of item drop animation length. */ /** Maps of item drop animation length. */
BYTE ItemAnimLs[] = { BYTE ItemAnimLs[] = {
@ -184,7 +182,6 @@ BYTE ItemAnimLs[] = {
13, 13,
13, 13,
8, 8,
#ifdef HELLFIRE
10, 10,
16, 16,
16, 16,
@ -193,7 +190,6 @@ BYTE ItemAnimLs[] = {
15, 15,
15, 15,
15, 15,
#endif
}; };
/** Maps of drop sounds effect of dropping the item on ground. */ /** Maps of drop sounds effect of dropping the item on ground. */
int ItemDropSnds[] = { int ItemDropSnds[] = {
@ -232,7 +228,6 @@ int ItemDropSnds[] = {
IS_FBLST, IS_FBLST,
IS_FANVL, IS_FANVL,
IS_FSTAF, IS_FSTAF,
#ifdef HELLFIRE
IS_FROCK, IS_FROCK,
IS_FSCRL, IS_FSCRL,
IS_FSCRL, IS_FSCRL,
@ -241,7 +236,6 @@ int ItemDropSnds[] = {
IS_FHARM, IS_FHARM,
IS_FLARM, IS_FLARM,
IS_FLARM, IS_FLARM,
#endif
}; };
/** Maps of drop sounds effect of placing the item in the inventory. */ /** Maps of drop sounds effect of placing the item in the inventory. */
int ItemInvSnds[] = { int ItemInvSnds[] = {
@ -280,7 +274,6 @@ int ItemInvSnds[] = {
IS_IBLST, IS_IBLST,
IS_IANVL, IS_IANVL,
IS_ISTAF, IS_ISTAF,
#ifdef HELLFIRE
IS_IROCK, IS_IROCK,
IS_ISCROL, IS_ISCROL,
IS_ISCROL, IS_ISCROL,
@ -289,7 +282,6 @@ int ItemInvSnds[] = {
IS_IHARM, IS_IHARM,
IS_ILARM, IS_ILARM,
IS_ILARM, IS_ILARM,
#endif
}; };
char *off_4A5AC4 = "SItem"; char *off_4A5AC4 = "SItem";
/** Specifies the current Y-coordinate used for validation of items on ground. */ /** Specifies the current Y-coordinate used for validation of items on ground. */
@ -510,14 +502,9 @@ int items_get_currlevel()
void InitItemGFX() void InitItemGFX()
{ {
#ifdef HELLFIRE
DWORD i;
#else
int i;
#endif
char arglist[64]; char arglist[64];
for (i = 0; i < ITEMTYPES; i++) { for (int i = 0; i < ITEMTYPES; i++) {
sprintf(arglist, "Items\\%s.CEL", ItemDropNames[i]); sprintf(arglist, "Items\\%s.CEL", ItemDropNames[i]);
itemanims[i] = LoadFileInMem(arglist, NULL); itemanims[i] = LoadFileInMem(arglist, NULL);
} }
@ -546,9 +533,7 @@ void AddInitItems()
{ {
int x, y, i, j, rnd; int x, y, i, j, rnd;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
rnd = random_(11, 3) + 3; rnd = random_(11, 3) + 3;
for (j = 0; j < rnd; j++) { for (j = 0; j < rnd; j++) {
i = itemavail[0]; i = itemavail[0];
@ -565,19 +550,11 @@ void AddInitItems()
dItem[x][y] = i + 1; dItem[x][y] = i + 1;
item[i]._iSeed = GetRndSeed(); item[i]._iSeed = GetRndSeed();
SetRndSeed(item[i]._iSeed); SetRndSeed(item[i]._iSeed);
#ifdef HELLFIRE
if (random_(12, 2) != 0) if (random_(12, 2) != 0)
GetItemAttrs(i, IDI_HEAL, curlv); GetItemAttrs(i, IDI_HEAL, curlv);
else else
GetItemAttrs(i, IDI_MANA, curlv); GetItemAttrs(i, IDI_MANA, curlv);
item[i]._iCreateInfo = curlv - CF_PREGEN; item[i]._iCreateInfo = curlv - CF_PREGEN;
#else
if (random_(12, 2) != 0)
GetItemAttrs(i, IDI_HEAL, currlevel);
else
GetItemAttrs(i, IDI_MANA, currlevel);
item[i]._iCreateInfo = currlevel - CF_PREGEN;
#endif
SetupItem(i); SetupItem(i);
item[i]._iAnimFrame = item[i]._iAnimLen; item[i]._iAnimFrame = item[i]._iAnimLen;
item[i]._iAnimFlag = FALSE; item[i]._iAnimFlag = FALSE;
@ -642,18 +619,14 @@ void InitItems()
SpawnRock(); SpawnRock();
if (QuestStatus(Q_ANVIL)) if (QuestStatus(Q_ANVIL))
SpawnQuestItem(IDI_ANVIL, 2 * setpc_x + 27, 2 * setpc_y + 27, 0, 1); SpawnQuestItem(IDI_ANVIL, 2 * setpc_x + 27, 2 * setpc_y + 27, 0, 1);
#ifdef HELLFIRE
if (UseCowFarmer && currlevel == 20) if (UseCowFarmer && currlevel == 20)
SpawnQuestItem(IDI_BROWNSUIT, 25, 25, 3, 1); SpawnQuestItem(IDI_BROWNSUIT, 25, 25, 3, 1);
if (UseCowFarmer && currlevel == 19) if (UseCowFarmer && currlevel == 19)
SpawnQuestItem(IDI_GREYSUIT, 25, 25, 3, 1); SpawnQuestItem(IDI_GREYSUIT, 25, 25, 3, 1);
#endif
if (currlevel > 0 && currlevel < 16) if (currlevel > 0 && currlevel < 16)
AddInitItems(); AddInitItems();
#ifdef HELLFIRE
if (currlevel >= 21 && currlevel <= 23) if (currlevel >= 21 && currlevel <= 23)
items_42390F(); items_42390F();
#endif
} }
uitemflag = FALSE; uitemflag = FALSE;
@ -677,9 +650,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
int iflgs = ISPL_NONE; // item_special_effect flags int iflgs = ISPL_NONE; // item_special_effect flags
#ifdef HELLFIRE
int pDamAcFlags = 0; int pDamAcFlags = 0;
#endif
int sadd = 0; // added strength int sadd = 0; // added strength
int madd = 0; // added magic int madd = 0; // added magic
@ -732,9 +703,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
bac += tmpac; bac += tmpac;
} }
iflgs |= itm->_iFlags; iflgs |= itm->_iFlags;
#ifdef HELLFIRE
pDamAcFlags |= itm->_iDamAcFlags; pDamAcFlags |= itm->_iDamAcFlags;
#endif
sadd += itm->_iPLStr; sadd += itm->_iPLStr;
madd += itm->_iPLMag; madd += itm->_iPLMag;
dadd += itm->_iPLDex; dadd += itm->_iPLDex;
@ -795,9 +764,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
plr[p]._pIBonusToHit = btohit; plr[p]._pIBonusToHit = btohit;
plr[p]._pIBonusAC = bac; plr[p]._pIBonusAC = bac;
plr[p]._pIFlags = iflgs; plr[p]._pIFlags = iflgs;
#ifdef HELLFIRE
plr[p].pDamAcFlags = pDamAcFlags; plr[p].pDamAcFlags = pDamAcFlags;
#endif
plr[p]._pIBonusDamMod = dmod; plr[p]._pIBonusDamMod = dmod;
plr[p]._pIGetHit = ghit; plr[p]._pIGetHit = ghit;
@ -915,10 +882,8 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
if (mr > MAXRESIST) if (mr > MAXRESIST)
mr = MAXRESIST; mr = MAXRESIST;
#ifdef HELLFIRE
else if (mr < 0) else if (mr < 0)
mr = 0; mr = 0;
#endif
plr[p]._pMagResist = mr; plr[p]._pMagResist = mr;
if (fr > MAXRESIST) if (fr > MAXRESIST)
@ -1081,9 +1046,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
if (missile[mi]._mitype == MIS_MANASHIELD && missile[mi]._misource == p) { if (missile[mi]._mitype == MIS_MANASHIELD && missile[mi]._misource == p) {
missile[mi]._miVar1 = plr[p]._pHitPoints; missile[mi]._miVar1 = plr[p]._pHitPoints;
missile[mi]._miVar2 = plr[p]._pHPBase; missile[mi]._miVar2 = plr[p]._pHPBase;
#ifdef HELLFIRE
break; break;
#endif
} }
} }
#ifdef HELLFIRE #ifdef HELLFIRE
@ -1652,9 +1615,7 @@ void GetBookSpell(int i, int lvl)
lvl = 5; lvl = 5;
s = SPL_FIREBOLT; s = SPL_FIREBOLT;
#ifdef HELLFIRE
bs = SPL_FIREBOLT; bs = SPL_FIREBOLT;
#endif
while (rv > 0) { while (rv > 0) {
int sLevel = GetSpellBookLevel(s); int sLevel = GetSpellBookLevel(s);
if (sLevel != -1 && lvl >= sLevel) { if (sLevel != -1 && lvl >= sLevel) {
@ -1681,15 +1642,9 @@ void GetBookSpell(int i, int lvl)
item[i]._iIvalue += spelldata[bs].sBookCost; item[i]._iIvalue += spelldata[bs].sBookCost;
if (spelldata[bs].sType == STYPE_FIRE) if (spelldata[bs].sType == STYPE_FIRE)
item[i]._iCurs = ICURS_BOOK_RED; item[i]._iCurs = ICURS_BOOK_RED;
#ifdef HELLFIRE else if (spelldata[bs].sType == STYPE_LIGHTNING)
else
#endif
if (spelldata[bs].sType == STYPE_LIGHTNING)
item[i]._iCurs = ICURS_BOOK_BLUE; item[i]._iCurs = ICURS_BOOK_BLUE;
#ifdef HELLFIRE else if (spelldata[bs].sType == STYPE_MAGIC)
else
#endif
if (spelldata[bs].sType == STYPE_MAGIC)
item[i]._iCurs = ICURS_BOOK_GREY; item[i]._iCurs = ICURS_BOOK_GREY;
} }
@ -1970,11 +1925,9 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
case IPL_DAMP_CURSE: case IPL_DAMP_CURSE:
item[i]._iPLDam -= r; item[i]._iPLDam -= r;
break; break;
#ifdef HELLFIRE
case IPL_DOPPELGANGER: case IPL_DOPPELGANGER:
item[i]._iDamAcFlags |= 16; item[i]._iDamAcFlags |= 16;
// no break // no break
#endif
case IPL_TOHIT_DAMP: case IPL_TOHIT_DAMP:
r = RndPL(param1, param2); r = RndPL(param1, param2);
item[i]._iPLDam += r; item[i]._iPLDam += r;
@ -2139,11 +2092,9 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
item[i]._iMaxDur += r2; item[i]._iMaxDur += r2;
item[i]._iDurability += r2; item[i]._iDurability += r2;
break; break;
#ifdef HELLFIRE
case IPL_CRYSTALLINE: case IPL_CRYSTALLINE:
item[i]._iPLDam += 140 + r * 2; item[i]._iPLDam += 140 + r * 2;
// no break // no break
#endif
case IPL_DUR_CURSE: case IPL_DUR_CURSE:
item[i]._iMaxDur -= r * item[i]._iMaxDur / 100; item[i]._iMaxDur -= r * item[i]._iMaxDur / 100;
if (item[i]._iMaxDur < 1) if (item[i]._iMaxDur < 1)
@ -2160,11 +2111,9 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
case IPL_LIGHT_CURSE: case IPL_LIGHT_CURSE:
item[i]._iPLLight -= param1; item[i]._iPLLight -= param1;
break; break;
#ifdef HELLFIRE
case IPL_MULT_ARROWS: case IPL_MULT_ARROWS:
item[i]._iFlags |= ISPL_MULT_ARROWS; item[i]._iFlags |= ISPL_MULT_ARROWS;
break; break;
#endif
case IPL_FIRE_ARROWS: case IPL_FIRE_ARROWS:
item[i]._iFlags |= ISPL_FIRE_ARROWS; item[i]._iFlags |= ISPL_FIRE_ARROWS;
#ifdef HELLFIRE #ifdef HELLFIRE
@ -2327,7 +2276,6 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
if (item[i]._iPLFR < 0) if (item[i]._iPLFR < 0)
item[i]._iPLFR = 0; item[i]._iPLFR = 0;
break; break;
#ifdef HELLFIRE
case IPL_FIRERES_CURSE: case IPL_FIRERES_CURSE:
item[i]._iPLFR -= r; item[i]._iPLFR -= r;
break; break;
@ -2371,7 +2319,6 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
item[i]._iPLHP -= (r2 << 6); item[i]._iPLHP -= (r2 << 6);
item[i]._iPLMana += (r2 << 6); item[i]._iPLMana += (r2 << 6);
break; break;
#endif
} }
if (item[i]._iVAdd1 || item[i]._iVMult1) { if (item[i]._iVAdd1 || item[i]._iVMult1) {
item[i]._iVAdd2 = PLVal(r, param1, param2, minval, maxval); item[i]._iVAdd2 = PLVal(r, param1, param2, minval, maxval);
@ -2461,15 +2408,11 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood)
} }
} }
if (!control_WriteStringToBuffer((BYTE *)item[i]._iIName)) { if (!control_WriteStringToBuffer((BYTE *)item[i]._iIName)) {
#ifdef HELLFIRE
int aii = item[i].IDidx; int aii = item[i].IDidx;
if (AllItemsList[aii].iSName) if (AllItemsList[aii].iSName)
strcpy(item[i]._iIName, AllItemsList[aii].iSName); strcpy(item[i]._iIName, AllItemsList[aii].iSName);
else else
item[i]._iName[0] = 0; item[i]._iName[0] = 0;
#else
strcpy(item[i]._iIName, AllItemsList[item[i].IDidx].iSName);
#endif
if (preidx != -1) { if (preidx != -1) {
sprintf(istr, "%s %s", PL_Prefix[preidx].PLName, item[i]._iIName); sprintf(istr, "%s %s", PL_Prefix[preidx].PLName, item[i]._iIName);
@ -2607,9 +2550,7 @@ int RndUItem(int m)
if (m != -1 && (monster[m].MData->mTreasure & 0x8000) != 0 && gbMaxPlayers == 1) if (m != -1 && (monster[m].MData->mTreasure & 0x8000) != 0 && gbMaxPlayers == 1)
return -1 - (monster[m].MData->mTreasure & 0xFFF); return -1 - (monster[m].MData->mTreasure & 0xFFF);
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
ri = 0; ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
okflag = TRUE; okflag = TRUE;
@ -2619,11 +2560,7 @@ int RndUItem(int m)
if (monster[m].mLevel < AllItemsList[i].iMinMLvl) if (monster[m].mLevel < AllItemsList[i].iMinMLvl)
okflag = FALSE; okflag = FALSE;
} else { } else {
#ifdef HELLFIRE
if (2 * curlv < AllItemsList[i].iMinMLvl) if (2 * curlv < AllItemsList[i].iMinMLvl)
#else
if (2 * currlevel < AllItemsList[i].iMinMLvl)
#endif
okflag = FALSE; okflag = FALSE;
} }
if (AllItemsList[i].itype == ITYPE_MISC) if (AllItemsList[i].itype == ITYPE_MISC)
@ -2659,16 +2596,10 @@ int RndAllItems()
if (random_(26, 100) > 25) if (random_(26, 100) > 25)
return 0; return 0;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
ri = 0; ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
#ifdef HELLFIRE
if (AllItemsList[i].iRnd != IDROP_NEVER && 2 * curlv >= AllItemsList[i].iMinMLvl && ri < 512) { if (AllItemsList[i].iRnd != IDROP_NEVER && 2 * curlv >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd != IDROP_NEVER && 2 * currlevel >= AllItemsList[i].iMinMLvl) {
#endif
ril[ri] = i; ril[ri] = i;
ri++; ri++;
} }
@ -2681,11 +2612,7 @@ int RndAllItems()
return ril[random_(26, ri)]; return ril[random_(26, ri)];
} }
#ifdef HELLFIRE
int RndTypeItems(int itype, int imid, int lvl) int RndTypeItems(int itype, int imid, int lvl)
#else
int RndTypeItems(int itype, int imid)
#endif
{ {
int i, ri; int i, ri;
BOOL okflag; BOOL okflag;
@ -2696,21 +2623,13 @@ int RndTypeItems(int itype, int imid)
okflag = TRUE; okflag = TRUE;
if (AllItemsList[i].iRnd == IDROP_NEVER) if (AllItemsList[i].iRnd == IDROP_NEVER)
okflag = FALSE; okflag = FALSE;
#ifdef HELLFIRE
if (lvl << 1 < AllItemsList[i].iMinMLvl) if (lvl << 1 < AllItemsList[i].iMinMLvl)
#else
if (currlevel << 1 < AllItemsList[i].iMinMLvl)
#endif
okflag = FALSE; okflag = FALSE;
if (AllItemsList[i].itype != itype) if (AllItemsList[i].itype != itype)
okflag = FALSE; okflag = FALSE;
if (imid != -1 && AllItemsList[i].iMiscId != imid) if (imid != -1 && AllItemsList[i].iMiscId != imid)
okflag = FALSE; okflag = FALSE;
#ifdef HELLFIRE
if (okflag && ri < 512) { if (okflag && ri < 512) {
#else
if (okflag) {
#endif
ril[ri] = i; ril[ri] = i;
ri++; ri++;
} }
@ -2787,9 +2706,7 @@ void SpawnUnique(int uid, int x, int y)
{ {
int ii, itype; int ii, itype;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (numitems >= MAXITEMS) if (numitems >= MAXITEMS)
return; return;
@ -2803,11 +2720,7 @@ void SpawnUnique(int uid, int x, int y)
itype++; itype++;
} }
#ifdef HELLFIRE
GetItemAttrs(ii, itype, curlv); GetItemAttrs(ii, itype, curlv);
#else
GetItemAttrs(ii, itype, currlevel);
#endif
GetUniqueItem(ii, uid); GetUniqueItem(ii, uid);
SetupItem(ii); SetupItem(ii);
numitems++; numitems++;
@ -2931,9 +2844,7 @@ void CreateItem(int uid, int x, int y)
{ {
int ii, idx; int ii, idx;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (numitems < MAXITEMS) { if (numitems < MAXITEMS) {
ii = itemavail[0]; ii = itemavail[0];
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
@ -2945,11 +2856,7 @@ void CreateItem(int uid, int x, int y)
idx++; idx++;
} }
#ifdef HELLFIRE
GetItemAttrs(ii, idx, curlv); GetItemAttrs(ii, idx, curlv);
#else
GetItemAttrs(ii, idx, currlevel);
#endif
GetUniqueItem(ii, uid); GetUniqueItem(ii, uid);
SetupItem(ii); SetupItem(ii);
item[ii]._iMagical = ITEM_QUALITY_UNIQUE; item[ii]._iMagical = ITEM_QUALITY_UNIQUE;
@ -2961,9 +2868,7 @@ void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, BOOL delta)
{ {
int idx, ii; int idx, ii;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (onlygood) if (onlygood)
idx = RndUItem(-1); idx = RndUItem(-1);
else else
@ -2974,11 +2879,7 @@ void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, BOOL delta)
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
#ifdef HELLFIRE
SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta); SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta);
#else
SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, FALSE, delta);
#endif
if (sendmsg) if (sendmsg)
NetSendCmdDItem(FALSE, ii); NetSendCmdDItem(FALSE, ii);
if (delta) if (delta)
@ -3041,19 +2942,13 @@ void CreateRndUseful(int pnum, int x, int y, BOOL sendmsg)
{ {
int ii; int ii;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (numitems < MAXITEMS) { if (numitems < MAXITEMS) {
ii = itemavail[0]; ii = itemavail[0];
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
#ifdef HELLFIRE
SetupAllUseful(ii, GetRndSeed(), curlv); SetupAllUseful(ii, GetRndSeed(), curlv);
#else
SetupAllUseful(ii, GetRndSeed(), currlevel);
#endif
if (sendmsg) { if (sendmsg) {
NetSendCmdDItem(FALSE, ii); NetSendCmdDItem(FALSE, ii);
} }
@ -3065,14 +2960,9 @@ void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL send
{ {
int idx, ii; int idx, ii;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
if (itype != ITYPE_GOLD) if (itype != ITYPE_GOLD)
idx = RndTypeItems(itype, imisc, curlv); idx = RndTypeItems(itype, imisc, curlv);
#else
if (itype != ITYPE_GOLD)
idx = RndTypeItems(itype, imisc);
#endif
else else
idx = 0; idx = 0;
@ -3081,11 +2971,7 @@ void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL send
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
#ifdef HELLFIRE
SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta); SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta);
#else
SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, FALSE, delta);
#endif
if (sendmsg) if (sendmsg)
NetSendCmdDItem(FALSE, ii); NetSendCmdDItem(FALSE, ii);
@ -3226,9 +3112,7 @@ void SpawnQuestItem(int itemid, int x, int y, int randarea, int selflag)
BOOL failed; BOOL failed;
int i, j, tries; int i, j, tries;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (randarea) { if (randarea) {
tries = 0; tries = 0;
while (1) { while (1) {
@ -3255,11 +3139,7 @@ void SpawnQuestItem(int itemid, int x, int y, int randarea, int selflag)
item[i]._ix = x; item[i]._ix = x;
item[i]._iy = y; item[i]._iy = y;
dItem[x][y] = i + 1; dItem[x][y] = i + 1;
#ifdef HELLFIRE
GetItemAttrs(i, itemid, curlv); GetItemAttrs(i, itemid, curlv);
#else
GetItemAttrs(i, itemid, currlevel);
#endif
SetupItem(i); SetupItem(i);
item[i]._iPostDraw = TRUE; item[i]._iPostDraw = TRUE;
if (selflag) { if (selflag) {
@ -3282,9 +3162,7 @@ void SpawnRock()
ii = objectactive[i]; ii = objectactive[i];
ostand = object[ii]._otype == OBJ_STAND; ostand = object[ii]._otype == OBJ_STAND;
} }
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (ostand) { if (ostand) {
i = itemavail[0]; i = itemavail[0];
itemavail[0] = itemavail[127 - numitems - 1]; itemavail[0] = itemavail[127 - numitems - 1];
@ -3294,11 +3172,7 @@ void SpawnRock()
item[i]._ix = xx; item[i]._ix = xx;
item[i]._iy = yy; item[i]._iy = yy;
dItem[xx][item[i]._iy] = i + 1; dItem[xx][item[i]._iy] = i + 1;
#ifdef HELLFIRE
GetItemAttrs(i, IDI_ROCK, curlv); GetItemAttrs(i, IDI_ROCK, curlv);
#else
GetItemAttrs(i, IDI_ROCK, currlevel);
#endif
SetupItem(i); SetupItem(i);
item[i]._iSelFlag = 2; item[i]._iSelFlag = 2;
item[i]._iPostDraw = TRUE; item[i]._iPostDraw = TRUE;
@ -5698,26 +5572,21 @@ void CreateSpellBook(int x, int y, int ispell, BOOL sendmsg, BOOL delta)
BOOL done; BOOL done;
done = FALSE; done = FALSE;
#ifdef HELLFIRE int lvl = currlevel;
int lvl = GetSpellBookLevel(ispell) + 1; if (gbIsHellfire) {
if (lvl < 1) { lvl = GetSpellBookLevel(ispell) + 1;
return; if (lvl < 1) {
return;
}
} }
idx = RndTypeItems(ITYPE_MISC, IMISC_BOOK, lvl); idx = RndTypeItems(ITYPE_MISC, IMISC_BOOK, lvl);
#else
idx = RndTypeItems(ITYPE_MISC, IMISC_BOOK);
#endif
if (numitems < MAXITEMS) { if (numitems < MAXITEMS) {
ii = itemavail[0]; ii = itemavail[0];
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
while (!done) { while (!done) {
#ifdef HELLFIRE
SetupAllItems(ii, idx, GetRndSeed(), 2 * lvl, 1, TRUE, FALSE, delta); SetupAllItems(ii, idx, GetRndSeed(), 2 * lvl, 1, TRUE, FALSE, delta);
#else
SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, TRUE, FALSE, delta);
#endif
if (item[ii]._iMiscId == IMISC_BOOK && item[ii]._iSpell == ispell) if (item[ii]._iMiscId == IMISC_BOOK && item[ii]._iSpell == ispell)
done = TRUE; done = TRUE;
} }
@ -5735,33 +5604,19 @@ void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL del
BOOL done; BOOL done;
done = FALSE; done = FALSE;
#ifdef HELLFIRE
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (numitems < MAXITEMS) { if (numitems < MAXITEMS) {
ii = itemavail[0]; ii = itemavail[0];
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
#ifdef HELLFIRE
idx = RndTypeItems(imisc, IMISC_NONE, curlv); idx = RndTypeItems(imisc, IMISC_NONE, curlv);
#else
idx = RndTypeItems(imisc, IMISC_NONE);
#endif
while (!done) { while (!done) {
#ifdef HELLFIRE
SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, TRUE, FALSE, delta); SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, TRUE, FALSE, delta);
#else
SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, TRUE, FALSE, delta);
#endif
if (item[ii]._iCurs == icurs) if (item[ii]._iCurs == icurs)
done = TRUE; done = TRUE;
else else
#ifdef HELLFIRE
idx = RndTypeItems(imisc, IMISC_NONE, curlv); idx = RndTypeItems(imisc, IMISC_NONE, curlv);
#else
idx = RndTypeItems(imisc, IMISC_NONE);
#endif
} }
if (sendmsg) if (sendmsg)
NetSendCmdDItem(FALSE, ii); NetSendCmdDItem(FALSE, ii);
@ -5771,7 +5626,6 @@ void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL del
} }
} }
#ifdef HELLFIRE
void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta) void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta)
{ {
int ii, idx; int ii, idx;
@ -5799,46 +5653,30 @@ void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta)
numitems++; numitems++;
} }
} }
#endif
void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta) void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta)
{ {
int ii, idx; int ii, idx;
BOOL done; BOOL done;
done = FALSE;
#ifdef HELLFIRE
int imid; int imid;
if (imisc == ITYPE_STAFF) if (imisc == ITYPE_STAFF)
imid = IMISC_STAFF; imid = IMISC_STAFF;
else else
imid = IMISC_NONE; imid = IMISC_NONE;
int curlv = items_get_currlevel(); int curlv = items_get_currlevel();
#endif
if (numitems < MAXITEMS) { if (numitems < MAXITEMS) {
ii = itemavail[0]; ii = itemavail[0];
GetSuperItemSpace(x, y, ii); GetSuperItemSpace(x, y, ii);
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemavail[0] = itemavail[MAXITEMS - numitems - 1];
itemactive[numitems] = ii; itemactive[numitems] = ii;
#ifdef HELLFIRE
idx = RndTypeItems(imisc, imid, curlv); idx = RndTypeItems(imisc, imid, curlv);
#else
idx = RndTypeItems(imisc, IMISC_NONE);
#endif
while (!done) { while (!done) {
#ifdef HELLFIRE
SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, TRUE, FALSE, delta); SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, TRUE, FALSE, delta);
#else
SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, TRUE, FALSE, delta);
#endif
if (item[ii]._iCurs == icurs) if (item[ii]._iCurs == icurs)
done = TRUE; done = TRUE;
else else
#ifdef HELLFIRE
idx = RndTypeItems(imisc, imid, curlv); idx = RndTypeItems(imisc, imid, curlv);
#else
idx = RndTypeItems(imisc, IMISC_NONE);
#endif
} }
if (sendmsg) if (sendmsg)
NetSendCmdDItem(FALSE, ii); NetSendCmdDItem(FALSE, ii);

2
Source/items.h

@ -98,9 +98,7 @@ void RecalcStoreStats();
int ItemNoFlippy(); int ItemNoFlippy();
void CreateSpellBook(int x, int y, int ispell, BOOL sendmsg, BOOL delta); void CreateSpellBook(int x, int y, int ispell, BOOL sendmsg, BOOL delta);
void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta); void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta);
#ifdef HELLFIRE
void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta); void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta);
#endif
void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta); void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta);
BOOL GetItemRecord(int nSeed, WORD wCI, int nIndex); BOOL GetItemRecord(int nSeed, WORD wCI, int nIndex);
void SetItemRecord(int nSeed, WORD wCI, int nIndex); void SetItemRecord(int nSeed, WORD wCI, int nIndex);

6
Source/player.cpp

@ -135,11 +135,9 @@ const char *const ClassStrTblOld[] = {
"Warrior", "Warrior",
"Rogue", "Rogue",
"Sorceror", "Sorceror",
#ifdef HELLFIRE
"Monk", "Monk",
"Bard", "Bard",
"Barbarian", "Barbarian",
#endif
}; };
/** Maps from player_class to maximum stats. */ /** Maps from player_class to maximum stats. */
int MaxStats[NUM_CLASSES][4] = { int MaxStats[NUM_CLASSES][4] = {
@ -599,7 +597,6 @@ void SetPlrAnims(int pnum)
plr[pnum]._pAFrames = 24; plr[pnum]._pAFrames = 24;
plr[pnum]._pAFNum = 16; plr[pnum]._pAFNum = 16;
} }
#ifdef HELLFIRE
} else if (pc == PC_MONK) { } else if (pc == PC_MONK) {
plr[pnum]._pNWidth = 112; plr[pnum]._pNWidth = 112;
plr[pnum]._pWWidth = 112; plr[pnum]._pWWidth = 112;
@ -657,7 +654,6 @@ void SetPlrAnims(int pnum)
} else if (gn == ANIM_ID_MACE || gn == ANIM_ID_MACE_SHIELD) { } else if (gn == ANIM_ID_MACE || gn == ANIM_ID_MACE_SHIELD) {
plr[pnum]._pAFNum = 8; plr[pnum]._pAFNum = 8;
} }
#endif
} }
} }
@ -889,10 +885,8 @@ void NextPlrLevel(int pnum)
if (plr[pnum]._pClass == PC_WARRIOR) if (plr[pnum]._pClass == PC_WARRIOR)
mana = 64; mana = 64;
#ifdef HELLFIRE
else if (plr[pnum]._pClass == PC_BARBARIAN) else if (plr[pnum]._pClass == PC_BARBARIAN)
mana = 0; mana = 0;
#endif
else else
mana = 128; mana = 128;

4
Source/player.h

@ -45,9 +45,7 @@ void RemovePlrFromMap(int pnum);
void StartPlrHit(int pnum, int dam, BOOL forcehit); void StartPlrHit(int pnum, int dam, BOOL forcehit);
void StartPlayerKill(int pnum, int earflag); void StartPlayerKill(int pnum, int earflag);
void DropHalfPlayersGold(int pnum); void DropHalfPlayersGold(int pnum);
#ifdef HELLFIRE
void StripTopGold(int pnum); void StripTopGold(int pnum);
#endif
void SyncPlrKill(int pnum, int earflag); void SyncPlrKill(int pnum, int earflag);
void RemovePlrMissiles(int pnum); void RemovePlrMissiles(int pnum);
void StartNewLvl(int pnum, int fom, int lvl); void StartNewLvl(int pnum, int fom, int lvl);
@ -73,11 +71,9 @@ void SetPlrDex(int p, int v);
void SetPlrVit(int p, int v); void SetPlrVit(int p, int v);
void InitDungMsgs(int pnum); void InitDungMsgs(int pnum);
void PlayDungMsgs(); void PlayDungMsgs();
#ifdef HELLFIRE
int get_max_strength(int i); int get_max_strength(int i);
int get_max_magic(int i); int get_max_magic(int i);
int get_max_dexterity(int i); int get_max_dexterity(int i);
#endif
/* data */ /* data */

4
Source/quests.cpp

@ -115,6 +115,8 @@ void InitQuests()
initiatedQuests = 0; initiatedQuests = 0;
for (z = 0; z < MAXQUESTS; z++) { for (z = 0; z < MAXQUESTS; z++) {
if (!gbIsHellfire && z >= 16)
break;
if (gbMaxPlayers > 1 && !(questlist[z]._qflags & QUEST_ANY)) if (gbMaxPlayers > 1 && !(questlist[z]._qflags & QUEST_ANY))
continue; continue;
quests[z]._qtype = questlist[z]._qdtype; quests[z]._qtype = questlist[z]._qdtype;
@ -696,7 +698,6 @@ void ResyncMPQuests()
} }
if (QuestStatus(Q_BETRAYER)) if (QuestStatus(Q_BETRAYER))
AddObject(OBJ_ALTBOY, 2 * setpc_x + 20, 2 * setpc_y + 22); AddObject(OBJ_ALTBOY, 2 * setpc_x + 20, 2 * setpc_y + 22);
#ifdef HELLFIRE
if (quests[Q_GRAVE]._qactive == 1 && currlevel == quests[Q_GRAVE]._qlevel - 1) { if (quests[Q_GRAVE]._qactive == 1 && currlevel == quests[Q_GRAVE]._qlevel - 1) {
quests[Q_GRAVE]._qactive = 2; quests[Q_GRAVE]._qactive = 2;
NetSendCmdQuest(TRUE, Q_GRAVE); NetSendCmdQuest(TRUE, Q_GRAVE);
@ -713,7 +714,6 @@ void ResyncMPQuests()
quests[Q_JERSEY]._qactive = 2; quests[Q_JERSEY]._qactive = 2;
NetSendCmdQuest(TRUE, Q_JERSEY); NetSendCmdQuest(TRUE, Q_JERSEY);
} }
#endif
} }
void ResyncQuests() void ResyncQuests()

2
Source/scrollrt.cpp

@ -404,7 +404,6 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
misfiledata[MFILE_MANASHLD].mAnimWidth[0]); misfiledata[MFILE_MANASHLD].mAnimWidth[0]);
} else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) { } else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) {
Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, 1); Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, 1);
#ifndef HELLFIRE
if (plr[pnum].pManaShield) if (plr[pnum].pManaShield)
Cl2DrawLightTbl( Cl2DrawLightTbl(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0], px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
@ -413,7 +412,6 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
1, 1,
misfiledata[MFILE_MANASHLD].mAnimWidth[0], misfiledata[MFILE_MANASHLD].mAnimWidth[0],
1); 1);
#endif
} else { } else {
l = light_table_index; l = light_table_index;
if (light_table_index < 5) if (light_table_index < 5)

93
Source/stores.cpp

@ -575,7 +575,6 @@ BOOL S_StartSPBuy()
BOOL SmithSellOk(int i) BOOL SmithSellOk(int i)
{ {
#ifdef HELLFIRE
ItemStruct *pI; ItemStruct *pI;
if (i >= 0) { if (i >= 0) {
@ -596,26 +595,12 @@ BOOL SmithSellOk(int i)
return FALSE; return FALSE;
if (pI->_itype == ITYPE_MEAT) if (pI->_itype == ITYPE_MEAT)
return FALSE; return FALSE;
if (pI->_itype == ITYPE_STAFF && pI->_iSpell != SPL_NULL) if (pI->_itype == ITYPE_STAFF && (!gbIsHellfire || pI->_iSpell != SPL_NULL))
return FALSE; return FALSE;
if (pI->_iClass == ICLASS_QUEST) if (pI->_iClass == ICLASS_QUEST)
return FALSE; return FALSE;
if (pI->IDidx == IDI_LAZSTAFF) if (pI->IDidx == IDI_LAZSTAFF)
return FALSE; return FALSE;
#else
if (plr[myplr].InvList[i]._itype == ITYPE_NONE)
return FALSE;
if (plr[myplr].InvList[i]._itype == ITYPE_MISC)
return FALSE;
if (plr[myplr].InvList[i]._itype == ITYPE_GOLD)
return FALSE;
if (plr[myplr].InvList[i]._itype == ITYPE_MEAT)
return FALSE;
if (plr[myplr].InvList[i]._itype == ITYPE_STAFF)
return FALSE;
if (plr[myplr].InvList[i].IDidx == IDI_LAZSTAFF)
return FALSE;
#endif
return TRUE; return TRUE;
} }
@ -673,10 +658,8 @@ void S_StartSSell()
storehold[i]._itype = ITYPE_NONE; storehold[i]._itype = ITYPE_NONE;
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (SmithSellOk(i)) { if (SmithSellOk(i)) {
sellok = TRUE; sellok = TRUE;
storehold[storenumh] = plr[myplr].InvList[i]; storehold[storenumh] = plr[myplr].InvList[i];
@ -691,7 +674,6 @@ void S_StartSSell()
storehidx[storenumh++] = i; storehidx[storenumh++] = i;
} }
} }
#ifdef HELLFIRE
for (i = 0; i < MAXBELTITEMS; i++) { for (i = 0; i < MAXBELTITEMS; i++) {
if (storenumh >= 48) if (storenumh >= 48)
@ -710,7 +692,6 @@ void S_StartSSell()
storehidx[storenumh++] = -(i + 1); storehidx[storenumh++] = -(i + 1);
} }
} }
#endif
if (!sellok) { if (!sellok) {
stextscrl = FALSE; stextscrl = FALSE;
@ -800,10 +781,8 @@ void S_StartSRepair()
AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_HAND_RIGHT], -4); AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_HAND_RIGHT], -4);
} }
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (SmithRepairOk(i)) { if (SmithRepairOk(i)) {
repairok = TRUE; repairok = TRUE;
AddStoreHoldRepair(&plr[myplr].InvList[i], i); AddStoreHoldRepair(&plr[myplr].InvList[i], i);
@ -923,15 +902,11 @@ BOOL WitchSellOk(int i)
if (pI->_itype == ITYPE_MISC) if (pI->_itype == ITYPE_MISC)
rv = TRUE; rv = TRUE;
#ifdef HELLFIRE
if (pI->_iMiscId > 29 && pI->_iMiscId < 41) if (pI->_iMiscId > 29 && pI->_iMiscId < 41)
rv = FALSE; rv = FALSE;
if (pI->_iClass == ICLASS_QUEST) if (pI->_iClass == ICLASS_QUEST)
rv = FALSE; rv = FALSE;
if (pI->_itype == ITYPE_STAFF && pI->_iSpell != SPL_NULL) if (pI->_itype == ITYPE_STAFF && (!gbIsHellfire || pI->_iSpell != SPL_NULL))
#else
if (pI->_itype == ITYPE_STAFF)
#endif
rv = TRUE; rv = TRUE;
if (pI->IDidx >= IDI_FIRSTQUEST && pI->IDidx <= IDI_LASTQUEST) if (pI->IDidx >= IDI_FIRSTQUEST && pI->IDidx <= IDI_LASTQUEST)
rv = FALSE; rv = FALSE;
@ -953,10 +928,8 @@ void S_StartWSell()
storehold[i]._itype = ITYPE_NONE; storehold[i]._itype = ITYPE_NONE;
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (WitchSellOk(i)) { if (WitchSellOk(i)) {
sellok = TRUE; sellok = TRUE;
storehold[storenumh] = plr[myplr].InvList[i]; storehold[storenumh] = plr[myplr].InvList[i];
@ -973,10 +946,8 @@ void S_StartWSell()
} }
for (i = 0; i < MAXBELTITEMS; i++) { for (i = 0; i < MAXBELTITEMS; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (plr[myplr].SpdList[i]._itype != ITYPE_NONE && WitchSellOk(-(i + 1))) { if (plr[myplr].SpdList[i]._itype != ITYPE_NONE && WitchSellOk(-(i + 1))) {
sellok = TRUE; sellok = TRUE;
storehold[storenumh] = plr[myplr].SpdList[i]; storehold[storenumh] = plr[myplr].SpdList[i];
@ -1023,12 +994,10 @@ BOOL WitchRechargeOk(int i)
&& plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges) { && plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges) {
rv = TRUE; rv = TRUE;
} }
#ifdef HELLFIRE
if ((plr[myplr].InvList[i]._iMiscId == IMISC_UNIQUE || plr[myplr].InvList[i]._iMiscId == IMISC_STAFF) if ((plr[myplr].InvList[i]._iMiscId == IMISC_UNIQUE || plr[myplr].InvList[i]._iMiscId == IMISC_STAFF)
&& plr[myplr].InvList[i]._iCharges < plr[myplr].InvList[i]._iMaxCharges) { && plr[myplr].InvList[i]._iCharges < plr[myplr].InvList[i]._iMaxCharges) {
rv = TRUE; rv = TRUE;
} }
#endif
return rv; return rv;
} }
@ -1055,21 +1024,15 @@ void S_StartWRecharge()
storehold[i]._itype = ITYPE_NONE; storehold[i]._itype = ITYPE_NONE;
} }
#ifdef HELLFIRE
if ((plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_STAFF || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE) if ((plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_STAFF || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE)
#else
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_STAFF
#endif
&& plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges != plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMaxCharges) { && plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges != plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMaxCharges) {
rechargeok = TRUE; rechargeok = TRUE;
AddStoreHoldRecharge(plr[myplr].InvBody[INVLOC_HAND_LEFT], -1); AddStoreHoldRecharge(plr[myplr].InvBody[INVLOC_HAND_LEFT], -1);
} }
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (WitchRechargeOk(i)) { if (WitchRechargeOk(i)) {
rechargeok = TRUE; rechargeok = TRUE;
AddStoreHoldRecharge(plr[myplr].InvList[i], i); AddStoreHoldRecharge(plr[myplr].InvList[i], i);
@ -1231,30 +1194,35 @@ void S_StartBBoy()
OffsetSTextY(22, 6); OffsetSTextY(22, 6);
} }
void S_StartHealer() static void HealPlayer()
{ {
#ifdef HELLFIRE
if (plr[myplr]._pHitPoints != plr[myplr]._pMaxHP) { if (plr[myplr]._pHitPoints != plr[myplr]._pMaxHP) {
PlaySFX(IS_CAST8); PlaySFX(IS_CAST8);
} }
plr[myplr]._pHitPoints = plr[myplr]._pMaxHP; plr[myplr]._pHitPoints = plr[myplr]._pMaxHP;
plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase; plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase;
drawhpflag = TRUE; drawhpflag = TRUE;
#endif }
void S_StartHealer()
{
if (gbIsHellfire) {
HealPlayer();
}
stextsize = FALSE; stextsize = FALSE;
stextscrl = FALSE; stextscrl = FALSE;
AddSText(0, 1, TRUE, "Welcome to the", COL_GOLD, FALSE); AddSText(0, 1, TRUE, "Welcome to the", COL_GOLD, FALSE);
AddSText(0, 3, TRUE, "Healer's home", COL_GOLD, FALSE); AddSText(0, 3, TRUE, "Healer's home", COL_GOLD, FALSE);
AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE);
AddSText(0, 12, TRUE, "Talk to Pepin", COL_BLUE, TRUE); AddSText(0, 12, TRUE, "Talk to Pepin", COL_BLUE, TRUE);
#ifdef HELLFIRE if (gbIsHellfire) {
AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE); AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE);
AddSText(0, 16, TRUE, "Leave Healer's home", COL_WHITE, TRUE); AddSText(0, 16, TRUE, "Leave Healer's home", COL_WHITE, TRUE);
#else } else {
AddSText(0, 14, TRUE, "Receive healing", COL_WHITE, TRUE); AddSText(0, 14, TRUE, "Receive healing", COL_WHITE, TRUE);
AddSText(0, 16, TRUE, "Buy items", COL_WHITE, TRUE); AddSText(0, 16, TRUE, "Buy items", COL_WHITE, TRUE);
AddSText(0, 18, TRUE, "Leave Healer's home", COL_WHITE, TRUE); AddSText(0, 18, TRUE, "Leave Healer's home", COL_WHITE, TRUE);
#endif }
AddSLine(5); AddSLine(5);
storenumh = 20; storenumh = 20;
} }
@ -1383,10 +1351,8 @@ void S_StartSIdentify()
} }
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
#ifdef HELLFIRE
if (storenumh >= 48) if (storenumh >= 48)
break; break;
#endif
if (IdItemOk(&plr[myplr].InvList[i])) { if (IdItemOk(&plr[myplr].InvList[i])) {
idok = TRUE; idok = TRUE;
AddStoreHoldId(plr[myplr].InvList[i], i); AddStoreHoldId(plr[myplr].InvList[i], i);
@ -2572,28 +2538,21 @@ void S_HealerEnter()
gossipend = TEXT_PEPIN11; gossipend = TEXT_PEPIN11;
StartStore(STORE_GOSSIP); StartStore(STORE_GOSSIP);
break; break;
#ifdef HELLFIRE
case 14: case 14:
StartStore(STORE_HBUY); if (gbIsHellfire)
break; StartStore(STORE_HBUY);
case 16: else
stextflag = STORE_NONE; HealPlayer();
break;
#else
case 14:
if (plr[myplr]._pHitPoints != plr[myplr]._pMaxHP)
PlaySFX(IS_CAST8);
drawhpflag = TRUE;
plr[myplr]._pHitPoints = plr[myplr]._pMaxHP;
plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase;
break; break;
case 16: case 16:
StartStore(STORE_HBUY); if (gbIsHellfire)
stextflag = STORE_NONE;
else
StartStore(STORE_HBUY);
break; break;
case 18: case 18:
stextflag = STORE_NONE; stextflag = STORE_NONE;
break; break;
#endif
} }
} }

38
Source/town.cpp

@ -243,47 +243,20 @@ void T_Pass3()
mem_free_dbg(pSector); mem_free_dbg(pSector);
if (gbIsSpawn || gbMaxPlayers == 1) { if (gbIsSpawn || gbMaxPlayers == 1) {
#ifdef HELLFIRE if (gbIsSpawn || !(plr[myplr].pTownWarps & 1) && (!gbIsHellfire || plr[myplr]._pLevel < 10)) {
if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10
|| quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) {
town_4751C6();
} else {
town_475379();
}
if (quests[Q_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21])
town_475595();
else
town_47552C();
#endif
#ifdef HELLFIRE
if (gbIsSpawn || !(plr[myplr].pTownWarps & 1) && plr[myplr]._pLevel < 10)
#else
if (gbIsSpawn || !(plr[myplr].pTownWarps & 1))
#endif
{
T_FillTile(P3Tiles, 48, 20, 320); T_FillTile(P3Tiles, 48, 20, 320);
} }
#ifdef HELLFIRE if (gbIsSpawn || !(plr[myplr].pTownWarps & 2) && (!gbIsHellfire || plr[myplr]._pLevel < 15)) {
if (gbIsSpawn || !(plr[myplr].pTownWarps & 2) && plr[myplr]._pLevel < 15)
#else
if (gbIsSpawn || !(plr[myplr].pTownWarps & 2))
#endif
{
T_FillTile(P3Tiles, 16, 68, 332); T_FillTile(P3Tiles, 16, 68, 332);
T_FillTile(P3Tiles, 16, 70, 331); T_FillTile(P3Tiles, 16, 70, 331);
} }
#ifdef HELLFIRE if (gbIsSpawn || !(plr[myplr].pTownWarps & 4) && (!gbIsHellfire || plr[myplr]._pLevel < 20)) {
if (gbIsSpawn || !(plr[myplr].pTownWarps & 4) && plr[myplr]._pLevel < 20) {
#else
if (gbIsSpawn || !(plr[myplr].pTownWarps & 4)) {
#endif
for (x = 36; x < 46; x++) { for (x = 36; x < 46; x++) {
T_FillTile(P3Tiles, x, 78, random_(0, 4) + 1); T_FillTile(P3Tiles, x, 78, random_(0, 4) + 1);
} }
} }
} }
#ifdef HELLFIRE if (gbIsHellfire) {
else {
if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10 if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10
|| quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) { || quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) {
town_4751C6(); town_4751C6();
@ -295,7 +268,6 @@ void T_Pass3()
else else
town_47552C(); town_47552C();
} }
#endif
if (quests[Q_PWATER]._qactive != QUEST_DONE && quests[Q_PWATER]._qactive) { if (quests[Q_PWATER]._qactive != QUEST_DONE && quests[Q_PWATER]._qactive) {
T_FillTile(P3Tiles, 60, 70, 342); T_FillTile(P3Tiles, 60, 70, 342);
@ -340,7 +312,6 @@ void CreateTown(int entry)
ViewX = 41; ViewX = 41;
ViewY = 81; ViewY = 81;
} }
#ifdef HELLFIRE
if (TWarpFrom == 21) { if (TWarpFrom == 21) {
ViewX = 36; ViewX = 36;
ViewY = 25; ViewY = 25;
@ -349,7 +320,6 @@ void CreateTown(int entry)
ViewX = 79; ViewX = 79;
ViewY = 62; ViewY = 62;
} }
#endif
} }
T_Pass3(); T_Pass3();

1004
Source/towners.cpp

File diff suppressed because it is too large Load Diff

2
Source/trigs.cpp

@ -140,7 +140,6 @@ void InitTownTriggers()
numtrigs++; numtrigs++;
} }
} }
#ifdef HELLFIRE
if (quests[Q_GRAVE]._qactive == 3) { if (quests[Q_GRAVE]._qactive == 3) {
trigs[numtrigs]._tx = 36; trigs[numtrigs]._tx = 36;
trigs[numtrigs]._ty = 24; trigs[numtrigs]._ty = 24;
@ -148,6 +147,7 @@ void InitTownTriggers()
trigs[numtrigs]._tlvl = 21; trigs[numtrigs]._tlvl = 21;
numtrigs++; numtrigs++;
} }
#ifdef HELLFIRE
trigs[numtrigs]._tx = 80; trigs[numtrigs]._tx = 80;
trigs[numtrigs]._ty = 62; trigs[numtrigs]._ty = 62;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;

4
defs.h

@ -44,11 +44,7 @@
#define MAXOBJECTS 127 #define MAXOBJECTS 127
#define MAXPORTAL 4 #define MAXPORTAL 4
#ifdef HELLFIRE
#define MAXQUESTS 24 #define MAXQUESTS 24
#else
#define MAXQUESTS 16
#endif
#define MAXMULTIQUESTS 10 #define MAXMULTIQUESTS 10
#define MAXTHEMES 50 #define MAXTHEMES 50

2
structs.h

@ -1146,7 +1146,6 @@ typedef struct QuestTalkData {
int _qpw; int _qpw;
int _qbone; int _qbone;
int _qvb; int _qvb;
#ifdef HELLFIRE
int _qgrv; int _qgrv;
int _qfarm; int _qfarm;
int _qgirl; int _qgirl;
@ -1155,7 +1154,6 @@ typedef struct QuestTalkData {
int _qnakrul; int _qnakrul;
int _qjersy; int _qjersy;
int _qhf8; int _qhf8;
#endif
} QuestTalkData; } QuestTalkData;
////////////////////////////////////////////////// //////////////////////////////////////////////////

Loading…
Cancel
Save