Files
SPT-Server-Build/Libraries/SPTarkov.Server.Core/Models/Spt/Services/LootRequest.cs
T
Jesse 54f0d0779c Convert TemplateItem to MongoId (#436)
* Convert TemplateItem to MongoId

* Push new extensions

* Handle null mongoid's being passed to regex

* Handle null strings, fixes item events

* Updated loot generation to work with new property `composedKey`

Fixed typo in `SlotId`

* Fix missing method after merge

* Remove duplicately named MongoIDExtensions?

* Fixed location loot generation to handle impending loot json changes

* Updated location JSONs with new properties (excluding lighthouse loose loot)

* Fixed build issue with ItemTplGenerator

* use correct handing for new mongo ids

* Added helper method to improve readability

---------

Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
2025-07-02 10:14:04 +01:00

102 lines
3.0 KiB
C#

using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Enums;
namespace SPTarkov.Server.Core.Models.Spt.Services;
public record LootRequest
{
[JsonExtensionData]
public Dictionary<string, object>? ExtensionData { get; set; }
/// <summary>
/// Count of weapons to generate
/// </summary>
[JsonPropertyName("weaponPresetCount")]
public MinMax<int>? WeaponPresetCount { get; set; }
/// <summary>
/// Count of armor to generate
/// </summary>
[JsonPropertyName("armorPresetCount")]
public MinMax<int>? ArmorPresetCount { get; set; }
/// <summary>
/// Count of items to generate
/// </summary>
[JsonPropertyName("itemCount")]
public MinMax<int>? ItemCount { get; set; }
/// <summary>
/// Count of sealed weapon crates to generate
/// </summary>
[JsonPropertyName("weaponCrateCount")]
public MinMax<int>? WeaponCrateCount { get; set; }
/// <summary>
/// Item tpl blacklist to exclude
/// </summary>
[JsonPropertyName("itemBlacklist")]
public HashSet<MongoId>? ItemBlacklist { get; set; }
/// <summary>
/// Item tpl whitelist to pick from
/// </summary>
[JsonPropertyName("itemTypeWhitelist")]
public List<MongoId>? ItemTypeWhitelist { get; set; }
/// <summary>
/// key: item base type: value: max count
/// </summary>
[JsonPropertyName("itemLimits")]
public Dictionary<MongoId, int>? ItemLimits { get; set; }
[JsonPropertyName("itemStackLimits")]
public Dictionary<MongoId, MinMax<int>>? ItemStackLimits { get; set; }
/// <summary>
/// Allowed armor plate levels 2/3/4/5/6 for armor generated
/// </summary>
[JsonPropertyName("armorLevelWhitelist")]
public List<int>? ArmorLevelWhitelist { get; set; }
/// <summary>
/// Should boss items be included in allowed items
/// </summary>
[JsonPropertyName("allowBossItems")]
public bool? AllowBossItems { get; set; }
/// <summary>
/// Should item.json item reward blacklist be used
/// </summary>
[JsonPropertyName("useRewardItemBlacklist")]
public bool? UseRewardItemBlacklist { get; set; }
/// <summary>
/// Should forced loot be used instead of randomised loot
/// </summary>
[JsonPropertyName("useForcedLoot")]
public bool? UseForcedLoot { get; set; }
/// <summary>
/// Item tpls + count of items to force include
/// </summary>
[JsonPropertyName("forcedLoot")]
public Dictionary<string, MinMax<int>>? ForcedLoot { get; set; }
/// <summary>
/// Should seasonal items appear when it's not the season for them
/// </summary>
[JsonPropertyName("blockSeasonalItemsOutOfSeason")]
public bool? BlockSeasonalItemsOutOfSeason { get; set; }
}
public record AirdropLootRequest : LootRequest
{
/// <summary>
/// Airdrop icon used by client to show crate type
/// </summary>
[JsonPropertyName("icon")]
public AirdropTypeEnum? Icon { get; set; }
}