Added christmas tree to hideout areas on server start via custom area system

This commit is contained in:
Chomp
2025-03-28 17:35:00 +00:00
parent 0938f47a64
commit 09d5776f32
3 changed files with 91 additions and 1 deletions
@@ -0,0 +1,66 @@
[{
"_id": "5df8a81f8f77747fcf5f5702",
"type": 21,
"enabled": true,
"needsFuel": true,
"takeFromSlotLocked": false,
"craftGivesExp": true,
"displayLevel": true,
"requirements": [],
"stages": {
"0": {
"requirements": [],
"bonuses": [],
"slots": 0,
"constructionTime": 0.0,
"description": "",
"container": "",
"autoUpgrade": false,
"displayInterface": true,
"improvements": []
},
"1": {
"requirements": [{
"areaType": 4,
"requiredLevel": 1,
"type": "Area"
}, {
"templateId": "5449016a4bdc2d6f028b456f",
"count": 10000,
"isFunctional": false,
"isEncoded": false,
"type": "Item"
}, {
"templateId": "5df8a77486f77412672a1e3f",
"count": 1,
"isFunctional": false,
"isEncoded": false,
"type": "Item"
}, {
"templateId": "5df8a72c86f77412640e2e83",
"count": 1,
"isFunctional": false,
"isEncoded": false,
"type": "Item"
}, {
"templateId": "5df8a6a186f77412640e2e80",
"count": 1,
"isFunctional": false,
"isEncoded": false,
"type": "Item"
}
],
"bonuses": [],
"slots": 0,
"constructionTime": 0.0,
"description": "",
"container": "",
"autoUpgrade": false,
"displayInterface": true,
"improvements": []
}
},
"enableAreaRequirements": false,
"parentArea": null
}
]
@@ -11,6 +11,12 @@ public record Hideout
get;
set;
}
[JsonPropertyName("customAreas")]
public List<HideoutArea>? CustomAreas
{
get;
set;
}
[JsonPropertyName("customisation")]
public HideoutCustomisation? Customisation
@@ -6,7 +6,6 @@ using SPTarkov.Server.Core.Servers;
using SPTarkov.Server.Core.Utils;
using SPTarkov.Server.Core.Utils.Cloners;
using SPTarkov.Common.Annotations;
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
namespace SPTarkov.Server.Core.Services;
@@ -84,6 +83,8 @@ public class PostDbLoadService(
AdjustLocationBotValues();
MergeCustomHideoutAreas();
if (_locationConfig.RogueLighthouseSpawnTimeSettings.Enabled)
{
FixRoguesSpawningInstantlyOnLighthouse();
@@ -126,6 +127,23 @@ public class PostDbLoadService(
_raidWeatherService.GenerateWeather(currentSeason);
}
private void MergeCustomHideoutAreas()
{
var hideout = _databaseService.GetHideout();
foreach (var customArea in hideout.CustomAreas)
{
// Check if exists
if (hideout.Areas!.Exists(area => area.Id == customArea.Id))
{
_logger.Warning($"Unable to add new hideout area with Id: {customArea.Id} as ID is already in use, skipping");
continue;
}
hideout.Areas.Add(customArea);
}
}
/// <summary>
/// Merge custom achievements into achievement db table
/// </summary>