diff --git a/project/assets/database/locales/server/en.json b/project/assets/database/locales/server/en.json index 03c9e725..f9fc378f 100644 --- a/project/assets/database/locales/server/en.json +++ b/project/assets/database/locales/server/en.json @@ -723,5 +723,9 @@ "websocket-player_connected": "[WS] Player: %s has connected", "websocket-received_message": "[WS] Received message from user %s ", "websocket-socket_lost_deleting_handle": "[WS] Socket lost, deleting handle", - "websocket-started": "Started websocket at %s" + "websocket-started": "Started websocket at %s", + "chatbot-cannot_accept_any_more_of_gift": "You cannot accept any more of this gift", + "chatbot-halloween_event_enabled": "Halloween event has been enabled, restart your game client before starting a raid", + "chatbot-added_stash_rows_please_restart": "Added 2 rows to stash, please restart your game to see them", + "chatbot-snow_enabled": "Snow is enabled for all subsequent raids until the server is restarted" } diff --git a/project/src/helpers/Dialogue/SptDialogueChatBot.ts b/project/src/helpers/Dialogue/SptDialogueChatBot.ts index 35c3bfdb..ed75c20e 100644 --- a/project/src/helpers/Dialogue/SptDialogueChatBot.ts +++ b/project/src/helpers/Dialogue/SptDialogueChatBot.ts @@ -11,6 +11,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { GiftService } from "@spt/services/GiftService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -26,6 +27,7 @@ export class SptDialogueChatBot implements IDialogueChatBot { @inject("RandomUtil") protected randomUtil: RandomUtil, @inject("MailSendService") protected mailSendService: MailSendService, @inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService, + @inject("LocalisationService") protected localisationService: LocalisationService, @inject("GiftService") protected giftService: GiftService, @inject("ConfigServer") protected configServer: ConfigServer, ) { @@ -109,6 +111,14 @@ export class SptDialogueChatBot implements IDialogueChatBot { ); } + if (requestInput === "fish") { + this.mailSendService.sendUserMessageToPlayer( + sessionId, + sptFriendUser, + this.randomUtil.getArrayValue(["blub"]), + ); + } + if (["hello", "hi", "sup", "yo", "hey"].includes(requestInput)) { this.mailSendService.sendUserMessageToPlayer( sessionId, @@ -155,7 +165,7 @@ export class SptDialogueChatBot implements IDialogueChatBot { this.mailSendService.sendUserMessageToPlayer( sessionId, sptFriendUser, - this.randomUtil.getArrayValue(["Snow will be enabled after your next raid"]), + this.randomUtil.getArrayValue([this.localisationService.getText("chatbot-snow_enabled")]), ); } @@ -166,7 +176,7 @@ export class SptDialogueChatBot implements IDialogueChatBot { sessionId, sptFriendUser, this.randomUtil.getArrayValue([ - "Halloween event has been enabled, restart your game client before starting a raid", + this.localisationService.getText("chatbot-halloween_event_enabled"), ]), ); } @@ -179,7 +189,7 @@ export class SptDialogueChatBot implements IDialogueChatBot { this.mailSendService.sendUserMessageToPlayer( sessionId, sptFriendUser, - "You cannot accept any more of this gift", + this.localisationService.getText("chatbot-cannot_accept_any_more_of_gift"), ); } else { this.profileHelper.addStashRowsBonusToProfile(sessionId, 2); @@ -187,7 +197,9 @@ export class SptDialogueChatBot implements IDialogueChatBot { this.mailSendService.sendUserMessageToPlayer( sessionId, sptFriendUser, - this.randomUtil.getArrayValue(["Added 2 rows to stash, please restart your game to see them"]), + this.randomUtil.getArrayValue([ + this.localisationService.getText("chatbot-added_stash_rows_please_restart"), + ]), ); this.profileHelper.flagGiftReceivedInProfile(sessionId, stashRowGiftId, maxGiftsToSendCount);