diff --git a/Source/inv.cpp b/Source/inv.cpp index c91800606..2716d3386 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -2524,9 +2524,7 @@ void UseStaffCharge(int pnum) { if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE && (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF -#ifdef HELLFIRE || 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]._iCharges > 0) { @@ -2539,11 +2537,7 @@ BOOL UseStaff() { if (pcurs == CURSOR_HAND) { 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) -#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]._iCharges > 0) { return TRUE; diff --git a/Source/items.cpp b/Source/items.cpp index 687ecd21c..418eedd17 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -136,7 +136,6 @@ const char *const ItemDropNames[] = { "Bldstn", "Fanvil", "FLazStaf", -#ifdef HELLFIRE "bombs1", "halfps1", "wholeps1", @@ -145,7 +144,6 @@ const char *const ItemDropNames[] = { "cows1", "donkys1", "mooses1", -#endif }; /** Maps of item drop animation length. */ BYTE ItemAnimLs[] = { @@ -184,7 +182,6 @@ BYTE ItemAnimLs[] = { 13, 13, 8, -#ifdef HELLFIRE 10, 16, 16, @@ -193,7 +190,6 @@ BYTE ItemAnimLs[] = { 15, 15, 15, -#endif }; /** Maps of drop sounds effect of dropping the item on ground. */ int ItemDropSnds[] = { @@ -232,7 +228,6 @@ int ItemDropSnds[] = { IS_FBLST, IS_FANVL, IS_FSTAF, -#ifdef HELLFIRE IS_FROCK, IS_FSCRL, IS_FSCRL, @@ -241,7 +236,6 @@ int ItemDropSnds[] = { IS_FHARM, IS_FLARM, IS_FLARM, -#endif }; /** Maps of drop sounds effect of placing the item in the inventory. */ int ItemInvSnds[] = { @@ -280,7 +274,6 @@ int ItemInvSnds[] = { IS_IBLST, IS_IANVL, IS_ISTAF, -#ifdef HELLFIRE IS_IROCK, IS_ISCROL, IS_ISCROL, @@ -289,7 +282,6 @@ int ItemInvSnds[] = { IS_IHARM, IS_ILARM, IS_ILARM, -#endif }; char *off_4A5AC4 = "SItem"; /** Specifies the current Y-coordinate used for validation of items on ground. */ @@ -510,14 +502,9 @@ int items_get_currlevel() void InitItemGFX() { -#ifdef HELLFIRE - DWORD i; -#else - int i; -#endif char arglist[64]; - for (i = 0; i < ITEMTYPES; i++) { + for (int i = 0; i < ITEMTYPES; i++) { sprintf(arglist, "Items\\%s.CEL", ItemDropNames[i]); itemanims[i] = LoadFileInMem(arglist, NULL); } @@ -546,9 +533,7 @@ void AddInitItems() { int x, y, i, j, rnd; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif rnd = random_(11, 3) + 3; for (j = 0; j < rnd; j++) { i = itemavail[0]; @@ -565,19 +550,11 @@ void AddInitItems() dItem[x][y] = i + 1; item[i]._iSeed = GetRndSeed(); SetRndSeed(item[i]._iSeed); -#ifdef HELLFIRE if (random_(12, 2) != 0) GetItemAttrs(i, IDI_HEAL, curlv); else GetItemAttrs(i, IDI_MANA, curlv); 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); item[i]._iAnimFrame = item[i]._iAnimLen; item[i]._iAnimFlag = FALSE; @@ -642,18 +619,14 @@ void InitItems() SpawnRock(); if (QuestStatus(Q_ANVIL)) SpawnQuestItem(IDI_ANVIL, 2 * setpc_x + 27, 2 * setpc_y + 27, 0, 1); -#ifdef HELLFIRE if (UseCowFarmer && currlevel == 20) SpawnQuestItem(IDI_BROWNSUIT, 25, 25, 3, 1); if (UseCowFarmer && currlevel == 19) SpawnQuestItem(IDI_GREYSUIT, 25, 25, 3, 1); -#endif if (currlevel > 0 && currlevel < 16) AddInitItems(); -#ifdef HELLFIRE if (currlevel >= 21 && currlevel <= 23) items_42390F(); -#endif } uitemflag = FALSE; @@ -677,9 +650,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) int iflgs = ISPL_NONE; // item_special_effect flags -#ifdef HELLFIRE int pDamAcFlags = 0; -#endif int sadd = 0; // added strength int madd = 0; // added magic @@ -732,9 +703,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) bac += tmpac; } iflgs |= itm->_iFlags; -#ifdef HELLFIRE pDamAcFlags |= itm->_iDamAcFlags; -#endif sadd += itm->_iPLStr; madd += itm->_iPLMag; dadd += itm->_iPLDex; @@ -795,9 +764,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) plr[p]._pIBonusToHit = btohit; plr[p]._pIBonusAC = bac; plr[p]._pIFlags = iflgs; -#ifdef HELLFIRE plr[p].pDamAcFlags = pDamAcFlags; -#endif plr[p]._pIBonusDamMod = dmod; plr[p]._pIGetHit = ghit; @@ -915,10 +882,8 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) if (mr > MAXRESIST) mr = MAXRESIST; -#ifdef HELLFIRE else if (mr < 0) mr = 0; -#endif plr[p]._pMagResist = mr; if (fr > MAXRESIST) @@ -1081,9 +1046,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) if (missile[mi]._mitype == MIS_MANASHIELD && missile[mi]._misource == p) { missile[mi]._miVar1 = plr[p]._pHitPoints; missile[mi]._miVar2 = plr[p]._pHPBase; -#ifdef HELLFIRE break; -#endif } } #ifdef HELLFIRE @@ -1652,9 +1615,7 @@ void GetBookSpell(int i, int lvl) lvl = 5; s = SPL_FIREBOLT; -#ifdef HELLFIRE bs = SPL_FIREBOLT; -#endif while (rv > 0) { int sLevel = GetSpellBookLevel(s); if (sLevel != -1 && lvl >= sLevel) { @@ -1681,15 +1642,9 @@ void GetBookSpell(int i, int lvl) item[i]._iIvalue += spelldata[bs].sBookCost; if (spelldata[bs].sType == STYPE_FIRE) item[i]._iCurs = ICURS_BOOK_RED; -#ifdef HELLFIRE - else -#endif - if (spelldata[bs].sType == STYPE_LIGHTNING) + else if (spelldata[bs].sType == STYPE_LIGHTNING) item[i]._iCurs = ICURS_BOOK_BLUE; -#ifdef HELLFIRE - else -#endif - if (spelldata[bs].sType == STYPE_MAGIC) + else if (spelldata[bs].sType == STYPE_MAGIC) 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: item[i]._iPLDam -= r; break; -#ifdef HELLFIRE case IPL_DOPPELGANGER: item[i]._iDamAcFlags |= 16; // no break -#endif case IPL_TOHIT_DAMP: r = RndPL(param1, param2); 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]._iDurability += r2; break; -#ifdef HELLFIRE case IPL_CRYSTALLINE: item[i]._iPLDam += 140 + r * 2; // no break -#endif case IPL_DUR_CURSE: item[i]._iMaxDur -= r * item[i]._iMaxDur / 100; 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: item[i]._iPLLight -= param1; break; -#ifdef HELLFIRE case IPL_MULT_ARROWS: item[i]._iFlags |= ISPL_MULT_ARROWS; break; -#endif case IPL_FIRE_ARROWS: item[i]._iFlags |= ISPL_FIRE_ARROWS; #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) item[i]._iPLFR = 0; break; -#ifdef HELLFIRE case IPL_FIRERES_CURSE: item[i]._iPLFR -= r; 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]._iPLMana += (r2 << 6); break; -#endif } if (item[i]._iVAdd1 || item[i]._iVMult1) { 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)) { -#ifdef HELLFIRE int aii = item[i].IDidx; if (AllItemsList[aii].iSName) strcpy(item[i]._iIName, AllItemsList[aii].iSName); else item[i]._iName[0] = 0; -#else - strcpy(item[i]._iIName, AllItemsList[item[i].IDidx].iSName); -#endif if (preidx != -1) { 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) return -1 - (monster[m].MData->mTreasure & 0xFFF); -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif ri = 0; for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { okflag = TRUE; @@ -2619,11 +2560,7 @@ int RndUItem(int m) if (monster[m].mLevel < AllItemsList[i].iMinMLvl) okflag = FALSE; } else { -#ifdef HELLFIRE if (2 * curlv < AllItemsList[i].iMinMLvl) -#else - if (2 * currlevel < AllItemsList[i].iMinMLvl) -#endif okflag = FALSE; } if (AllItemsList[i].itype == ITYPE_MISC) @@ -2659,16 +2596,10 @@ int RndAllItems() if (random_(26, 100) > 25) return 0; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif ri = 0; for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { -#ifdef HELLFIRE 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; ri++; } @@ -2681,11 +2612,7 @@ int RndAllItems() return ril[random_(26, ri)]; } -#ifdef HELLFIRE int RndTypeItems(int itype, int imid, int lvl) -#else -int RndTypeItems(int itype, int imid) -#endif { int i, ri; BOOL okflag; @@ -2696,21 +2623,13 @@ int RndTypeItems(int itype, int imid) okflag = TRUE; if (AllItemsList[i].iRnd == IDROP_NEVER) okflag = FALSE; -#ifdef HELLFIRE if (lvl << 1 < AllItemsList[i].iMinMLvl) -#else - if (currlevel << 1 < AllItemsList[i].iMinMLvl) -#endif okflag = FALSE; if (AllItemsList[i].itype != itype) okflag = FALSE; if (imid != -1 && AllItemsList[i].iMiscId != imid) okflag = FALSE; -#ifdef HELLFIRE if (okflag && ri < 512) { -#else - if (okflag) { -#endif ril[ri] = i; ri++; } @@ -2787,9 +2706,7 @@ void SpawnUnique(int uid, int x, int y) { int ii, itype; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (numitems >= MAXITEMS) return; @@ -2803,11 +2720,7 @@ void SpawnUnique(int uid, int x, int y) itype++; } -#ifdef HELLFIRE GetItemAttrs(ii, itype, curlv); -#else - GetItemAttrs(ii, itype, currlevel); -#endif GetUniqueItem(ii, uid); SetupItem(ii); numitems++; @@ -2931,9 +2844,7 @@ void CreateItem(int uid, int x, int y) { int ii, idx; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); @@ -2945,11 +2856,7 @@ void CreateItem(int uid, int x, int y) idx++; } -#ifdef HELLFIRE GetItemAttrs(ii, idx, curlv); -#else - GetItemAttrs(ii, idx, currlevel); -#endif GetUniqueItem(ii, uid); SetupItem(ii); 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; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (onlygood) idx = RndUItem(-1); else @@ -2974,11 +2879,7 @@ void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, BOOL delta) GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; -#ifdef HELLFIRE SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta); -#else - SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, FALSE, delta); -#endif if (sendmsg) NetSendCmdDItem(FALSE, ii); if (delta) @@ -3041,19 +2942,13 @@ void CreateRndUseful(int pnum, int x, int y, BOOL sendmsg) { int ii; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; -#ifdef HELLFIRE SetupAllUseful(ii, GetRndSeed(), curlv); -#else - SetupAllUseful(ii, GetRndSeed(), currlevel); -#endif if (sendmsg) { NetSendCmdDItem(FALSE, ii); } @@ -3065,14 +2960,9 @@ void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL send { int idx, ii; -#ifdef HELLFIRE int curlv = items_get_currlevel(); if (itype != ITYPE_GOLD) idx = RndTypeItems(itype, imisc, curlv); -#else - if (itype != ITYPE_GOLD) - idx = RndTypeItems(itype, imisc); -#endif else idx = 0; @@ -3081,11 +2971,7 @@ void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL send GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; -#ifdef HELLFIRE SetupAllItems(ii, idx, GetRndSeed(), 2 * curlv, 1, onlygood, FALSE, delta); -#else - SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, FALSE, delta); -#endif if (sendmsg) NetSendCmdDItem(FALSE, ii); @@ -3226,9 +3112,7 @@ void SpawnQuestItem(int itemid, int x, int y, int randarea, int selflag) BOOL failed; int i, j, tries; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (randarea) { tries = 0; while (1) { @@ -3255,11 +3139,7 @@ void SpawnQuestItem(int itemid, int x, int y, int randarea, int selflag) item[i]._ix = x; item[i]._iy = y; dItem[x][y] = i + 1; -#ifdef HELLFIRE GetItemAttrs(i, itemid, curlv); -#else - GetItemAttrs(i, itemid, currlevel); -#endif SetupItem(i); item[i]._iPostDraw = TRUE; if (selflag) { @@ -3282,9 +3162,7 @@ void SpawnRock() ii = objectactive[i]; ostand = object[ii]._otype == OBJ_STAND; } -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (ostand) { i = itemavail[0]; itemavail[0] = itemavail[127 - numitems - 1]; @@ -3294,11 +3172,7 @@ void SpawnRock() item[i]._ix = xx; item[i]._iy = yy; dItem[xx][item[i]._iy] = i + 1; -#ifdef HELLFIRE GetItemAttrs(i, IDI_ROCK, curlv); -#else - GetItemAttrs(i, IDI_ROCK, currlevel); -#endif SetupItem(i); item[i]._iSelFlag = 2; item[i]._iPostDraw = TRUE; @@ -5698,26 +5572,21 @@ void CreateSpellBook(int x, int y, int ispell, BOOL sendmsg, BOOL delta) BOOL done; done = FALSE; -#ifdef HELLFIRE - int lvl = GetSpellBookLevel(ispell) + 1; - if (lvl < 1) { - return; + int lvl = currlevel; + if (gbIsHellfire) { + lvl = GetSpellBookLevel(ispell) + 1; + if (lvl < 1) { + return; + } } idx = RndTypeItems(ITYPE_MISC, IMISC_BOOK, lvl); -#else - idx = RndTypeItems(ITYPE_MISC, IMISC_BOOK); -#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; while (!done) { -#ifdef HELLFIRE 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) done = TRUE; } @@ -5735,33 +5604,19 @@ void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL del BOOL done; done = FALSE; -#ifdef HELLFIRE int curlv = items_get_currlevel(); -#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; -#ifdef HELLFIRE idx = RndTypeItems(imisc, IMISC_NONE, curlv); -#else - idx = RndTypeItems(imisc, IMISC_NONE); -#endif while (!done) { -#ifdef HELLFIRE 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) done = TRUE; else -#ifdef HELLFIRE idx = RndTypeItems(imisc, IMISC_NONE, curlv); -#else - idx = RndTypeItems(imisc, IMISC_NONE); -#endif } if (sendmsg) 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) { int ii, idx; @@ -5799,46 +5653,30 @@ void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta) numitems++; } } -#endif void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta) { int ii, idx; BOOL done; - done = FALSE; -#ifdef HELLFIRE int imid; if (imisc == ITYPE_STAFF) imid = IMISC_STAFF; else imid = IMISC_NONE; int curlv = items_get_currlevel(); -#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; -#ifdef HELLFIRE idx = RndTypeItems(imisc, imid, curlv); -#else - idx = RndTypeItems(imisc, IMISC_NONE); -#endif while (!done) { -#ifdef HELLFIRE 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) done = TRUE; else -#ifdef HELLFIRE idx = RndTypeItems(imisc, imid, curlv); -#else - idx = RndTypeItems(imisc, IMISC_NONE); -#endif } if (sendmsg) NetSendCmdDItem(FALSE, ii); diff --git a/Source/items.h b/Source/items.h index f21c84585..2c5fd0d48 100644 --- a/Source/items.h +++ b/Source/items.h @@ -98,9 +98,7 @@ void RecalcStoreStats(); int ItemNoFlippy(); 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); -#ifdef HELLFIRE 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); BOOL GetItemRecord(int nSeed, WORD wCI, int nIndex); void SetItemRecord(int nSeed, WORD wCI, int nIndex); diff --git a/Source/player.cpp b/Source/player.cpp index 536fcacfe..a88eca7be 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -135,11 +135,9 @@ const char *const ClassStrTblOld[] = { "Warrior", "Rogue", "Sorceror", -#ifdef HELLFIRE "Monk", "Bard", "Barbarian", -#endif }; /** Maps from player_class to maximum stats. */ int MaxStats[NUM_CLASSES][4] = { @@ -599,7 +597,6 @@ void SetPlrAnims(int pnum) plr[pnum]._pAFrames = 24; plr[pnum]._pAFNum = 16; } -#ifdef HELLFIRE } else if (pc == PC_MONK) { plr[pnum]._pNWidth = 112; plr[pnum]._pWWidth = 112; @@ -657,7 +654,6 @@ void SetPlrAnims(int pnum) } else if (gn == ANIM_ID_MACE || gn == ANIM_ID_MACE_SHIELD) { plr[pnum]._pAFNum = 8; } -#endif } } @@ -889,10 +885,8 @@ void NextPlrLevel(int pnum) if (plr[pnum]._pClass == PC_WARRIOR) mana = 64; -#ifdef HELLFIRE else if (plr[pnum]._pClass == PC_BARBARIAN) mana = 0; -#endif else mana = 128; diff --git a/Source/player.h b/Source/player.h index d260fed2d..2e0f4f68f 100644 --- a/Source/player.h +++ b/Source/player.h @@ -45,9 +45,7 @@ void RemovePlrFromMap(int pnum); void StartPlrHit(int pnum, int dam, BOOL forcehit); void StartPlayerKill(int pnum, int earflag); void DropHalfPlayersGold(int pnum); -#ifdef HELLFIRE void StripTopGold(int pnum); -#endif void SyncPlrKill(int pnum, int earflag); void RemovePlrMissiles(int pnum); 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 InitDungMsgs(int pnum); void PlayDungMsgs(); -#ifdef HELLFIRE int get_max_strength(int i); int get_max_magic(int i); int get_max_dexterity(int i); -#endif /* data */ diff --git a/Source/quests.cpp b/Source/quests.cpp index 8a6d7ebfb..24ac4d156 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -115,6 +115,8 @@ void InitQuests() initiatedQuests = 0; for (z = 0; z < MAXQUESTS; z++) { + if (!gbIsHellfire && z >= 16) + break; if (gbMaxPlayers > 1 && !(questlist[z]._qflags & QUEST_ANY)) continue; quests[z]._qtype = questlist[z]._qdtype; @@ -696,7 +698,6 @@ void ResyncMPQuests() } if (QuestStatus(Q_BETRAYER)) 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) { quests[Q_GRAVE]._qactive = 2; NetSendCmdQuest(TRUE, Q_GRAVE); @@ -713,7 +714,6 @@ void ResyncMPQuests() quests[Q_JERSEY]._qactive = 2; NetSendCmdQuest(TRUE, Q_JERSEY); } -#endif } void ResyncQuests() diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index bc6fbccfb..b7f679768 100644 --- a/Source/scrollrt.cpp +++ b/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]); } else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) { Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, 1); -#ifndef HELLFIRE if (plr[pnum].pManaShield) Cl2DrawLightTbl( 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, misfiledata[MFILE_MANASHLD].mAnimWidth[0], 1); -#endif } else { l = light_table_index; if (light_table_index < 5) diff --git a/Source/stores.cpp b/Source/stores.cpp index bb5f05998..5ff573a5e 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -575,7 +575,6 @@ BOOL S_StartSPBuy() BOOL SmithSellOk(int i) { -#ifdef HELLFIRE ItemStruct *pI; if (i >= 0) { @@ -596,26 +595,12 @@ BOOL SmithSellOk(int i) return FALSE; if (pI->_itype == ITYPE_MEAT) return FALSE; - if (pI->_itype == ITYPE_STAFF && pI->_iSpell != SPL_NULL) + if (pI->_itype == ITYPE_STAFF && (!gbIsHellfire || pI->_iSpell != SPL_NULL)) return FALSE; if (pI->_iClass == ICLASS_QUEST) return FALSE; if (pI->IDidx == IDI_LAZSTAFF) 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; } @@ -673,10 +658,8 @@ void S_StartSSell() storehold[i]._itype = ITYPE_NONE; for (i = 0; i < plr[myplr]._pNumInv; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (SmithSellOk(i)) { sellok = TRUE; storehold[storenumh] = plr[myplr].InvList[i]; @@ -691,7 +674,6 @@ void S_StartSSell() storehidx[storenumh++] = i; } } -#ifdef HELLFIRE for (i = 0; i < MAXBELTITEMS; i++) { if (storenumh >= 48) @@ -710,7 +692,6 @@ void S_StartSSell() storehidx[storenumh++] = -(i + 1); } } -#endif if (!sellok) { stextscrl = FALSE; @@ -800,10 +781,8 @@ void S_StartSRepair() AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_HAND_RIGHT], -4); } for (i = 0; i < plr[myplr]._pNumInv; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (SmithRepairOk(i)) { repairok = TRUE; AddStoreHoldRepair(&plr[myplr].InvList[i], i); @@ -923,15 +902,11 @@ BOOL WitchSellOk(int i) if (pI->_itype == ITYPE_MISC) rv = TRUE; -#ifdef HELLFIRE if (pI->_iMiscId > 29 && pI->_iMiscId < 41) rv = FALSE; if (pI->_iClass == ICLASS_QUEST) rv = FALSE; - if (pI->_itype == ITYPE_STAFF && pI->_iSpell != SPL_NULL) -#else - if (pI->_itype == ITYPE_STAFF) -#endif + if (pI->_itype == ITYPE_STAFF && (!gbIsHellfire || pI->_iSpell != SPL_NULL)) rv = TRUE; if (pI->IDidx >= IDI_FIRSTQUEST && pI->IDidx <= IDI_LASTQUEST) rv = FALSE; @@ -953,10 +928,8 @@ void S_StartWSell() storehold[i]._itype = ITYPE_NONE; for (i = 0; i < plr[myplr]._pNumInv; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (WitchSellOk(i)) { sellok = TRUE; storehold[storenumh] = plr[myplr].InvList[i]; @@ -973,10 +946,8 @@ void S_StartWSell() } for (i = 0; i < MAXBELTITEMS; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (plr[myplr].SpdList[i]._itype != ITYPE_NONE && WitchSellOk(-(i + 1))) { sellok = TRUE; storehold[storenumh] = plr[myplr].SpdList[i]; @@ -1023,12 +994,10 @@ BOOL WitchRechargeOk(int i) && plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges) { rv = TRUE; } -#ifdef HELLFIRE 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) { rv = TRUE; } -#endif return rv; } @@ -1055,21 +1024,15 @@ void S_StartWRecharge() 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) -#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) { rechargeok = TRUE; AddStoreHoldRecharge(plr[myplr].InvBody[INVLOC_HAND_LEFT], -1); } for (i = 0; i < plr[myplr]._pNumInv; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (WitchRechargeOk(i)) { rechargeok = TRUE; AddStoreHoldRecharge(plr[myplr].InvList[i], i); @@ -1231,30 +1194,35 @@ void S_StartBBoy() OffsetSTextY(22, 6); } -void S_StartHealer() +static void HealPlayer() { -#ifdef HELLFIRE if (plr[myplr]._pHitPoints != plr[myplr]._pMaxHP) { PlaySFX(IS_CAST8); } plr[myplr]._pHitPoints = plr[myplr]._pMaxHP; plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase; drawhpflag = TRUE; -#endif +} + +void S_StartHealer() +{ + if (gbIsHellfire) { + HealPlayer(); + } stextsize = FALSE; stextscrl = FALSE; AddSText(0, 1, TRUE, "Welcome to the", 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, 12, TRUE, "Talk to Pepin", COL_BLUE, TRUE); -#ifdef HELLFIRE - AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE); - AddSText(0, 16, TRUE, "Leave Healer's home", COL_WHITE, TRUE); -#else - AddSText(0, 14, TRUE, "Receive healing", COL_WHITE, TRUE); - AddSText(0, 16, TRUE, "Buy items", COL_WHITE, TRUE); - AddSText(0, 18, TRUE, "Leave Healer's home", COL_WHITE, TRUE); -#endif + if (gbIsHellfire) { + AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Leave Healer's home", COL_WHITE, TRUE); + } else { + AddSText(0, 14, TRUE, "Receive healing", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Buy items", COL_WHITE, TRUE); + AddSText(0, 18, TRUE, "Leave Healer's home", COL_WHITE, TRUE); + } AddSLine(5); storenumh = 20; } @@ -1383,10 +1351,8 @@ void S_StartSIdentify() } for (i = 0; i < plr[myplr]._pNumInv; i++) { -#ifdef HELLFIRE if (storenumh >= 48) break; -#endif if (IdItemOk(&plr[myplr].InvList[i])) { idok = TRUE; AddStoreHoldId(plr[myplr].InvList[i], i); @@ -2572,28 +2538,21 @@ void S_HealerEnter() gossipend = TEXT_PEPIN11; StartStore(STORE_GOSSIP); break; -#ifdef HELLFIRE case 14: - StartStore(STORE_HBUY); - break; - case 16: - stextflag = STORE_NONE; - 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; + if (gbIsHellfire) + StartStore(STORE_HBUY); + else + HealPlayer(); break; case 16: - StartStore(STORE_HBUY); + if (gbIsHellfire) + stextflag = STORE_NONE; + else + StartStore(STORE_HBUY); break; case 18: stextflag = STORE_NONE; break; -#endif } } diff --git a/Source/town.cpp b/Source/town.cpp index 70c6c3308..abc5b40c5 100644 --- a/Source/town.cpp +++ b/Source/town.cpp @@ -243,47 +243,20 @@ void T_Pass3() mem_free_dbg(pSector); if (gbIsSpawn || gbMaxPlayers == 1) { -#ifdef HELLFIRE - 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 - { + if (gbIsSpawn || !(plr[myplr].pTownWarps & 1) && (!gbIsHellfire || plr[myplr]._pLevel < 10)) { T_FillTile(P3Tiles, 48, 20, 320); } -#ifdef HELLFIRE - if (gbIsSpawn || !(plr[myplr].pTownWarps & 2) && plr[myplr]._pLevel < 15) -#else - if (gbIsSpawn || !(plr[myplr].pTownWarps & 2)) -#endif - { + if (gbIsSpawn || !(plr[myplr].pTownWarps & 2) && (!gbIsHellfire || plr[myplr]._pLevel < 15)) { T_FillTile(P3Tiles, 16, 68, 332); T_FillTile(P3Tiles, 16, 70, 331); } -#ifdef HELLFIRE - if (gbIsSpawn || !(plr[myplr].pTownWarps & 4) && plr[myplr]._pLevel < 20) { -#else - if (gbIsSpawn || !(plr[myplr].pTownWarps & 4)) { -#endif + if (gbIsSpawn || !(plr[myplr].pTownWarps & 4) && (!gbIsHellfire || plr[myplr]._pLevel < 20)) { for (x = 36; x < 46; x++) { T_FillTile(P3Tiles, x, 78, random_(0, 4) + 1); } } } -#ifdef HELLFIRE - else { + if (gbIsHellfire) { if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10 || quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) { town_4751C6(); @@ -295,7 +268,6 @@ void T_Pass3() else town_47552C(); } -#endif if (quests[Q_PWATER]._qactive != QUEST_DONE && quests[Q_PWATER]._qactive) { T_FillTile(P3Tiles, 60, 70, 342); @@ -340,7 +312,6 @@ void CreateTown(int entry) ViewX = 41; ViewY = 81; } -#ifdef HELLFIRE if (TWarpFrom == 21) { ViewX = 36; ViewY = 25; @@ -349,7 +320,6 @@ void CreateTown(int entry) ViewX = 79; ViewY = 62; } -#endif } T_Pass3(); diff --git a/Source/towners.cpp b/Source/towners.cpp index c1ca9160d..6a800887b 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -116,8 +116,7 @@ int cowoffx[8] = { -1, 0, -1, -1, -1, 0, -1, -1 }; int cowoffy[8] = { -1, -1, -1, 0, -1, -1, -1, 0 }; /** Contains the data related to quest gossip for each towner ID. */ QuestTalkData Qtalklist[] = { -// clang-format off -#ifdef HELLFIRE + // clang-format off // _qinfra, _qblkm, _qgarb, _qzhar, _qveil, _qmod, _qbutch, _qbol, _qblind, _qblood, _qanvil, _qwarlrd, _qking, _qpw, _qbone, _qvb, _qgrv, _qfarm, _qgirl, _qtrade, _qdefiler, _qnakrul, _qjersy, _qhf8 { TEXT_INFRA6, TEXT_MUSH6, -1, -1, TEXT_VEIL5, -1, TEXT_BUTCH5, TEXT_BANNER6, TEXT_BLIND5, TEXT_BLOOD5, TEXT_ANVIL6, TEXT_WARLRD5, TEXT_KING7, TEXT_POISON7, TEXT_BONE5, TEXT_VILE9, TEXT_GRAVE2, -1, -1, -1, -1, -1, -1, -1 }, { TEXT_INFRA3, -1, -1, -1, TEXT_VEIL3, -1, TEXT_BUTCH3, TEXT_BANNER4, TEXT_BLIND3, TEXT_BLOOD3, TEXT_ANVIL3, TEXT_WARLRD3, TEXT_KING5, TEXT_POISON4, TEXT_BONE3, TEXT_VILE7, TEXT_GRAVE3, -1, -1, -1, -1, -1, -1, -1 }, @@ -133,20 +132,6 @@ QuestTalkData Qtalklist[] = { { -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, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -#else - // _qinfra, _qblkm, _qgarb, _qzhar, _qveil, _qmod, _qbutch, _qbol, _qblind, _qblood, _qanvil, _qwarlrd, _qking, _qpw, _qbone, _qvb - { TEXT_INFRA6, TEXT_MUSH6, -1, -1, TEXT_VEIL5, -1, TEXT_BUTCH5, TEXT_BANNER6, TEXT_BLIND5, TEXT_BLOOD5, TEXT_ANVIL6, TEXT_WARLRD5, TEXT_KING7, TEXT_POISON7, TEXT_BONE5, TEXT_VILE9 }, - { TEXT_INFRA3, -1, -1, -1, TEXT_VEIL3, -1, TEXT_BUTCH3, TEXT_BANNER4, TEXT_BLIND3, TEXT_BLOOD3, TEXT_ANVIL3, TEXT_WARLRD3, TEXT_KING5, TEXT_POISON4, TEXT_BONE3, TEXT_VILE7 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA2, TEXT_MUSH2, -1, -1, TEXT_VEIL2, -1, TEXT_BUTCH2, -1, TEXT_BLIND2, TEXT_BLOOD2, TEXT_ANVIL2, TEXT_WARLRD2, TEXT_KING3, TEXT_POISON2, TEXT_BONE2, TEXT_VILE4 }, - { TEXT_INFRA1, TEXT_MUSH1, -1, -1, TEXT_VEIL1, TEXT_VILE3, TEXT_BUTCH1, TEXT_BANNER1, TEXT_BLIND1, TEXT_BLOOD1, TEXT_ANVIL1, TEXT_WARLRD1, TEXT_KING1, TEXT_POISON1, TEXT_BONE1, TEXT_VILE2 }, - { TEXT_INFRA8, TEXT_MUSH7, -1, -1, TEXT_VEIL6, -1, TEXT_BUTCH6, TEXT_BANNER7, TEXT_BLIND6, TEXT_BLOOD6, TEXT_ANVIL8, TEXT_WARLRD6, TEXT_KING8, TEXT_POISON8, TEXT_BONE6, TEXT_VILE10 }, - { TEXT_INFRA9, TEXT_MUSH9, -1, -1, TEXT_VEIL7, -1, TEXT_BUTCH7, TEXT_BANNER8, TEXT_BLIND7, TEXT_BLOOD7, TEXT_ANVIL9, TEXT_WARLRD7, TEXT_KING9, TEXT_POISON9, TEXT_BONE7, TEXT_VILE11 }, - { TEXT_INFRA4, TEXT_MUSH5, -1, -1, TEXT_VEIL4, -1, TEXT_BUTCH4, TEXT_BANNER5, TEXT_BLIND4, TEXT_BLOOD4, TEXT_ANVIL4, TEXT_WARLRD4, TEXT_KING6, TEXT_POISON6, TEXT_BONE4, TEXT_VILE8 }, - { TEXT_INFRA10, TEXT_MUSH13, -1, -1, TEXT_VEIL8, -1, TEXT_BUTCH8, TEXT_BANNER9, TEXT_BLIND8, TEXT_BLOOD8, TEXT_ANVIL10,TEXT_WARLRD8, TEXT_KING10, TEXT_POISON10, TEXT_BONE8, TEXT_VILE12 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1, TEXT_KING1 } -#endif // clang-format on }; /** Specifies the active sound effect ID for interacting with cows. */ @@ -431,7 +416,6 @@ void InitCows() } } -#ifdef HELLFIRE void InitFarmer() { int i; @@ -487,7 +471,6 @@ void InitGirl() strcpy(towner[numtowners]._tName, "Celia"); numtowners++; } -#endif void InitTowners() { @@ -504,16 +487,16 @@ void InitTowners() InitBarmaid(); InitBoy(); InitCows(); -#ifdef HELLFIRE - if (UseCowFarmer) { - InitCowFarmer(); - } else if (quests[Q_FARMER]._qactive != 10) { - InitFarmer(); - } - if (UseTheoQuest && plr->_pLvlVisited[17]) { - InitGirl(); + if (gbIsHellfire) { + if (UseCowFarmer) { + InitCowFarmer(); + } else if (quests[Q_FARMER]._qactive != 10) { + InitFarmer(); + } + if (UseTheoQuest && plr->_pLvlVisited[17]) { + InitGirl(); + } } -#endif } void FreeTownerGFX() @@ -640,7 +623,6 @@ void TownCow() TownCtrlMsg(i); } -#ifdef HELLFIRE void TownFarmer() { int i; @@ -664,7 +646,6 @@ void TownGirl() i = GetActiveTowner(TOWN_GIRL); TownCtrlMsg(i); } -#endif void ProcessTowners() { @@ -702,7 +683,6 @@ void ProcessTowners() case TOWN_COW: TownCow(); break; -#ifdef HELLFIRE case TOWN_FARMER: TownFarmer(); break; @@ -712,7 +692,6 @@ void ProcessTowners() case TOWN_COWFARM: TownCowFarmer(); break; -#endif } towner[i]._tAnimCnt++; @@ -757,21 +736,15 @@ void TalkToTowner(int p, int t) { int i, dx, dy, rv1, rv2, rv3; ItemStruct *Item; -#ifdef HELLFIRE int qt, t2; -#endif dx = abs(plr[p]._px - towner[t]._tx); dy = abs(plr[p]._py - towner[t]._ty); #ifdef _DEBUG - if (!debug_mode_key_d && (dx >= 2 || dy >= 2)) { - return; - } -#else - if (dx >= 2 || dy >= 2) { - return; - } + if (!debug_mode_key_d) #endif + if (dx >= 2 || dy >= 2) + return; if (qtextflag) { return; @@ -791,9 +764,7 @@ void TalkToTowner(int p, int t) towner[t]._tMsgSaid = TRUE; } if ((plr[p]._pLvlVisited[2] || plr[p]._pLvlVisited[4]) && quests[Q_SKELKING]._qactive != QUEST_NOTAVAIL) { -#ifdef HELLFIRE - if (quests[Q_SKELKING]._qactive != QUEST_NOTAVAIL) -#endif + if (quests[Q_SKELKING]._qactive != QUEST_NOTAVAIL) { if (quests[Q_SKELKING]._qvar2 == 0 && !towner[t]._tMsgSaid) { quests[Q_SKELKING]._qvar2 = 1; quests[Q_SKELKING]._qlog = TRUE; @@ -807,6 +778,7 @@ void TalkToTowner(int p, int t) towner[t]._tMsgSaid = TRUE; NetSendCmdQuest(TRUE, Q_SKELKING); } + } if (quests[Q_SKELKING]._qactive == QUEST_DONE && quests[Q_SKELKING]._qvar2 == 1 && !towner[t]._tMsgSaid) { quests[Q_SKELKING]._qvar2 = 2; quests[Q_SKELKING]._qvar1 = 2; @@ -831,79 +803,63 @@ void TalkToTowner(int p, int t) InitQTextMsg(TEXT_BANNER2); towner[t]._tMsgSaid = TRUE; } -#ifdef HELLFIRE - } - if (!towner[t]._tMsgSaid && PlrHasItem(p, IDI_BANNER, &i) != NULL) { -#else if (quests[Q_LTBANNER]._qvar2 == 1 && PlrHasItem(p, IDI_BANNER, &i) != NULL && !towner[t]._tMsgSaid) { -#endif - quests[Q_LTBANNER]._qactive = QUEST_DONE; - quests[Q_LTBANNER]._qvar1 = 3; - RemoveInvItem(p, i); - CreateItem(UITEM_HARCREST, towner[t]._tx, towner[t]._ty + 1); - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_BANNER3); - towner[t]._tMsgSaid = TRUE; + quests[Q_LTBANNER]._qactive = QUEST_DONE; + quests[Q_LTBANNER]._qvar1 = 3; + RemoveInvItem(p, i); + CreateItem(UITEM_HARCREST, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_BANNER3); + towner[t]._tMsgSaid = TRUE; + } } } -#ifndef HELLFIRE - } -#endif - if (!qtextflag) { - TownerTalk(TEXT_OGDEN1, t); - if (storeflag) { - StartStore(STORE_TAVERN); + if (!qtextflag) { + TownerTalk(TEXT_OGDEN1, t); + if (storeflag) { + StartStore(STORE_TAVERN); + } } - } -} -else if (t == GetActiveTowner(TOWN_DEADGUY)) -{ - if (quests[Q_BUTCHER]._qactive == QUEST_ACTIVE && quests[Q_BUTCHER]._qvar1 == 1) { - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - quests[Q_BUTCHER]._qvar1 = 1; - if (plr[p]._pClass == PC_WARRIOR && !effect_is_playing(PS_WARR8)) { - PlaySFX(PS_WARR8); - } else if (plr[p]._pClass == PC_ROGUE && !effect_is_playing(PS_ROGUE8)) { - PlaySFX(PS_ROGUE8); - } else if (plr[p]._pClass == PC_SORCERER && !effect_is_playing(PS_MAGE8)) { - PlaySFX(PS_MAGE8); -#ifdef HELLFIRE - } else if (plr[p]._pClass == PC_MONK && !effect_is_playing(PS_MONK8)) { - PlaySFX(PS_MONK8); - } else if (plr[p]._pClass == PC_BARD && !effect_is_playing(PS_ROGUE8)) { - PlaySFX(PS_ROGUE8); - } else if (plr[p]._pClass == PC_BARBARIAN && !effect_is_playing(PS_WARR8)) { - PlaySFX(PS_WARR8); -#endif + } else if (t == GetActiveTowner(TOWN_DEADGUY)) { + if (quests[Q_BUTCHER]._qactive == QUEST_ACTIVE && quests[Q_BUTCHER]._qvar1 == 1) { + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + quests[Q_BUTCHER]._qvar1 = 1; + if (plr[p]._pClass == PC_WARRIOR && !effect_is_playing(PS_WARR8)) { + PlaySFX(PS_WARR8); + } else if (plr[p]._pClass == PC_ROGUE && !effect_is_playing(PS_ROGUE8)) { + PlaySFX(PS_ROGUE8); + } else if (plr[p]._pClass == PC_SORCERER && !effect_is_playing(PS_MAGE8)) { + PlaySFX(PS_MAGE8); + } else if (plr[p]._pClass == PC_MONK && !effect_is_playing(PS_MONK8)) { + PlaySFX(PS_MONK8); + } else if (plr[p]._pClass == PC_BARD && !effect_is_playing(PS_ROGUE8)) { + PlaySFX(PS_ROGUE8); + } else if (plr[p]._pClass == PC_BARBARIAN && !effect_is_playing(PS_WARR8)) { + PlaySFX(PS_WARR8); + } + towner[t]._tMsgSaid = TRUE; + } else if (quests[Q_BUTCHER]._qactive == QUEST_DONE && quests[Q_BUTCHER]._qvar1 == 1) { + quests[Q_BUTCHER]._qvar1 = 1; + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + towner[t]._tMsgSaid = TRUE; + } else if (quests[Q_BUTCHER]._qactive == QUEST_INIT || quests[Q_BUTCHER]._qactive == QUEST_ACTIVE && quests[Q_BUTCHER]._qvar1 == 0) { + quests[Q_BUTCHER]._qactive = QUEST_ACTIVE; + quests[Q_BUTCHER]._qlog = TRUE; + quests[Q_BUTCHER]._qmsg = TEXT_BUTCH9; + quests[Q_BUTCHER]._qvar1 = 1; + towner[t]._tbtcnt = 50; + towner[t]._tVar1 = p; + towner[t]._tVar2 = 3; + InitQTextMsg(TEXT_BUTCH9); + towner[t]._tMsgSaid = TRUE; + NetSendCmdQuest(TRUE, Q_BUTCHER); } - towner[t]._tMsgSaid = TRUE; - } else if (quests[Q_BUTCHER]._qactive == QUEST_DONE && quests[Q_BUTCHER]._qvar1 == 1) { - quests[Q_BUTCHER]._qvar1 = 1; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - towner[t]._tMsgSaid = TRUE; - } else if (quests[Q_BUTCHER]._qactive == QUEST_INIT || quests[Q_BUTCHER]._qactive == QUEST_ACTIVE && quests[Q_BUTCHER]._qvar1 == 0) { - quests[Q_BUTCHER]._qactive = QUEST_ACTIVE; - quests[Q_BUTCHER]._qlog = TRUE; - quests[Q_BUTCHER]._qmsg = TEXT_BUTCH9; - quests[Q_BUTCHER]._qvar1 = 1; - towner[t]._tbtcnt = 50; - towner[t]._tVar1 = p; - towner[t]._tVar2 = 3; - InitQTextMsg(TEXT_BUTCH9); - towner[t]._tMsgSaid = TRUE; - NetSendCmdQuest(TRUE, Q_BUTCHER); - } -} -else if (t == GetActiveTowner(TOWN_SMITH)) -{ - if (gbMaxPlayers == 1) { - if (plr[p]._pLvlVisited[4] && quests[Q_ROCK]._qactive != QUEST_NOTAVAIL) { -#ifdef HELLFIRE - if (quests[Q_ROCK]._qactive != QUEST_NOTAVAIL) -#endif + } else if (t == GetActiveTowner(TOWN_SMITH)) { + if (gbMaxPlayers == 1) { + if (plr[p]._pLvlVisited[4] && quests[Q_ROCK]._qactive != QUEST_NOTAVAIL) { if (quests[Q_ROCK]._qvar2 == 0) { quests[Q_ROCK]._qvar2 = 1; quests[Q_ROCK]._qlog = TRUE; @@ -916,490 +872,448 @@ else if (t == GetActiveTowner(TOWN_SMITH)) InitQTextMsg(TEXT_INFRA5); towner[t]._tMsgSaid = TRUE; } -#ifdef HELLFIRE + if (quests[Q_ROCK]._qvar2 == 1 && PlrHasItem(p, IDI_ROCK, &i) != NULL && !towner[t]._tMsgSaid) { + quests[Q_ROCK]._qactive = QUEST_DONE; + quests[Q_ROCK]._qvar2 = 2; + quests[Q_ROCK]._qvar1 = 2; + RemoveInvItem(p, i); + CreateItem(UITEM_INFRARING, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_INFRA7); + towner[t]._tMsgSaid = TRUE; + } + } + if (plr[p]._pLvlVisited[9] && quests[Q_ANVIL]._qactive != QUEST_NOTAVAIL) { + if ((quests[Q_ANVIL]._qactive == QUEST_INIT || quests[Q_ANVIL]._qactive == QUEST_ACTIVE) && quests[Q_ANVIL]._qvar2 == 0 && !towner[t]._tMsgSaid) { + if (quests[Q_ROCK]._qvar2 == 2 || quests[Q_ROCK]._qactive == QUEST_ACTIVE && quests[Q_ROCK]._qvar2 == 1) { + quests[Q_ANVIL]._qvar2 = 1; + quests[Q_ANVIL]._qlog = TRUE; + if (quests[Q_ANVIL]._qactive == QUEST_INIT) { + quests[Q_ANVIL]._qactive = QUEST_ACTIVE; + quests[Q_ANVIL]._qvar1 = 1; + } + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_ANVIL5); + towner[t]._tMsgSaid = TRUE; + } + } + if (quests[Q_ANVIL]._qvar2 == 1 && PlrHasItem(p, IDI_ANVIL, &i) != NULL) { + if (!towner[t]._tMsgSaid) { + quests[Q_ANVIL]._qactive = QUEST_DONE; + quests[Q_ANVIL]._qvar2 = 2; + quests[Q_ANVIL]._qvar1 = 2; + RemoveInvItem(p, i); + CreateItem(UITEM_GRISWOLD, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_ANVIL7); + towner[t]._tMsgSaid = TRUE; + } + } + } } - if (!towner[t]._tMsgSaid && PlrHasItem(p, IDI_ROCK, &i) != NULL) { -#else - if (quests[Q_ROCK]._qvar2 == 1 && PlrHasItem(p, IDI_ROCK, &i) != NULL && !towner[t]._tMsgSaid) { -#endif - quests[Q_ROCK]._qactive = QUEST_DONE; - quests[Q_ROCK]._qvar2 = 2; - quests[Q_ROCK]._qvar1 = 2; + if (!qtextflag) { + TownerTalk(TEXT_GRISWOLD1, t); + if (storeflag) { + StartStore(STORE_SMITH); + } + } + } else if (t == GetActiveTowner(TOWN_WITCH)) { + if (quests[Q_MUSHROOM]._qactive == QUEST_INIT && PlrHasItem(p, IDI_FUNGALTM, &i) != NULL) { RemoveInvItem(p, i); - CreateItem(UITEM_INFRARING, towner[t]._tx, towner[t]._ty + 1); + quests[Q_MUSHROOM]._qactive = QUEST_ACTIVE; + quests[Q_MUSHROOM]._qlog = TRUE; + quests[Q_MUSHROOM]._qvar1 = QS_TOMEGIVEN; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; - InitQTextMsg(TEXT_INFRA7); + InitQTextMsg(TEXT_MUSH8); + towner[t]._tMsgSaid = TRUE; + } else if (quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE) { + if (quests[Q_MUSHROOM]._qvar1 >= QS_TOMEGIVEN && quests[Q_MUSHROOM]._qvar1 <= QS_MUSHPICKED) { + if (PlrHasItem(p, IDI_MUSHROOM, &i) != NULL) { + RemoveInvItem(p, i); + quests[Q_MUSHROOM]._qvar1 = 5; + Qtalklist[TOWN_HEALER]._qblkm = TEXT_MUSH3; + Qtalklist[TOWN_WITCH]._qblkm = -1; + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + quests[Q_MUSHROOM]._qmsg = TEXT_MUSH10; + InitQTextMsg(TEXT_MUSH10); + towner[t]._tMsgSaid = TRUE; + } else if (quests[Q_MUSHROOM]._qmsg != TEXT_MUSH9) { + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + quests[Q_MUSHROOM]._qmsg = TEXT_MUSH9; + InitQTextMsg(TEXT_MUSH9); + towner[t]._tMsgSaid = TRUE; + } + } else { + Item = PlrHasItem(p, IDI_SPECELIX, &i); + if (Item != NULL) { + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_MUSH12); + quests[Q_MUSHROOM]._qactive = QUEST_DONE; + towner[t]._tMsgSaid = TRUE; + AllItemsList[Item->IDidx].iUsable = TRUE; + } else if (PlrHasItem(p, IDI_BRAIN, &i) != NULL && quests[Q_MUSHROOM]._qvar2 != TEXT_MUSH11) { + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + quests[Q_MUSHROOM]._qvar2 = TEXT_MUSH11; + InitQTextMsg(TEXT_MUSH11); + towner[t]._tMsgSaid = TRUE; + } + } + } + if (!qtextflag) { + TownerTalk(TEXT_ADRIA1, t); + if (storeflag) { + StartStore(STORE_WITCH); + } + } + } else if (t == GetActiveTowner(TOWN_BMAID)) { + if (plr[p]._pLvlVisited[21] == false && PlrHasItem(p, IDI_MAPOFDOOM, &i)) { + quests[Q_GRAVE]._qactive = 2; + quests[Q_GRAVE]._qlog = 1; + quests[Q_GRAVE]._qmsg = TEXT_GRAVE8; + InitQTextMsg(TEXT_GRAVE8); towner[t]._tMsgSaid = TRUE; } -#ifndef HELLFIRE - } -#endif - if (plr[p]._pLvlVisited[9] && quests[Q_ANVIL]._qactive != QUEST_NOTAVAIL) { - if ((quests[Q_ANVIL]._qactive == QUEST_INIT || quests[Q_ANVIL]._qactive == QUEST_ACTIVE) && quests[Q_ANVIL]._qvar2 == 0 && !towner[t]._tMsgSaid) { - if (quests[Q_ROCK]._qvar2 == 2 || quests[Q_ROCK]._qactive == QUEST_ACTIVE && quests[Q_ROCK]._qvar2 == 1) { - quests[Q_ANVIL]._qvar2 = 1; - quests[Q_ANVIL]._qlog = TRUE; - if (quests[Q_ANVIL]._qactive == QUEST_INIT) { - quests[Q_ANVIL]._qactive = QUEST_ACTIVE; - quests[Q_ANVIL]._qvar1 = 1; + if (!qtextflag) { + TownerTalk(TEXT_GILLIAN1, t); + if (storeflag) { + StartStore(STORE_BARMAID); + } + } + } else if (t == GetActiveTowner(TOWN_DRUNK)) { + if (!qtextflag) { + TownerTalk(TEXT_FARNHAM1, t); + if (storeflag) { + StartStore(STORE_DRUNK); + } + } + } else if (t == GetActiveTowner(TOWN_HEALER)) { + if (gbMaxPlayers == 1) { + if (plr[p]._pLvlVisited[1] || (gbIsHellfire && plr[p]._pLvlVisited[5])) { + if (!towner[t]._tMsgSaid) { + if (quests[Q_PWATER]._qactive == QUEST_INIT) { + quests[Q_PWATER]._qactive = QUEST_ACTIVE; + quests[Q_PWATER]._qlog = TRUE; + quests[Q_PWATER]._qmsg = TEXT_POISON3; + quests[Q_PWATER]._qvar1 = 1; + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_POISON3); + towner[t]._tMsgSaid = TRUE; + } else if (quests[Q_PWATER]._qactive == QUEST_DONE && quests[Q_PWATER]._qvar1 != 2) { + quests[Q_PWATER]._qvar1 = 2; + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_POISON5); + CreateItem(UITEM_TRING, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tMsgSaid = TRUE; + } } - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_ANVIL5); - towner[t]._tMsgSaid = TRUE; + } + if (quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE && quests[Q_MUSHROOM]._qmsg == TEXT_MUSH10 && PlrHasItem(p, IDI_BRAIN, &i) != NULL) { + RemoveInvItem(p, i); + SpawnQuestItem(IDI_SPECELIX, towner[t]._tx, towner[t]._ty + 1, 0, 0); + InitQTextMsg(TEXT_MUSH4); + quests[Q_MUSHROOM]._qvar1 = QS_BRAINGIVEN; + Qtalklist[TOWN_HEALER]._qblkm = -1; } } -#ifdef HELLFIRE - } - if (!towner[t]._tMsgSaid && PlrHasItem(p, IDI_ANVIL, &i) != NULL) { -#else - if (quests[Q_ANVIL]._qvar2 == 1 && PlrHasItem(p, IDI_ANVIL, &i) != NULL) { - if (!towner[t]._tMsgSaid) { -#endif - quests[Q_ANVIL]._qactive = QUEST_DONE; - quests[Q_ANVIL]._qvar2 = 2; - quests[Q_ANVIL]._qvar1 = 2; - RemoveInvItem(p, i); - CreateItem(UITEM_GRISWOLD, towner[t]._tx, towner[t]._ty + 1); - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_ANVIL7); - towner[t]._tMsgSaid = TRUE; -#ifndef HELLFIRE - } -} -#endif -} -} -if (!qtextflag) { - TownerTalk(TEXT_GRISWOLD1, t); - if (storeflag) { - StartStore(STORE_SMITH); - } -} -} -else if (t == GetActiveTowner(TOWN_WITCH)) -{ - if (quests[Q_MUSHROOM]._qactive == QUEST_INIT && PlrHasItem(p, IDI_FUNGALTM, &i) != NULL) { - RemoveInvItem(p, i); - quests[Q_MUSHROOM]._qactive = QUEST_ACTIVE; - quests[Q_MUSHROOM]._qlog = TRUE; - quests[Q_MUSHROOM]._qvar1 = QS_TOMEGIVEN; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_MUSH8); - towner[t]._tMsgSaid = TRUE; - } else if (quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE) { - if (quests[Q_MUSHROOM]._qvar1 >= QS_TOMEGIVEN && quests[Q_MUSHROOM]._qvar1 <= QS_MUSHPICKED) { - if (PlrHasItem(p, IDI_MUSHROOM, &i) != NULL) { + if (!qtextflag) { + TownerTalk(TEXT_PEPIN1, t); + if (storeflag) { + StartStore(STORE_HEALER); + } + } + } else if (t == GetActiveTowner(TOWN_PEGBOY)) { + if (!qtextflag) { + TownerTalk(TEXT_WIRT1, t); + if (storeflag) { + StartStore(STORE_BOY); + } + } + } else if (t == GetActiveTowner(TOWN_STORY)) { + if (gbMaxPlayers == 1) { + if (quests[Q_BETRAYER]._qactive == QUEST_INIT && PlrHasItem(p, IDI_LAZSTAFF, &i) != NULL) { RemoveInvItem(p, i); - quests[Q_MUSHROOM]._qvar1 = 5; - Qtalklist[TOWN_HEALER]._qblkm = TEXT_MUSH3; - Qtalklist[TOWN_WITCH]._qblkm = -1; + quests[Q_BETRAYER]._qvar1 = 2; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; - quests[Q_MUSHROOM]._qmsg = TEXT_MUSH10; - InitQTextMsg(TEXT_MUSH10); + InitQTextMsg(TEXT_VILE1); towner[t]._tMsgSaid = TRUE; - } else if (quests[Q_MUSHROOM]._qmsg != TEXT_MUSH9) { + quests[Q_BETRAYER]._qactive = QUEST_ACTIVE; + quests[Q_BETRAYER]._qlog = TRUE; + } else if (quests[Q_BETRAYER]._qactive == QUEST_DONE && quests[Q_BETRAYER]._qvar1 == 7) { + quests[Q_BETRAYER]._qvar1 = 8; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; - quests[Q_MUSHROOM]._qmsg = TEXT_MUSH9; - InitQTextMsg(TEXT_MUSH9); + InitQTextMsg(TEXT_VILE3); towner[t]._tMsgSaid = TRUE; + quests[Q_DIABLO]._qlog = TRUE; } - } else { - Item = PlrHasItem(p, IDI_SPECELIX, &i); - if (Item != NULL) { + } + if (gbMaxPlayers != 1) { + if (quests[Q_BETRAYER]._qactive == QUEST_ACTIVE && !quests[Q_BETRAYER]._qlog) { towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; - InitQTextMsg(TEXT_MUSH12); - quests[Q_MUSHROOM]._qactive = QUEST_DONE; + InitQTextMsg(TEXT_VILE1); towner[t]._tMsgSaid = TRUE; - AllItemsList[Item->IDidx].iUsable = TRUE; - } else if (PlrHasItem(p, IDI_BRAIN, &i) != NULL && quests[Q_MUSHROOM]._qvar2 != TEXT_MUSH11) { + quests[Q_BETRAYER]._qlog = TRUE; + NetSendCmdQuest(TRUE, Q_BETRAYER); + } else if (quests[Q_BETRAYER]._qactive == QUEST_DONE && quests[Q_BETRAYER]._qvar1 == 7) { + quests[Q_BETRAYER]._qvar1 = 8; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; - quests[Q_MUSHROOM]._qvar2 = TEXT_MUSH11; - InitQTextMsg(TEXT_MUSH11); + InitQTextMsg(TEXT_VILE3); towner[t]._tMsgSaid = TRUE; + NetSendCmdQuest(TRUE, Q_BETRAYER); + quests[Q_DIABLO]._qlog = TRUE; + NetSendCmdQuest(TRUE, Q_DIABLO); } } - } - if (!qtextflag) { - TownerTalk(TEXT_ADRIA1, t); - if (storeflag) { - StartStore(STORE_WITCH); - } - } -} -else if (t == GetActiveTowner(TOWN_BMAID)) -{ -#ifdef HELLFIRE - if (plr[p]._pLvlVisited[21] == false && PlrHasItem(p, IDI_MAPOFDOOM, &i)) { - quests[Q_GRAVE]._qactive = 2; - quests[Q_GRAVE]._qlog = 1; - quests[Q_GRAVE]._qmsg = TEXT_GRAVE8; - InitQTextMsg(TEXT_GRAVE8); - towner[t]._tMsgSaid = TRUE; - } -#endif - if (!qtextflag) { - TownerTalk(TEXT_GILLIAN1, t); - if (storeflag) { - StartStore(STORE_BARMAID); - } - } -} -else if (t == GetActiveTowner(TOWN_DRUNK)) -{ - if (!qtextflag) { - TownerTalk(TEXT_FARNHAM1, t); - if (storeflag) { - StartStore(STORE_DRUNK); - } - } -} -else if (t == GetActiveTowner(TOWN_HEALER)) -{ - if (gbMaxPlayers == 1) { -#ifdef HELLFIRE - if (plr[p]._pLvlVisited[1] || plr[p]._pLvlVisited[5]) { -#else - if (plr[p]._pLvlVisited[1]) { -#endif - if (!towner[t]._tMsgSaid) { - if (quests[Q_PWATER]._qactive == QUEST_INIT) { - quests[Q_PWATER]._qactive = QUEST_ACTIVE; - quests[Q_PWATER]._qlog = TRUE; - quests[Q_PWATER]._qmsg = TEXT_POISON3; - quests[Q_PWATER]._qvar1 = 1; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_POISON3); - towner[t]._tMsgSaid = TRUE; - } else if (quests[Q_PWATER]._qactive == QUEST_DONE && quests[Q_PWATER]._qvar1 != 2) { - quests[Q_PWATER]._qvar1 = 2; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_POISON5); - CreateItem(UITEM_TRING, towner[t]._tx, towner[t]._ty + 1); - towner[t]._tMsgSaid = TRUE; - } + if (!qtextflag) { + TownerTalk(TEXT_STORY1, t); + if (storeflag) { + StartStore(STORE_STORY); } } - if (quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE && quests[Q_MUSHROOM]._qmsg == TEXT_MUSH10 && PlrHasItem(p, IDI_BRAIN, &i) != NULL) { - RemoveInvItem(p, i); - SpawnQuestItem(IDI_SPECELIX, towner[t]._tx, towner[t]._ty + 1, 0, 0); - InitQTextMsg(TEXT_MUSH4); - quests[Q_MUSHROOM]._qvar1 = QS_BRAINGIVEN; - Qtalklist[TOWN_HEALER]._qblkm = -1; - } - } - if (!qtextflag) { - TownerTalk(TEXT_PEPIN1, t); - if (storeflag) { - StartStore(STORE_HEALER); - } - } -} -else if (t == GetActiveTowner(TOWN_PEGBOY)) -{ - if (!qtextflag) { - TownerTalk(TEXT_WIRT1, t); - if (storeflag) { - StartStore(STORE_BOY); - } - } -} -else if (t == GetActiveTowner(TOWN_STORY)) -{ - if (gbMaxPlayers == 1) { - if (quests[Q_BETRAYER]._qactive == QUEST_INIT && PlrHasItem(p, IDI_LAZSTAFF, &i) != NULL) { - RemoveInvItem(p, i); - quests[Q_BETRAYER]._qvar1 = 2; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_VILE1); - towner[t]._tMsgSaid = TRUE; - quests[Q_BETRAYER]._qactive = QUEST_ACTIVE; - quests[Q_BETRAYER]._qlog = TRUE; - } else if (quests[Q_BETRAYER]._qactive == QUEST_DONE && quests[Q_BETRAYER]._qvar1 == 7) { - quests[Q_BETRAYER]._qvar1 = 8; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_VILE3); - towner[t]._tMsgSaid = TRUE; - quests[Q_DIABLO]._qlog = TRUE; - } - } - if (gbMaxPlayers != 1) { - if (quests[Q_BETRAYER]._qactive == QUEST_ACTIVE && !quests[Q_BETRAYER]._qlog) { - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_VILE1); - towner[t]._tMsgSaid = TRUE; - quests[Q_BETRAYER]._qlog = TRUE; - NetSendCmdQuest(TRUE, Q_BETRAYER); - } else if (quests[Q_BETRAYER]._qactive == QUEST_DONE && quests[Q_BETRAYER]._qvar1 == 7) { - quests[Q_BETRAYER]._qvar1 = 8; - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_VILE3); - towner[t]._tMsgSaid = TRUE; - NetSendCmdQuest(TRUE, Q_BETRAYER); - quests[Q_DIABLO]._qlog = TRUE; - NetSendCmdQuest(TRUE, Q_DIABLO); - } - } - if (!qtextflag) { - TownerTalk(TEXT_STORY1, t); - if (storeflag) { - StartStore(STORE_STORY); - } - } -} -else if (towner[t]._ttype == TOWN_COW) -{ - if (!qtextflag) - CowSFX(p); -#ifdef HELLFIRE -} -else if (towner[t]._ttype == TOWN_FARMER) -{ - if (!qtextflag) { - qt = 277; - t2 = 1; - switch (quests[Q_FARMER]._qactive) { - case 0: - if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { - qt = TEXT_FARMER2; - quests[Q_FARMER]._qactive = 2; - quests[Q_FARMER]._qvar1 = 1; - quests[Q_FARMER]._qlog = 1; - quests[Q_FARMER]._qmsg = TEXT_FARMER1; - break; - } else if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { - qt = 309; - if (plr[myplr]._pLvlVisited[2]) - qt = 281; - if (plr[myplr]._pLvlVisited[5]) - qt = 308; - if (plr[myplr]._pLvlVisited[7]) - qt = 310; - } else { - qt = TEXT_FARMER1; - quests[Q_FARMER]._qactive = 2; - quests[Q_FARMER]._qvar1 = 1; - quests[Q_FARMER]._qlog = 1; - quests[Q_FARMER]._qmsg = TEXT_FARMER1; - SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); - t2 = 1; - break; - } - case 2: - if (PlrHasItem(p, IDI_RUNEBOMB, &i)) - qt = TEXT_FARMER2; - else - qt = TEXT_FARMER3; - break; - case 1: - if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { - qt = TEXT_FARMER2; - quests[Q_FARMER]._qactive = 2; - quests[Q_FARMER]._qvar1 = 1; - quests[Q_FARMER]._qmsg = TEXT_FARMER1; - quests[Q_FARMER]._qlog = 1; - } else if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { - qt = TEXT_FARMER8; - if (plr[myplr]._pLvlVisited[2]) { - qt = TEXT_FARMER5; - } - if (plr[myplr]._pLvlVisited[5]) { - qt = TEXT_FARMER7; - } - if (plr[myplr]._pLvlVisited[7]) { - qt = TEXT_FARMER9; - } - } else { - qt = TEXT_FARMER1; - quests[Q_FARMER]._qactive = 2; - quests[Q_FARMER]._qvar1 = 1; - quests[Q_FARMER]._qlog = 1; - quests[Q_FARMER]._qmsg = TEXT_FARMER1; - SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); - t2 = 1; - } - break; - case 3: - qt = TEXT_FARMER4; - SpawnRewardItem(IDI_AURIC, towner[t]._tx + 1, towner[t]._ty); - quests[Q_FARMER]._qactive = 10; - quests[Q_FARMER]._qlog = 0; + } else if (towner[t]._ttype == TOWN_COW) { + if (!qtextflag) + CowSFX(p); + } else if (towner[t]._ttype == TOWN_FARMER) { + if (!qtextflag) { + qt = 277; t2 = 1; - break; - case 10: - qt = -1; - break; - default: - quests[Q_FARMER]._qactive = 0; - qt = TEXT_FARMER4; - break; - } - if (qt != -1) { - if (t2) - InitQTextMsg(qt); - else - PlaySFX(alltext[qt].sfxnr); - } - if (gbMaxPlayers != 1) { - NetSendCmdQuest(TRUE, Q_FARMER); - } - } -} -else if (towner[t]._ttype == TOWN_COWFARM) -{ - if (!qtextflag) { - qt = 297; - t2 = 1; - if (PlrHasItem(p, IDI_GREYSUIT, &i)) { - qt = TEXT_JERSEY7; - RemoveInvItem(p, i); - } else if (PlrHasItem(p, IDI_BROWNSUIT, &i)) { - CreateItem(UITEM_BOVINE, towner[t]._tx + 1, towner[t]._ty); - RemoveInvItem(p, i); - qt = TEXT_JERSEY8; - quests[Q_JERSEY]._qactive = 3; - } else if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { - qt = TEXT_JERSEY5; - quests[Q_JERSEY]._qactive = 2; - quests[Q_JERSEY]._qvar1 = 1; - quests[Q_JERSEY]._qmsg = TEXT_JERSEY4; - quests[Q_JERSEY]._qlog = 1; - } else { - switch (quests[Q_JERSEY]._qactive) { + switch (quests[Q_FARMER]._qactive) { case 0: - qt = TEXT_JERSEY1; - quests[Q_JERSEY]._qactive = 7; - break; - case 1: - qt = TEXT_JERSEY1; - quests[23]._qactive = 7; - break; - case 2: - qt = TEXT_JERSEY5; - break; - case 3: - qt = TEXT_JERSEY1; - break; - case 7: - qt = TEXT_JERSEY2; - quests[Q_JERSEY]._qactive = 8; - break; - case 8: - qt = TEXT_JERSEY3; - quests[Q_JERSEY]._qactive = 9; - break; - case 9: - if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { - switch (random_(0, 4) + 9) { - case 9: - qt = TEXT_JERSEY9; - break; - case 10: - qt = TEXT_JERSEY10; - break; - case 11: - qt = TEXT_JERSEY11; - break; - default: - qt = TEXT_JERSEY12; - } + if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { + qt = TEXT_FARMER2; + quests[Q_FARMER]._qactive = 2; + quests[Q_FARMER]._qvar1 = 1; + quests[Q_FARMER]._qlog = 1; + quests[Q_FARMER]._qmsg = TEXT_FARMER1; break; + } else if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { + qt = 309; + if (plr[myplr]._pLvlVisited[2]) + qt = 281; + if (plr[myplr]._pLvlVisited[5]) + qt = 308; + if (plr[myplr]._pLvlVisited[7]) + qt = 310; } else { - qt = TEXT_JERSEY4; - quests[Q_JERSEY]._qactive = 2; - quests[Q_JERSEY]._qvar1 = 1; - quests[Q_JERSEY]._qmsg = TEXT_JERSEY4; - quests[Q_JERSEY]._qlog = 1; + qt = TEXT_FARMER1; + quests[Q_FARMER]._qactive = 2; + quests[Q_FARMER]._qvar1 = 1; + quests[Q_FARMER]._qlog = 1; + quests[Q_FARMER]._qmsg = TEXT_FARMER1; SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); t2 = 1; + break; } - break; - default: - qt = TEXT_JERSEY5; - quests[Q_JERSEY]._qactive = 0; - break; - } - } - if (qt != -1) { - if (t2) - InitQTextMsg(qt); - else - PlaySFX(alltext[qt].sfxnr); - } - if (gbMaxPlayers != 1) { - NetSendCmdQuest(TRUE, Q_JERSEY); - } - } -} -else if (towner[t]._ttype == TOWN_GIRL) -{ - if (!qtextflag) { - qt = 282; - t2 = 0; - if (!PlrHasItem(p, IDI_THEODORE, &i) || quests[Q_GIRL]._qactive == 3) { - switch (quests[Q_GIRL]._qactive) { - case 0: - qt = TEXT_GIRL2; - quests[Q_GIRL]._qactive = 2; - quests[Q_GIRL]._qvar1 = 1; - quests[Q_GIRL]._qlog = 1; - quests[Q_GIRL]._qmsg = TEXT_GIRL2; - t2 = 1; + case 2: + if (PlrHasItem(p, IDI_RUNEBOMB, &i)) + qt = TEXT_FARMER2; + else + qt = TEXT_FARMER3; break; case 1: - qt = TEXT_GIRL2; - quests[Q_GIRL]._qvar1 = 1; - quests[Q_GIRL]._qlog = 1; - quests[Q_GIRL]._qmsg = TEXT_GIRL2; - quests[Q_GIRL]._qactive = 2; - t2 = 1; + if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { + qt = TEXT_FARMER2; + quests[Q_FARMER]._qactive = 2; + quests[Q_FARMER]._qvar1 = 1; + quests[Q_FARMER]._qmsg = TEXT_FARMER1; + quests[Q_FARMER]._qlog = 1; + } else if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { + qt = TEXT_FARMER8; + if (plr[myplr]._pLvlVisited[2]) { + qt = TEXT_FARMER5; + } + if (plr[myplr]._pLvlVisited[5]) { + qt = TEXT_FARMER7; + } + if (plr[myplr]._pLvlVisited[7]) { + qt = TEXT_FARMER9; + } + } else { + qt = TEXT_FARMER1; + quests[Q_FARMER]._qactive = 2; + quests[Q_FARMER]._qvar1 = 1; + quests[Q_FARMER]._qlog = 1; + quests[Q_FARMER]._qmsg = TEXT_FARMER1; + SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); + t2 = 1; + } break; - case 2: - qt = TEXT_GIRL3; + case 3: + qt = TEXT_FARMER4; + SpawnRewardItem(IDI_AURIC, towner[t]._tx + 1, towner[t]._ty); + quests[Q_FARMER]._qactive = 10; + quests[Q_FARMER]._qlog = 0; t2 = 1; break; - case 3: + case 10: qt = -1; break; default: - quests[Q_GIRL]._qactive = 0; - qt = TEXT_GIRL1; + quests[Q_FARMER]._qactive = 0; + qt = TEXT_FARMER4; break; } - } else { - qt = TEXT_GIRL4; - RemoveInvItem(p, i); - CreateAmulet(towner[t]._tx, towner[t]._ty, 13, 0, 1); - quests[Q_GIRL]._qlog = 0; - quests[Q_GIRL]._qactive = 3; - t2 = 1; + if (qt != -1) { + if (t2) + InitQTextMsg(qt); + else + PlaySFX(alltext[qt].sfxnr); + } + if (gbMaxPlayers != 1) { + NetSendCmdQuest(TRUE, Q_FARMER); + } } - if (qt != -1) { - if (t2 != 0) { - InitQTextMsg(qt); + } else if (towner[t]._ttype == TOWN_COWFARM) { + if (!qtextflag) { + qt = 297; + t2 = 1; + if (PlrHasItem(p, IDI_GREYSUIT, &i)) { + qt = TEXT_JERSEY7; + RemoveInvItem(p, i); + } else if (PlrHasItem(p, IDI_BROWNSUIT, &i)) { + CreateItem(UITEM_BOVINE, towner[t]._tx + 1, towner[t]._ty); + RemoveInvItem(p, i); + qt = TEXT_JERSEY8; + quests[Q_JERSEY]._qactive = 3; + } else if (PlrHasItem(p, IDI_RUNEBOMB, &i)) { + qt = TEXT_JERSEY5; + quests[Q_JERSEY]._qactive = 2; + quests[Q_JERSEY]._qvar1 = 1; + quests[Q_JERSEY]._qmsg = TEXT_JERSEY4; + quests[Q_JERSEY]._qlog = 1; } else { - PlaySFX(alltext[qt].sfxnr); + switch (quests[Q_JERSEY]._qactive) { + case 0: + qt = TEXT_JERSEY1; + quests[Q_JERSEY]._qactive = 7; + break; + case 1: + qt = TEXT_JERSEY1; + quests[23]._qactive = 7; + break; + case 2: + qt = TEXT_JERSEY5; + break; + case 3: + qt = TEXT_JERSEY1; + break; + case 7: + qt = TEXT_JERSEY2; + quests[Q_JERSEY]._qactive = 8; + break; + case 8: + qt = TEXT_JERSEY3; + quests[Q_JERSEY]._qactive = 9; + break; + case 9: + if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { + switch (random_(0, 4) + 9) { + case 9: + qt = TEXT_JERSEY9; + break; + case 10: + qt = TEXT_JERSEY10; + break; + case 11: + qt = TEXT_JERSEY11; + break; + default: + qt = TEXT_JERSEY12; + } + break; + } else { + qt = TEXT_JERSEY4; + quests[Q_JERSEY]._qactive = 2; + quests[Q_JERSEY]._qvar1 = 1; + quests[Q_JERSEY]._qmsg = TEXT_JERSEY4; + quests[Q_JERSEY]._qlog = 1; + SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); + t2 = 1; + } + break; + default: + qt = TEXT_JERSEY5; + quests[Q_JERSEY]._qactive = 0; + break; + } + } + if (qt != -1) { + if (t2) + InitQTextMsg(qt); + else + PlaySFX(alltext[qt].sfxnr); + } + if (gbMaxPlayers != 1) { + NetSendCmdQuest(TRUE, Q_JERSEY); } } - if (gbMaxPlayers != 1) { - NetSendCmdQuest(TRUE, Q_GIRL); + } else if (towner[t]._ttype == TOWN_GIRL) { + if (!qtextflag) { + qt = 282; + t2 = 0; + if (!PlrHasItem(p, IDI_THEODORE, &i) || quests[Q_GIRL]._qactive == 3) { + switch (quests[Q_GIRL]._qactive) { + case 0: + qt = TEXT_GIRL2; + quests[Q_GIRL]._qactive = 2; + quests[Q_GIRL]._qvar1 = 1; + quests[Q_GIRL]._qlog = 1; + quests[Q_GIRL]._qmsg = TEXT_GIRL2; + t2 = 1; + break; + case 1: + qt = TEXT_GIRL2; + quests[Q_GIRL]._qvar1 = 1; + quests[Q_GIRL]._qlog = 1; + quests[Q_GIRL]._qmsg = TEXT_GIRL2; + quests[Q_GIRL]._qactive = 2; + t2 = 1; + break; + case 2: + qt = TEXT_GIRL3; + t2 = 1; + break; + case 3: + qt = -1; + break; + default: + quests[Q_GIRL]._qactive = 0; + qt = TEXT_GIRL1; + break; + } + } else { + qt = TEXT_GIRL4; + RemoveInvItem(p, i); + CreateAmulet(towner[t]._tx, towner[t]._ty, 13, 0, 1); + quests[Q_GIRL]._qlog = 0; + quests[Q_GIRL]._qactive = 3; + t2 = 1; + } + if (qt != -1) { + if (t2 != 0) { + InitQTextMsg(qt); + } else { + PlaySFX(alltext[qt].sfxnr); + } + } + if (gbMaxPlayers != 1) { + NetSendCmdQuest(TRUE, Q_GIRL); + } } } -#endif -} } DEVILUTION_END_NAMESPACE diff --git a/Source/trigs.cpp b/Source/trigs.cpp index e710a2f2c..427fe831b 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -140,7 +140,6 @@ void InitTownTriggers() numtrigs++; } } -#ifdef HELLFIRE if (quests[Q_GRAVE]._qactive == 3) { trigs[numtrigs]._tx = 36; trigs[numtrigs]._ty = 24; @@ -148,6 +147,7 @@ void InitTownTriggers() trigs[numtrigs]._tlvl = 21; numtrigs++; } +#ifdef HELLFIRE trigs[numtrigs]._tx = 80; trigs[numtrigs]._ty = 62; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; diff --git a/defs.h b/defs.h index d5850b73c..2876716f6 100644 --- a/defs.h +++ b/defs.h @@ -44,11 +44,7 @@ #define MAXOBJECTS 127 #define MAXPORTAL 4 -#ifdef HELLFIRE #define MAXQUESTS 24 -#else -#define MAXQUESTS 16 -#endif #define MAXMULTIQUESTS 10 #define MAXTHEMES 50 diff --git a/structs.h b/structs.h index 620a586d6..76c4c11de 100644 --- a/structs.h +++ b/structs.h @@ -1146,7 +1146,6 @@ typedef struct QuestTalkData { int _qpw; int _qbone; int _qvb; -#ifdef HELLFIRE int _qgrv; int _qfarm; int _qgirl; @@ -1155,7 +1154,6 @@ typedef struct QuestTalkData { int _qnakrul; int _qjersy; int _qhf8; -#endif } QuestTalkData; //////////////////////////////////////////////////