Added ability to disable access requirements for event

This commit is contained in:
Dev 2024-11-01 20:25:18 +00:00
parent 42e72c38b0
commit abc317b862
2 changed files with 26 additions and 1 deletions

View File

@ -1306,6 +1306,7 @@
"endMonth": "11",
"settings": {
"enableSummoning": false,
"removeEntryRequirement": ["laboratory"],
"zombieSettings": {
"enabled": true,
"mapInfectionAmount": {
@ -1346,7 +1347,20 @@
"startDay": "1",
"startMonth": "4",
"endDay": "2",
"endMonth": "4"
"endMonth": "4",
"setting": {
"removeEntryRequirement": ["laboratory"],
"zombieSettings": {
"enabled": true,
"mapInfectionAmount": {
"laboratory": 100
},
"disableBosses": [
"laboratory"
],
"disableWaves": []
}
}
}
]
}

View File

@ -355,6 +355,9 @@ export class SeasonalEventService {
if (event.settings?.zombieSettings?.enabled) {
this.configureZombies(event.settings?.zombieSettings);
}
if (event.settings.removeEntryRequirement) {
this.removeEntryRequirement(event.settings.removeEntryRequirement);
}
this.addPumpkinsToScavBackpacks();
this.adjustTraderIcons(event.type);
break;
@ -395,6 +398,14 @@ export class SeasonalEventService {
}
}
protected removeEntryRequirement(locationIds: string[]) {
for (const locationId of locationIds) {
const location = this.databaseService.getLocation(locationId);
location.base.AccessKeys = [];
location.base.AccessKeysPvE = [];
}
}
public givePlayerSeasonalGifts(sessionId: string): void {
if (this.currentlyActiveEvents) {
const globalConfig = this.databaseService.getGlobals().config;