From 3526b2764ad2f3e544545f73f241aa2a9b1d1466 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 22 Jul 2023 13:02:42 +0100 Subject: [PATCH] Migrate quest fail to new MailSendService --- project/src/helpers/QuestHelper.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index 2f20b050..c5e8e7e1 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -21,6 +21,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; import { LocalisationService } from "../services/LocalisationService"; +import { MailSendService } from "../services/MailSendService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -51,6 +52,7 @@ export class QuestHelper @inject("PaymentHelper") protected paymentHelper: PaymentHelper, @inject("LocalisationService") protected localisationService: LocalisationService, @inject("TraderHelper") protected traderHelper: TraderHelper, + @inject("MailSendService") protected mailSendService: MailSendService, @inject("ConfigServer") protected configServer: ConfigServer ) { @@ -517,9 +519,17 @@ export class QuestHelper // Create a dialog message for completing the quest. const quest = this.getQuestFromDb(failRequest.qid, pmcData); - const messageContent = this.dialogueHelper.createMessageContext(quest.failMessageText, MessageType.QUEST_FAIL, this.questConfig.redeemTime); + //const messageContent = this.dialogueHelper.createMessageContext(quest.failMessageText, MessageType.QUEST_FAIL, this.questConfig.redeemTime); + //this.dialogueHelper.addDialogueMessage(quest.traderId, messageContent, sessionID, questRewards); - this.dialogueHelper.addDialogueMessage(quest.traderId, messageContent, sessionID, questRewards); + this.mailSendService.sendLocalisedNpcMessageToPlayer( + sessionID, + this.traderHelper.getTraderById(quest.traderId), + MessageType.QUEST_FAIL, + quest.failMessageText, + questRewards, + this.questConfig.redeemTime + ); failedQuestResponse.profileChanges[sessionID].quests = this.failedUnlocked(failRequest.qid, sessionID);