Stub out more of gift service + allow adjustment of sender for dialogs

This commit is contained in:
Dev 2023-07-20 21:29:27 +01:00
parent 4092ff7c9d
commit a9e6d5d0fe
2 changed files with 10 additions and 3 deletions

View File

@ -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,

View File

@ -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);
}
}