Added spt friend code VERYSPOOKY
to enable halloween/zombies
This commit is contained in:
parent
6ab1309ce6
commit
ef7ed5870a
@ -6,11 +6,13 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { GiftSentResult } from "@spt/models/enums/GiftSentResult";
|
||||
import { MemberCategory } from "@spt/models/enums/MemberCategory";
|
||||
import { Season } from "@spt/models/enums/Season";
|
||||
import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType";
|
||||
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 { MailSendService } from "@spt/services/MailSendService";
|
||||
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
@ -23,6 +25,7 @@ export class SptDialogueChatBot implements IDialogueChatBot {
|
||||
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
|
||||
@inject("RandomUtil") protected randomUtil: RandomUtil,
|
||||
@inject("MailSendService") protected mailSendService: MailSendService,
|
||||
@inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService,
|
||||
@inject("GiftService") protected giftService: GiftService,
|
||||
@inject("ConfigServer") protected configServer: ConfigServer,
|
||||
) {
|
||||
@ -156,6 +159,19 @@ export class SptDialogueChatBot implements IDialogueChatBot {
|
||||
);
|
||||
}
|
||||
|
||||
if (requestInput === "veryspooky") {
|
||||
const enableEventResult = this.seasonalEventService.forceSeasonalEvent(SeasonalEventType.HALLOWEEN);
|
||||
if (enableEventResult) {
|
||||
this.mailSendService.sendUserMessageToPlayer(
|
||||
sessionId,
|
||||
sptFriendUser,
|
||||
this.randomUtil.getArrayValue([
|
||||
"Halloween event has been enabled, restart your game client before starting a raid",
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (requestInput === "givemespace") {
|
||||
const stashRowGiftId = "StashRows";
|
||||
const maxGiftsToSendCount = this.coreConfig.features.chatbotFeatures.commandUseLimits[stashRowGiftId] ?? 5;
|
||||
|
@ -211,6 +211,17 @@ export class SeasonalEventService {
|
||||
}
|
||||
}
|
||||
|
||||
public forceSeasonalEvent(eventType: SeasonalEventType): boolean {
|
||||
const globalConfig = this.databaseService.getGlobals().config;
|
||||
const event = this.seasonalEventConfig.events.find((event) => SeasonalEventType[event.type] === eventType);
|
||||
if (!event) {
|
||||
return false;
|
||||
}
|
||||
this.updateGlobalEvents(globalConfig, event);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store active events inside class array property `currentlyActiveEvents` + set class properties: christmasEventActive/halloweenEventActive
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user