Localised some chatbot messages

This commit is contained in:
Dev 2024-11-17 20:57:50 +00:00
parent bbe0de531d
commit 50e79e72b5
2 changed files with 21 additions and 5 deletions

View File

@ -723,5 +723,9 @@
"websocket-player_connected": "[WS] Player: %s has connected", "websocket-player_connected": "[WS] Player: %s has connected",
"websocket-received_message": "[WS] Received message from user %s ", "websocket-received_message": "[WS] Received message from user %s ",
"websocket-socket_lost_deleting_handle": "[WS] Socket lost, deleting handle", "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"
} }

View File

@ -11,6 +11,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { GiftService } from "@spt/services/GiftService"; import { GiftService } from "@spt/services/GiftService";
import { LocalisationService } from "@spt/services/LocalisationService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
@ -26,6 +27,7 @@ export class SptDialogueChatBot implements IDialogueChatBot {
@inject("RandomUtil") protected randomUtil: RandomUtil, @inject("RandomUtil") protected randomUtil: RandomUtil,
@inject("MailSendService") protected mailSendService: MailSendService, @inject("MailSendService") protected mailSendService: MailSendService,
@inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService, @inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService,
@inject("LocalisationService") protected localisationService: LocalisationService,
@inject("GiftService") protected giftService: GiftService, @inject("GiftService") protected giftService: GiftService,
@inject("ConfigServer") protected configServer: ConfigServer, @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)) { if (["hello", "hi", "sup", "yo", "hey"].includes(requestInput)) {
this.mailSendService.sendUserMessageToPlayer( this.mailSendService.sendUserMessageToPlayer(
sessionId, sessionId,
@ -155,7 +165,7 @@ export class SptDialogueChatBot implements IDialogueChatBot {
this.mailSendService.sendUserMessageToPlayer( this.mailSendService.sendUserMessageToPlayer(
sessionId, sessionId,
sptFriendUser, 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, sessionId,
sptFriendUser, sptFriendUser,
this.randomUtil.getArrayValue([ 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( this.mailSendService.sendUserMessageToPlayer(
sessionId, sessionId,
sptFriendUser, sptFriendUser,
"You cannot accept any more of this gift", this.localisationService.getText("chatbot-cannot_accept_any_more_of_gift"),
); );
} else { } else {
this.profileHelper.addStashRowsBonusToProfile(sessionId, 2); this.profileHelper.addStashRowsBonusToProfile(sessionId, 2);
@ -187,7 +197,9 @@ export class SptDialogueChatBot implements IDialogueChatBot {
this.mailSendService.sendUserMessageToPlayer( this.mailSendService.sendUserMessageToPlayer(
sessionId, sessionId,
sptFriendUser, 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); this.profileHelper.flagGiftReceivedInProfile(sessionId, stashRowGiftId, maxGiftsToSendCount);