From 2477d956e9af74dee976fba363871fb23d648cb6 Mon Sep 17 00:00:00 2001 From: Chance4us Date: Fri, 16 Oct 2020 22:51:32 +0200 Subject: [PATCH 1/9] [hellfire] correct the name for barrels --- Source/objects.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/objects.cpp b/Source/objects.cpp index f3ab6e1e8..9e032130e 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -5261,6 +5261,13 @@ void GetObjectStr(int i) break; case OBJ_BARREL: case OBJ_BARRELEX: + #ifdef HELLFIRE + if (currlevel > 16 && currlevel < 21) // for hive levels + strcpy(infostr, "Pod"); //Then a barrel is called a pod + else if (currlevel > 20 && currlevel < 25) // for crypt levels + strcpy(infostr, "Urn"); //Then a barrel is called an urn + else + #endif strcpy(infostr, "Barrel"); break; case OBJ_SKELBOOK: From 5e535c43bb6418e7d86cee4dcece46e46e72aa5e Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 16 Oct 2020 23:50:21 +0200 Subject: [PATCH 2/9] Update Source/objects.cpp --- Source/objects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index 9e032130e..29b7b977e 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -5261,13 +5261,13 @@ void GetObjectStr(int i) break; case OBJ_BARREL: case OBJ_BARRELEX: - #ifdef HELLFIRE +#ifdef HELLFIRE if (currlevel > 16 && currlevel < 21) // for hive levels strcpy(infostr, "Pod"); //Then a barrel is called a pod else if (currlevel > 20 && currlevel < 25) // for crypt levels strcpy(infostr, "Urn"); //Then a barrel is called an urn else - #endif +#endif strcpy(infostr, "Barrel"); break; case OBJ_SKELBOOK: From 35ca35e813bfdd6c80ba91f3b9c660fe0ba6ec89 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 Oct 2020 03:58:45 +0200 Subject: [PATCH 3/9] Books are present on all floors of the crypt --- Source/objdat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/objdat.cpp b/Source/objdat.cpp index f868867a3..e0fc078f4 100644 --- a/Source/objdat.cpp +++ b/Source/objdat.cpp @@ -213,7 +213,7 @@ ObjDataStruct AllObjects[] = { { 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE }, { 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE }, #ifdef HELLFIRE - { 1, OFILE_BKSLBRNT, 1, 24, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, // BUGFIX should only be loaded on level 4-12 like in the original + { 1, OFILE_BKSLBRNT, 1, 24, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, // BUGFIX should only be loaded on level 1-12 (crypt masks as 1-4) #else { 1, OFILE_BKSLBRNT, 4, 12, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, #endif From d2f495daa2467fcab5ee8eb269ab7350b6735b8f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 00:24:27 +0200 Subject: [PATCH 4/9] [hellfire] implement DoLighting --- Source/lighting.cpp | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 644632b39..3dd391424 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -556,11 +556,19 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) max_y = 15; } +#ifdef HELLFIRE + if (currlevel < 17) { +#else if (nXPos >= 0 && nXPos < MAXDUNX && nYPos >= 0 && nYPos < MAXDUNY) { +#endif dLight[nXPos][nYPos] = 0; +#ifdef HELLFIRE + } else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) { + dLight[nXPos][nYPos] = lightradius[nRadius][0]; } +#endif - mult = xoff + 8 * yoff; + mult = xoff + 8*yoff; for (y = 0; y < min_y; y++) { for (x = 1; x < max_x; x++) { radius_block = lightblock[mult][y][x]; @@ -568,11 +576,11 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) temp_x = nXPos + x; temp_y = nYPos + y; v = lightradius[nRadius][radius_block]; - if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) { - if (v < dLight[temp_x][temp_y]) { +#ifndef HELLFIRE + if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) +#endif + if (v < dLight[temp_x][temp_y]) dLight[temp_x][temp_y] = v; - } - } } } } @@ -585,11 +593,11 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) temp_x = nXPos + y; temp_y = nYPos - x; v = lightradius[nRadius][radius_block]; - if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) { - if (v < dLight[temp_x][temp_y]) { +#ifndef HELLFIRE + if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) +#endif + if (v < dLight[temp_x][temp_y]) dLight[temp_x][temp_y] = v; - } - } } } } @@ -602,11 +610,11 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) temp_x = nXPos - x; temp_y = nYPos - y; v = lightradius[nRadius][radius_block]; - if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) { - if (v < dLight[temp_x][temp_y]) { +#ifndef HELLFIRE + if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) +#endif + if (v < dLight[temp_x][temp_y]) dLight[temp_x][temp_y] = v; - } - } } } } @@ -619,11 +627,11 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) temp_x = nXPos - y; temp_y = nYPos + x; v = lightradius[nRadius][radius_block]; - if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) { - if (v < dLight[temp_x][temp_y]) { +#ifndef HELLFIRE + if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) +#endif + if (v < dLight[temp_x][temp_y]) dLight[temp_x][temp_y] = v; - } - } } } } From 437b5d1187bda7c45ff655ec9ebb5a2f02da46e3 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 00:26:06 +0200 Subject: [PATCH 5/9] [hellfire] MakeLightTable --- Source/lighting.cpp | 57 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 3dd391424..7583bdf62 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -565,8 +565,8 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum) #ifdef HELLFIRE } else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) { dLight[nXPos][nYPos] = lightradius[nRadius][0]; - } #endif + } mult = xoff + 8*yoff; for (y = 0; y < min_y; y++) { @@ -915,6 +915,21 @@ void MakeLightTable() } tbl += 224; } +#ifdef HELLFIRE + if (currlevel >= 17) { + tbl = pLightTbl; + for (i = 0; i < lights; i++) { + *tbl++ = 0; + for (j = 1; j < 16; j++) + *tbl++ = j; + tbl += 240; + } + *tbl++ = 0; + for (j = 1; j < 16; j++) + *tbl++ = 1; + tbl += 240; + } +#endif trn = LoadFileInMem("PlrGFX\\Infra.TRN", NULL); for (i = 0; i < 256; i++) { @@ -954,27 +969,41 @@ void MakeLightTable() *tbl++ = 0; } - for (k = 0; k < 16; k++) { - for (l = 0; l < 128; l++) { - if (l > (k + 1) * 8) { - lightradius[k][l] = 15; + for (j = 0; j < 16; j++) { + for (i = 0; i < 128; i++) { + if (i > (j + 1) * 8) { + lightradius[j][i] = 15; } else { - lightradius[k][l] = l * 15.0 / ((k + 1) * 8.0) + 0.5; + fs = (double)15 * i / ((double)8 * (j + 1)); + lightradius[j][i] = (BYTE)(fs + 0.5); } } } - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { +#ifdef HELLFIRE + if (currlevel >= 17) { + for (j = 0; j < 16; j++) { + fa = (sqrt((double)(16 - j))) / 128; + fa *= fa; + for (i = 0; i < 128; i++) { + lightradius[15 - j][i] = 15 - (BYTE)(fa * (double)((128 - i) * (128 - i))); + if (lightradius[15 - j][i] > 15) + lightradius[15 - j][i] = 0; + lightradius[15 - j][i] = lightradius[15 - j][i] - (BYTE)((15 - j) / 2); + if (lightradius[15 - j][i] > 15) + lightradius[15 - j][i] = 0; + } + } + } +#endif + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { for (k = 0; k < 16; k++) { for (l = 0; l < 16; l++) { fs = (BYTE)sqrt((8 * l - j) * (8 * l - j) + (8 * k - i) * (8 * k - i)); - if (fs < 0.0) { - fa = -0.5; - } else { - fa = 0.5; - } - lightblock[i * 8 + j][k][l] = fs + fa; + fs += fs < 0 ? -0.5 : 0.5; + + lightblock[j * 8 + i][k][l] = fs; } } } From fd7a2a63b5a0f4d45e57e00f8194b23a9847448a Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 05:44:07 +0200 Subject: [PATCH 6/9] [hellfire] mainmenu_loop UiMainMenuDialog UiSupportDialog have been disabled as to avoid having to implement hellfireui.dll for now. --- Source/mainmenu.cpp | 20 ++++++++++++++++++-- enums.h | 13 ++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index d8edd9300..51d64d6ee 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -95,12 +95,17 @@ void mainmenu_loop() BOOL done; int menu; - done = FALSE; mainmenu_refresh_music(); + done = FALSE; do { menu = 0; +#ifdef HELLFIRE + //if (!UiMainMenuDialog(gszProductName, &menu, UseMultiTest, effects_play_sound, 30)) + if (!UiMainMenuDialog(gszProductName, &menu, effects_play_sound, 30)) +#else if (!UiMainMenuDialog(gszProductName, &menu, effects_play_sound, 30)) +#endif app_fatal("Unable to display mainmenu"); switch (menu) { @@ -112,10 +117,15 @@ void mainmenu_loop() if (!mainmenu_multi_player()) done = TRUE; break; - case MAINMENU_REPLAY_INTRO: case MAINMENU_ATTRACT_MODE: +#ifdef HELLFIRE + break; +#endif + case MAINMENU_REPLAY_INTRO: #ifdef SPAWN +#ifndef HELLFIRE done = FALSE; +#endif #else if (gbActive) mainmenu_play_intro(); @@ -124,6 +134,12 @@ void mainmenu_loop() case MAINMENU_SHOW_CREDITS: UiCreditsDialog(16); break; +#ifdef HELLFIRE + case MAINMENU_SHOW_SUPPORT: + //UiSupportDialog(16); + UiCreditsDialog(16); + break; +#endif case MAINMENU_EXIT_DIABLO: done = TRUE; break; diff --git a/enums.h b/enums.h index d1c6a6c89..c1fecfff9 100644 --- a/enums.h +++ b/enums.h @@ -2790,11 +2790,14 @@ typedef enum _music_id { typedef enum _mainmenu_selections { MAINMENU_SINGLE_PLAYER = 1, - MAINMENU_MULTIPLAYER = 2, - MAINMENU_REPLAY_INTRO = 3, - MAINMENU_SHOW_CREDITS = 4, - MAINMENU_EXIT_DIABLO = 5, - MAINMENU_ATTRACT_MODE = 6, + MAINMENU_MULTIPLAYER, + MAINMENU_REPLAY_INTRO, +#ifdef HELLFIRE + MAINMENU_SHOW_SUPPORT, +#endif + MAINMENU_SHOW_CREDITS, + MAINMENU_EXIT_DIABLO, + MAINMENU_ATTRACT_MODE, } _mainmenu_selections; typedef enum _selhero_selections { From ff49e662a0a54d2a842ee70c59b0213e47498430 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 05:54:47 +0200 Subject: [PATCH 7/9] [hellfire] mainmenu_single_player --- Source/gamemenu.h | 1 + Source/mainmenu.cpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/Source/gamemenu.h b/Source/gamemenu.h index 3ce5c4988..f8f6acf8e 100644 --- a/Source/gamemenu.h +++ b/Source/gamemenu.h @@ -7,6 +7,7 @@ #define __GAMEMENU_H__ #ifdef HELLFIRE +extern char *jogging_title; extern BOOL jogging_opt; #endif diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 51d64d6ee..8a1b94af1 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -151,8 +151,40 @@ void mainmenu_loop() BOOL mainmenu_single_player() { +#ifdef HELLFIRE + int dlgresult; + + while (TRUE) { + gbMaxPlayers = 1; + dlgresult = 0; + + if (!SRegLoadValue(APP_NAME, jogging_title, 0, &jogging_opt)) { + jogging_opt = TRUE; + } + + if (!UiSelHeroSingDialog( + pfile_ui_set_hero_infos, + pfile_ui_save_create, + pfile_delete_save, + pfile_ui_set_class_stats, + &dlgresult, + gszHero, + &gnDifficulty + //,UseBardTest, + //UseBarbarianTest + )) { + app_fatal("Unable to display SelHeroSing"); + } + + if (dlgresult == SELHERO_PREVIOUS) + return TRUE; + if (!mainmenu_init_menu(dlgresult)) + return FALSE; + } +#else gbMaxPlayers = 1; return mainmenu_init_menu(SELHERO_NEW_DUNGEON); +#endif } BOOL mainmenu_init_menu(int type) From 3c3e9b0f63a0839320bb0f4b1e30153c38525ceb Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 06:04:35 +0200 Subject: [PATCH 8/9] [hellfire] mainmenu_multi_player --- Source/mainmenu.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 8a1b94af1..c2c1c1cd2 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -205,8 +205,37 @@ BOOL mainmenu_init_menu(int type) BOOL mainmenu_multi_player() { +#ifdef HELLFIRE + int dlgresult; + BOOL hero_is_created = TRUE; + + while (TRUE) { + gbMaxPlayers = MAX_PLRS; + dlgresult = 0; + jogging_opt = FALSE; + if (!UiSelHeroMultDialog( + pfile_ui_set_hero_infos, + pfile_ui_save_create, + pfile_delete_save, + pfile_ui_set_class_stats, + &dlgresult, + &hero_is_created, // Not in hellfire + gszHero + //,UseBardTest, + //UseBarbarianTest + )) { + app_fatal("Can't load multiplayer dialog"); + } + + if (dlgresult == SELHERO_PREVIOUS) + return TRUE; + if (!mainmenu_init_menu(dlgresult)) + return FALSE; + } +#else gbMaxPlayers = MAX_PLRS; return mainmenu_init_menu(SELHERO_CONNECT); +#endif } #ifndef SPAWN From 39e3de683d976bbf60e6f2240430d92af2326ec1 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 18 Oct 2020 15:08:23 +0200 Subject: [PATCH 9/9] [hellfire] TalkToTowner --- Source/towners.cpp | 101 +++++++++++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 30 deletions(-) diff --git a/Source/towners.cpp b/Source/towners.cpp index 3e0d59fc0..e8a90b33e 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -799,6 +799,9 @@ 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]._qvar2 == 0 && !towner[t]._tMsgSaid) { quests[Q_SKELKING]._qvar2 = 1; quests[Q_SKELKING]._qlog = TRUE; @@ -822,7 +825,8 @@ void TalkToTowner(int p, int t) NetSendCmdQuest(TRUE, Q_SKELKING); } } - if (gbMaxPlayers == 1 && plr[p]._pLvlVisited[3] && quests[Q_LTBANNER]._qactive != QUEST_NOTAVAIL) { + if (gbMaxPlayers == 1) { + if (plr[p]._pLvlVisited[3] && quests[Q_LTBANNER]._qactive != QUEST_NOTAVAIL) { if ((quests[Q_LTBANNER]._qactive == QUEST_INIT || quests[Q_LTBANNER]._qactive == QUEST_ACTIVE) && quests[Q_LTBANNER]._qvar2 == 0 && !towner[t]._tMsgSaid) { quests[Q_LTBANNER]._qvar2 = 1; if (quests[Q_LTBANNER]._qactive == QUEST_INIT) { @@ -835,9 +839,11 @@ void TalkToTowner(int p, int t) InitQTextMsg(TEXT_BANNER2); towner[t]._tMsgSaid = TRUE; } - if (quests[Q_LTBANNER]._qvar2 == 1 && PlrHasItem(p, IDI_BANNER, i) != NULL) { -#ifndef HELLFIRE - if (!towner[t]._tMsgSaid) { +#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; @@ -847,11 +853,11 @@ void TalkToTowner(int p, int t) towner[t]._tVar1 = p; InitQTextMsg(TEXT_BANNER3); towner[t]._tMsgSaid = TRUE; + } + } #ifndef HELLFIRE } #endif - } - } if (!qtextflag) { TownerTalk(TEXT_OGDEN1, t); if (storeflag) { @@ -901,6 +907,9 @@ void TalkToTowner(int p, int t) } 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 if (quests[Q_ROCK]._qvar2 == 0) { quests[Q_ROCK]._qvar2 = 1; quests[Q_ROCK]._qlog = TRUE; @@ -913,9 +922,11 @@ void TalkToTowner(int p, int t) InitQTextMsg(TEXT_INFRA5); towner[t]._tMsgSaid = TRUE; } - if (quests[Q_ROCK]._qvar2 == 1 && PlrHasItem(p, IDI_ROCK, i) != NULL) { -#ifndef HELLFIRE - if (!towner[t]._tMsgSaid) { +#ifdef HELLFIRE + } + 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; @@ -926,11 +937,10 @@ void TalkToTowner(int p, int t) towner[t]._tVar1 = p; InitQTextMsg(TEXT_INFRA7); towner[t]._tMsgSaid = TRUE; -#ifndef HELLFIRE } -#endif +#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) { @@ -946,8 +956,11 @@ void TalkToTowner(int p, int t) towner[t]._tMsgSaid = TRUE; } } +#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) { -#ifndef HELLFIRE if (!towner[t]._tMsgSaid) { #endif quests[Q_ANVIL]._qactive = QUEST_DONE; @@ -961,8 +974,8 @@ void TalkToTowner(int p, int t) towner[t]._tMsgSaid = TRUE; #ifndef HELLFIRE } -#endif } +#endif } } if (!qtextflag) { @@ -1030,7 +1043,7 @@ void TalkToTowner(int p, int t) quests[Q_GRAVE]._qactive = 2; quests[Q_GRAVE]._qlog = 1; quests[Q_GRAVE]._qmsg = TEXT_GRAVE8; - InitQTextMsg(Q_GRAVE); + InitQTextMsg(TEXT_GRAVE8); towner[t]._tMsgSaid = TRUE; } #endif @@ -1050,10 +1063,11 @@ void TalkToTowner(int p, int t) } else if (t == GetActiveTowner(TOWN_HEALER)) { if (gbMaxPlayers == 1) { #ifdef HELLFIRE - if ((plr[p]._pLvlVisited[1] || plr[p]._pLvlVisited[5]) && !towner[t]._tMsgSaid) { + if (plr[p]._pLvlVisited[1] || plr[p]._pLvlVisited[5]) { #else - if (plr[p]._pLvlVisited[1] && !towner[t]._tMsgSaid) { + 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; @@ -1072,6 +1086,7 @@ void TalkToTowner(int p, int t) 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); @@ -1144,6 +1159,8 @@ void TalkToTowner(int p, int t) #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)) { @@ -1152,8 +1169,15 @@ void TalkToTowner(int p, int t) 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 = !PlrHasItem(p, IDI_RUNEBOMB, i) ? TEXT_FARMER3 : TEXT_FARMER2; + 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; @@ -1161,7 +1185,14 @@ void TalkToTowner(int p, int t) 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)) { @@ -1188,16 +1219,15 @@ void TalkToTowner(int p, int t) 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 = !PlrHasItem(p, IDI_RUNEBOMB, i) ? TEXT_FARMER3 : TEXT_FARMER2; - 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; + t2 = 1; break; case 10: qt = -1; @@ -1208,7 +1238,10 @@ void TalkToTowner(int p, int t) break; } if (qt != -1) { + if (t2) InitQTextMsg(qt); + else + PlaySFX(alltext[qt].sfxnr); } if (gbMaxPlayers != 1) { NetSendCmdQuest(TRUE, Q_FARMER); @@ -1216,6 +1249,8 @@ void TalkToTowner(int p, int t) } } 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); @@ -1237,13 +1272,14 @@ void TalkToTowner(int p, int t) quests[Q_JERSEY]._qactive = 7; break; case 1: - qt = TEXT_JERSEY5; + qt = TEXT_JERSEY1; + quests[23]._qactive = 7; break; case 2: - qt = TEXT_JERSEY1; + qt = TEXT_JERSEY5; break; case 3: - qt = TEXT_JERSEY5; + qt = TEXT_JERSEY1; break; case 7: qt = TEXT_JERSEY2; @@ -1255,20 +1291,20 @@ void TalkToTowner(int p, int t) break; case 9: if (!plr[myplr]._pLvlVisited[9] && plr[myplr]._pLevel < 15) { - switch (random_(0, 4)) { - case 0: + switch (random_(0, 4) + 9) { + case 9: qt = TEXT_JERSEY9; break; - case 1: + case 10: qt = TEXT_JERSEY10; break; - case 2: + case 11: qt = TEXT_JERSEY11; break; default: qt = TEXT_JERSEY12; - break; } + break; } else { qt = TEXT_JERSEY4; quests[Q_JERSEY]._qactive = 2; @@ -1276,6 +1312,7 @@ void TalkToTowner(int p, int t) quests[Q_JERSEY]._qmsg = TEXT_JERSEY4; quests[Q_JERSEY]._qlog = 1; SpawnRuneBomb(towner[t]._tx + 1, towner[t]._ty); + t2 = 1; } break; default: @@ -1285,7 +1322,10 @@ void TalkToTowner(int p, int t) } } if (qt != -1) { + if (t2) InitQTextMsg(qt); + else + PlaySFX(alltext[qt].sfxnr); } if (gbMaxPlayers != 1) { NetSendCmdQuest(TRUE, Q_JERSEY); @@ -1293,9 +1333,10 @@ void TalkToTowner(int p, int t) } } 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_FARMER]._qactive) { + switch (quests[Q_GIRL]._qactive) { case 0: qt = TEXT_GIRL2; quests[Q_GIRL]._qactive = 2;