diff --git a/Libraries/Core/Generators/BotGenerator.cs b/Libraries/Core/Generators/BotGenerator.cs index c8133891..a54a006a 100644 --- a/Libraries/Core/Generators/BotGenerator.cs +++ b/Libraries/Core/Generators/BotGenerator.cs @@ -78,7 +78,7 @@ public class BotGenerator( Id = bot.Id, Aid = bot.Aid, SessionId = bot.SessionId, - Savage = bot.Savage, + Savage = null, KarmaValue = bot.KarmaValue, Info = bot.Info, Customization = bot.Customization, @@ -286,7 +286,7 @@ public class BotGenerator( } // Generate new bot ID - AddIdsToBot(bot); + AddIdsToBot(bot, botGenerationDetails); // Generate new inventory ID GenerateInventoryId(bot); @@ -584,7 +584,7 @@ public class BotGenerator( } } }, - UpdateTime = _timeUtil.GetTimeStamp(), + UpdateTime = 0, // 0 for pscav too Immortal = false }; @@ -688,13 +688,14 @@ public class BotGenerator( /// Generate an id+aid for a bot and apply /// /// bot to update + /// /// - public void AddIdsToBot(BotBase bot) + public void AddIdsToBot(BotBase bot, BotGenerationDetails botGenerationDetails) { var botId = _hashUtil.Generate(); bot.Id = botId; - bot.Aid = _hashUtil.GenerateAccountId(); + bot.Aid = botGenerationDetails.IsPmc.GetValueOrDefault(false) ? _hashUtil.GenerateAccountId() : 0; } /// diff --git a/Libraries/Core/Generators/BotInventoryGenerator.cs b/Libraries/Core/Generators/BotInventoryGenerator.cs index a885043c..ada984ef 100644 --- a/Libraries/Core/Generators/BotInventoryGenerator.cs +++ b/Libraries/Core/Generators/BotInventoryGenerator.cs @@ -102,6 +102,7 @@ public class BotInventoryGenerator( var questRaidItemsId = _hashUtil.Generate(); var questStashItemsId = _hashUtil.Generate(); var sortingTableId = _hashUtil.Generate(); + var hideoutCustomizationStashId = _hashUtil.Generate(); return new BotBaseInventory { @@ -111,7 +112,8 @@ public class BotInventoryGenerator( new() { Id = stashId, Template = ItemTpl.STASH_STANDARD_STASH_10X30 }, new() { Id = questRaidItemsId, Template = ItemTpl.STASH_QUESTRAID }, new() { Id = questStashItemsId, Template = ItemTpl.STASH_QUESTOFFLINE }, - new() { Id = sortingTableId, Template = ItemTpl.SORTINGTABLE_SORTING_TABLE } + new() { Id = sortingTableId, Template = ItemTpl.SORTINGTABLE_SORTING_TABLE }, + new() { Id = hideoutCustomizationStashId, Template = ItemTpl.HIDEOUTAREACONTAINER_CUSTOMIZATION } ], Equipment = equipmentId, Stash = stashId, @@ -121,7 +123,7 @@ public class BotInventoryGenerator( HideoutAreaStashes = { }, FastPanel = { }, FavoriteItems = [], - HideoutCustomizationStashId = "", + HideoutCustomizationStashId = hideoutCustomizationStashId, }; } diff --git a/Libraries/Core/Generators/LootGenerator.cs b/Libraries/Core/Generators/LootGenerator.cs index ec2e7bd1..a9af4b6a 100644 --- a/Libraries/Core/Generators/LootGenerator.cs +++ b/Libraries/Core/Generators/LootGenerator.cs @@ -272,7 +272,7 @@ public class LootGenerator( /// item filters /// array to add found item to /// true if item was valid and added to pool - protected bool FindAndAddRandomItemToLoot(TemplateItem[] items, Dictionary itemTypeCounts, + protected bool FindAndAddRandomItemToLoot(List items, Dictionary itemTypeCounts, LootRequest options, List result) { diff --git a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs index d25faf62..4859e38c 100644 --- a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs @@ -21,6 +21,7 @@ public record BotBase [JsonPropertyName("sessionId")] public string? SessionId { get; set; } + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] [JsonPropertyName("savage")] public string? Savage { get; set; } @@ -363,6 +364,9 @@ public record EftStats public OverallCounters? OverallCounters { get; set; } public float? SessionExperienceMult { get; set; } public float? ExperienceBonusMult { get; set; } + + + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public Aggressor? Aggressor { get; set; } public List? DroppedItems { get; set; } public List? FoundInRaidItems { get; set; } @@ -448,6 +452,8 @@ public record Aggressor public record DamageHistory { public string? LethalDamagePart { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public LethalDamage? LethalDamage { get; set; } [JsonConverter(typeof(ArrayToObjectFactoryConverter))]