0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Improvemetns to seasonal event system

Extended christmas event to 7th of january

new years event has christmas event actions

Moved seasonal code into functions

Added more seasonal settings for events
This commit is contained in:
Chomp 2025-01-01 14:37:11 +00:00
parent 1d71930a48
commit a0a9fcacb9
3 changed files with 94 additions and 33 deletions

View File

@ -8361,6 +8361,7 @@
"endDay": "31",
"endMonth": "12",
"settings": {
"enableChristmasHideout": true,
"enableSanta": true,
"adjustBotAppearances": true
}
@ -8371,8 +8372,27 @@
"type": "NEWYEARS",
"startDay": "1",
"startMonth": "1",
"endDay": "1",
"endMonth": "1",
"settings": {
"enableChristmasHideout": true,
"enableSanta": true,
"adjustBotAppearances": true
}
},
{
"enabled": true,
"name": "christmas January",
"type": "CHRISTMAS",
"startDay": "2",
"startMonth": "1",
"endDay": "7",
"endMonth": "1"
"endMonth": "1",
"settings": {
"enableChristmasHideout": true,
"enableSanta": true,
"adjustBotAppearances": true
}
},
{
"enabled": true,

View File

@ -30,7 +30,7 @@ export interface ISeasonalEvent {
startMonth: number;
endDay: number;
endMonth: number;
settings?: Record<string, ISeasonalEventSettings>;
settings?: Record<string, ISeasonalEventSettings | IZombieSettings>;
}
export interface ISeasonalEventSettings {

View File

@ -404,41 +404,14 @@ export class SeasonalEventService {
switch (event.type.toLowerCase()) {
case SeasonalEventType.HALLOWEEN.toLowerCase():
globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None");
globalConfig.EventType.push("Halloween");
globalConfig.EventType.push("HalloweenIllumination");
globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween";
this.addEventGearToBots(event.type);
this.adjustZryachiyMeleeChance();
if (event.settings?.enableSummoning) {
this.enableHalloweenSummonEvent();
this.addEventBossesToMaps("halloweensummon");
}
if (event.settings?.zombieSettings?.enabled) {
this.configureZombies(event.settings?.zombieSettings);
}
if (event.settings?.removeEntryRequirement) {
this.removeEntryRequirement(event.settings.removeEntryRequirement);
}
if (event.settings?.replaceBotHostility) {
this.replaceBotHostility(this.seasonalEventConfig.hostilitySettingsForEvent.zombies);
}
this.addPumpkinsToScavBackpacks();
this.adjustTraderIcons(event.type);
this.applyHalloweenEvent(event, globalConfig);
break;
case SeasonalEventType.CHRISTMAS.toLowerCase():
globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None");
globalConfig.EventType.push("Christmas");
this.addEventGearToBots(event.type);
this.addEventLootToBots(event.type);
if (event.settings?.enableSanta) {
this.addGifterBotToMaps();
this.addLootItemsToGifterDropItemsList();
}
this.enableDancingTree();
this.adjustBotAppearanceValues(event.type);
this.applyChristmasEvent(event, globalConfig);
break;
case SeasonalEventType.NEW_YEARS.toLowerCase():
this.applyNewYearsEvent(event, globalConfig);
break;
case SeasonalEventType.APRIL_FOOLS.toLowerCase():
this.addGifterBotToMaps();
@ -459,6 +432,74 @@ export class SeasonalEventService {
}
}
protected applyHalloweenEvent(event: ISeasonalEvent, globalConfig: IConfig) {
globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None");
globalConfig.EventType.push("Halloween");
globalConfig.EventType.push("HalloweenIllumination");
globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween";
this.addEventGearToBots(event.type);
this.adjustZryachiyMeleeChance();
if (event.settings?.enableSummoning) {
this.enableHalloweenSummonEvent();
this.addEventBossesToMaps("halloweensummon");
}
if (event.settings?.zombieSettings?.enabled) {
this.configureZombies(event.settings.zombieSettings);
}
if (event.settings?.removeEntryRequirement) {
this.removeEntryRequirement(event.settings.removeEntryRequirement);
}
if (event.settings?.replaceBotHostility) {
this.replaceBotHostility(this.seasonalEventConfig.hostilitySettingsForEvent.zombies);
}
if (event.settings?.adjustBotAppearances) {
this.adjustBotAppearanceValues(event.type);
}
this.addPumpkinsToScavBackpacks();
this.adjustTraderIcons(event.type);
}
protected applyChristmasEvent(event: ISeasonalEvent, globalConfig: IConfig) {
if (event.settings?.enableChristmasHideout) {
globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None");
globalConfig.EventType.push("Christmas");
}
this.addEventGearToBots(event.type);
this.addEventLootToBots(event.type);
if (event.settings?.enableSanta) {
this.addGifterBotToMaps();
this.addLootItemsToGifterDropItemsList();
}
this.enableDancingTree();
if (event.settings?.adjustBotAppearances) {
this.adjustBotAppearanceValues(event.type);
}
}
protected applyNewYearsEvent(event: ISeasonalEvent, globalConfig: IConfig) {
if (event.settings?.enableChristmasHideout) {
globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None");
globalConfig.EventType.push("Christmas");
}
this.addEventGearToBots(SeasonalEventType.CHRISTMAS);
this.addEventLootToBots(SeasonalEventType.CHRISTMAS);
if (event.settings?.enableSanta) {
this.addGifterBotToMaps();
this.addLootItemsToGifterDropItemsList();
}
this.enableDancingTree();
if (event.settings?.adjustBotAppearances) {
this.adjustBotAppearanceValues(SeasonalEventType.CHRISTMAS);
}
}
protected adjustBotAppearanceValues(season: SeasonalEventType): void {
const adjustments = this.seasonalEventConfig.botAppearanceChanges[season];
if (!adjustments) {