diff --git a/project/src/helpers/DialogueHelper.ts b/project/src/helpers/DialogueHelper.ts index 4e2a7bfb..a656ed47 100644 --- a/project/src/helpers/DialogueHelper.ts +++ b/project/src/helpers/DialogueHelper.ts @@ -51,7 +51,7 @@ export class DialogueHelper * @param sessionID * @param rewards */ - public addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards: Item[] = []): void + public addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards: Item[] = [], messageType = MessageType.NPC_TRADER): void { const dialogueData = this.saveServer.getProfile(sessionID).dialogues; const isNewDialogue = !(dialogueID in dialogueData); @@ -61,7 +61,7 @@ export class DialogueHelper { dialogue = { _id: dialogueID, - type: MessageType.NPC_TRADER, + type: messageType, messages: [], pinned: false, new: 0, diff --git a/project/src/services/GiftService.ts b/project/src/services/GiftService.ts index dd0d0a32..bcceca43 100644 --- a/project/src/services/GiftService.ts +++ b/project/src/services/GiftService.ts @@ -1,6 +1,7 @@ import { inject, injectable } from "tsyringe"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { MessageType } from "../models/enums/MessageType"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -25,6 +26,12 @@ export class GiftService */ public sendGiftToPlayer(playerId: string, giftId: string): void { - return; + //TODO: get gift items + const giftItems = []; + const maxStoreTime = 999999; + + const messageContent = this.dialogueHelper.createMessageContext(null, MessageType.SYSTEM_MESSAGE, maxStoreTime); + + this.dialogueHelper.addDialogueMessage("traderId", messageContent, playerId, giftItems, MessageType.SYSTEM_MESSAGE); } } \ No newline at end of file