Only send failed quest trader messages for non-repeatable quests

This commit is contained in:
Dev 2024-01-07 23:51:28 +00:00
parent 5eda074dbe
commit 0b3ad5bbd8

View File

@ -636,14 +636,18 @@ export class QuestHelper
// Create a dialog message for completing the quest.
const quest = this.getQuestFromDb(failRequest.qid, pmcData);
this.mailSendService.sendLocalisedNpcMessageToPlayer(
sessionID,
this.traderHelper.getTraderById(quest.traderId),
MessageType.QUEST_FAIL,
quest.failMessageText,
questRewards,
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime),
);
const questIsRepeatable = pmcData.RepeatableQuests.some(quest => quest.id === failRequest.qid);
if (!questIsRepeatable)
{
this.mailSendService.sendLocalisedNpcMessageToPlayer(
sessionID,
this.traderHelper.getTraderById(quest.traderId),
MessageType.QUEST_FAIL,
quest.failMessageText,
questRewards,
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime),
);
}
output.profileChanges[sessionID].quests.push(this.failedUnlocked(failRequest.qid, sessionID));