using System.Text.Json.Serialization; using SPTarkov.Server.Core.Models.Common; namespace SPTarkov.Server.Core.Models.Spt.Config; public record RagfairConfig : BaseConfig { [JsonPropertyName("kind")] public override string Kind { get; set; } = "spt-ragfair"; /// /// How many seconds should pass before expired offers and processed + player offers checked if sold /// [JsonPropertyName("runIntervalSeconds")] public int RunIntervalSeconds { get; set; } /// /// Default values used to hydrate `runIntervalSeconds` with /// [JsonPropertyName("runIntervalValues")] public required RunIntervalValues RunIntervalValues { get; set; } /// /// Player listing settings /// [JsonPropertyName("sell")] public required Sell Sell { get; set; } /// /// Trader ids + should their assorts be listed on flea /// [JsonPropertyName("traders")] public required Dictionary Traders { get; set; } [JsonPropertyName("dynamic")] public required Dynamic Dynamic { get; set; } [JsonPropertyName("tieredFlea")] public required TieredFlea TieredFlea { get; set; } } public record Sell { /// /// Should a fee be deducted from player when listing an item for sale /// [JsonPropertyName("fees")] public bool Fees { get; set; } /// /// Settings to control chances of offer being sold /// [JsonPropertyName("chance")] public required Chance Chance { get; set; } /// /// Settings to control how long it takes for a player offer to sell /// [JsonPropertyName("time")] public required MinMax Time { get; set; } /// /// Seconds from clicking remove to remove offer from market /// [JsonPropertyName("expireSeconds")] public int ExpireSeconds { get; set; } } public record Chance { /// /// Base chance percent to sell an item /// [JsonPropertyName("base")] public int Base { get; set; } /// /// Value to multiply the sell chance by /// [JsonPropertyName("sellMultiplier")] public double SellMultiplier { get; set; } /// /// Max possible sell chance % for a player listed offer /// [JsonPropertyName("maxSellChancePercent")] public int MaxSellChancePercent { get; set; } /// /// Min possible sell chance % for a player listed offer /// [JsonPropertyName("minSellChancePercent")] public int MinSellChancePercent { get; set; } } public record Dynamic { /// /// Should a purchased dynamic offers items be flagged as found in raid /// [JsonPropertyName("purchasesAreFoundInRaid")] public bool PurchasesAreFoundInRaid { get; set; } /// /// Use the highest trader price for an offer if its greater than the price in templates/prices.json /// [JsonPropertyName("useTraderPriceForOffersIfHigher")] public bool UseTraderPriceForOffersIfHigher { get; set; } /// /// Barter offer specific settings /// [JsonPropertyName("barter")] public required BarterDetails Barter { get; set; } [JsonPropertyName("pack")] public required PackDetails Pack { get; set; } /// /// Dynamic offer price below handbook adjustment values /// [JsonPropertyName("offerAdjustment")] public required OfferAdjustment OfferAdjustment { get; set; } /// /// How many offers should expire before an offer regeneration occurs /// [JsonPropertyName("expiredOfferThreshold")] public int ExpiredOfferThreshold { get; set; } /// /// How many offers should be listed /// key can be mongoId or "default" /// [JsonPropertyName("offerItemCount")] public required Dictionary> OfferItemCount { get; set; } /// /// How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) /// [JsonPropertyName("priceRanges")] public required PriceRanges PriceRanges { get; set; } /// /// Should default presets to listed only or should non-standard presets found in globals.json be listed too /// [JsonPropertyName("showDefaultPresetsOnly")] public bool ShowDefaultPresetsOnly { get; set; } /// /// Tpls that should not use the variable price system when their quality is less than 100% (lower dura/uses = lower price) /// [JsonPropertyName("ignoreQualityPriceVarianceBlacklist")] public required HashSet IgnoreQualityPriceVarianceBlacklist { get; set; } [JsonPropertyName("endTimeSeconds")] public required MinMax EndTimeSeconds { get; set; } /// /// Settings to control the durability range of item items listed on flea /// [JsonPropertyName("condition")] public required Dictionary Condition { get; set; } /// /// Size stackable items should be listed for in percent of max stack size /// [JsonPropertyName("stackablePercent")] public required MinMax StackablePercent { get; set; } /// /// Items that cannot be stacked can have multiples sold in one offer, what range of values can be listed /// [JsonPropertyName("nonStackableCount")] public required MinMax NonStackableCount { get; set; } /// /// Range of rating offers for items being listed /// [JsonPropertyName("rating")] public required MinMax Rating { get; set; } /// /// Armor specific flea settings /// [JsonPropertyName("armor")] public required ArmorSettings Armor { get; set; } /// /// A multiplier to apply to individual tpls price just prior to item quality adjustment /// [JsonPropertyName("itemPriceMultiplier")] public Dictionary? ItemPriceMultiplier { get; set; } /// /// Percentage chance for offers to be listed in specified currency /// [JsonPropertyName("offerCurrencyChancePercent")] public required Dictionary OfferCurrencyChangePercent { get; set; } /// /// Item tpls that should be forced to sell as a single item /// [JsonPropertyName("showAsSingleStack")] public required HashSet ShowAsSingleStack { get; set; } /// /// Should christmas/halloween items be removed from flea when not within the seasonal bounds /// [JsonPropertyName("removeSeasonalItemsWhenNotInEvent")] public bool RemoveSeasonalItemsWhenNotInEvent { get; set; } /// /// Flea blacklist settings /// [JsonPropertyName("blacklist")] public required RagfairBlacklist Blacklist { get; set; } /// /// Dict of price limits keyed by item type /// [JsonPropertyName("unreasonableModPrices")] public required Dictionary UnreasonableModPrices { get; set; } /// /// Custom rouble prices for items to override values from prices.json /// [JsonPropertyName("itemPriceOverrideRouble")] public required Dictionary ItemPriceOverrideRouble { get; set; } [JsonPropertyName("generateBaseFleaPrices")] public GenerateFleaPrices GenerateBaseFleaPrices { get; set; } } public record GenerateFleaPrices { /// /// Should handbook prices be used (true) as a base or the values already in prices.json (false) /// [JsonPropertyName("useHandbookPrice")] public bool UseHandbookPrice { get; set; } /// /// Multiplier to apply to handbook price /// [JsonPropertyName("priceMultiplier")] public double PriceMultiplier { get; set; } /// /// Don't allow prices being added that are below sell to trader price. Prevent ability to buy cheap items on flea and sell to traders for easy rep /// [JsonPropertyName("preventPriceBeingBelowTraderBuyPrice")] public bool PreventPriceBeingBelowTraderBuyPrice { get; set; } [JsonPropertyName("itemTplMultiplierOverride")] public Dictionary ItemTplMultiplierOverride { get; set; } [JsonPropertyName("itemTypeMultiplierOverride")] public Dictionary ItemTypeMultiplierOverride { get; set; } [JsonPropertyName("useHideoutCraftMultiplier")] public bool UseHideoutCraftMultiplier { get; set; } [JsonPropertyName("hideoutCraftMultiplier")] public double HideoutCraftMultiplier { get; set; } } public record PriceRanges { [JsonPropertyName("default")] public required MinMax Default { get; set; } [JsonPropertyName("preset")] public required MinMax Preset { get; set; } [JsonPropertyName("pack")] public required MinMax Pack { get; set; } } public record BarterDetails { /// /// Percentage change an offer is listed as a barter /// [JsonPropertyName("chancePercent")] public double ChancePercent { get; set; } /// /// Min number of required items for a barter requirement /// [JsonPropertyName("itemCountMin")] public int ItemCountMin { get; set; } /// /// Max number of required items for a barter requirement /// [JsonPropertyName("itemCountMax")] public int ItemCountMax { get; set; } /// /// How much can the total price of requested items vary from the item offered /// [JsonPropertyName("priceRangeVariancePercent")] public double PriceRangeVariancePercent { get; set; } /// /// Min rouble price for an offer to be considered for turning into a barter /// [JsonPropertyName("minRoubleCostToBecomeBarter")] public double MinRoubleCostToBecomeBarter { get; set; } /// /// Should barter offers only single stack /// [JsonPropertyName("makeSingleStackOnly")] public bool MakeSingleStackOnly { get; set; } /// /// Item Tpls to never be turned into a barter /// [JsonPropertyName("itemTypeBlacklist")] public required HashSet ItemTypeBlacklist { get; set; } } public record PackDetails { /// /// Percentage change an offer is listed as a pack /// [JsonPropertyName("chancePercent")] public double ChancePercent { get; set; } /// /// Min number of required items for a pack /// [JsonPropertyName("itemCountMin")] public int ItemCountMin { get; set; } /// /// Max number of required items for a pack /// [JsonPropertyName("itemCountMax")] public int ItemCountMax { get; set; } /// /// item types to allow being a pack /// [JsonPropertyName("itemTypeWhitelist")] public required HashSet ItemTypeWhitelist { get; set; } } public record OfferAdjustment { /// /// Shuld offer price be adjusted when below handbook price /// [JsonPropertyName("adjustPriceWhenBelowHandbookPrice")] public bool AdjustPriceWhenBelowHandbookPrice { get; set; } /// /// How big a percentage difference does price need to vary from handbook to be considered for adjustment /// [JsonPropertyName("maxPriceDifferenceBelowHandbookPercent")] public double MaxPriceDifferenceBelowHandbookPercent { get; set; } /// /// How much to multiply the handbook price to get the new price /// [JsonPropertyName("handbookPriceMultiplier")] public double HandbookPriceMultiplier { get; set; } /// /// What is the minimum rouble price to consider adjusting price of item /// [JsonPropertyName("priceThresholdRub")] public double PriceThresholdRub { get; set; } } public record Condition { /// /// Percentage change durability is altered /// [JsonPropertyName("conditionChance")] public double ConditionChance { get; set; } [JsonPropertyName("current")] public required MinMax Current { get; set; } [JsonPropertyName("max")] public required MinMax Max { get; set; } [JsonPropertyName("_name")] public string? Name { get; set; } } public record RagfairBlacklist { /// /// Damaged ammo packs /// [JsonPropertyName("damagedAmmoPacks")] public bool DamagedAmmoPacks { get; set; } /// /// Custom blacklist for item Tpls /// [JsonPropertyName("custom")] public required HashSet Custom { get; set; } /// /// BSG blacklist a large number of items from flea, true = use blacklist /// [JsonPropertyName("enableBsgList")] public bool EnableBsgList { get; set; } /// /// Should quest items be blacklisted from flea /// [JsonPropertyName("enableQuestList")] public bool EnableQuestList { get; set; } /// /// Should trader items that are blacklisted by bsg be listed on flea /// [JsonPropertyName("traderItems")] public bool TraderItems { get; set; } /// /// Maximum level an armor plate can be found in a flea-listed armor item /// [JsonPropertyName("armorPlate")] public required ArmorPlateBlacklistSettings ArmorPlate { get; set; } /// /// Should specific categories be blacklisted from the flea, true = use blacklist /// [JsonPropertyName("enableCustomItemCategoryList")] public bool EnableCustomItemCategoryList { get; set; } /// /// Custom category blacklist for parent Ids /// [JsonPropertyName("customItemCategoryList")] public required HashSet CustomItemCategoryList { get; set; } } public record ArmorPlateBlacklistSettings { /// /// Max level of plates an armor can have without being removed /// [JsonPropertyName("maxProtectionLevel")] public int MaxProtectionLevel { get; set; } /// /// Item slots to NOT remove from items on flea /// [JsonPropertyName("ignoreSlots")] public required HashSet IgnoreSlots { get; set; } } public record UnreasonableModPrices { /// /// Enable a system that adjusts very high ragfair prices to be below a max multiple of items the handbook values /// [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// /// Multiplier to start adjusting item values from, e.g. a value of 10 means any value over 10x the handbook price gets adjusted /// [JsonPropertyName("handbookPriceOverMultiplier")] public int HandbookPriceOverMultiplier { get; set; } /// /// The new multiplier for items found using above property, e.g. a value of 4 means set items price to 4x handbook price /// [JsonPropertyName("newPriceHandbookMultiplier")] public int NewPriceHandbookMultiplier { get; set; } [JsonPropertyName("itemType")] public string? ItemType { get; set; } } public record ArmorSettings { /// /// % chance / 100 that armor plates will be removed from an offer before listing /// [JsonPropertyName("removeRemovablePlateChance")] public int RemoveRemovablePlateChance { get; set; } /// /// What slots are to be removed when removeRemovablePlateChance is true /// [JsonPropertyName("plateSlotIdToRemovePool")] public HashSet PlateSlotIdToRemovePool { get; set; } } public record TieredFlea { [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// /// key: tpl, value: playerlevel /// [JsonPropertyName("unlocksTpl")] public required Dictionary UnlocksTpl { get; set; } /// /// key: item type id, value: playerlevel /// [JsonPropertyName("unlocksType")] public required Dictionary UnlocksType { get; set; } [JsonPropertyName("ammoTplUnlocks")] public Dictionary? AmmoTplUnlocks { get; set; } [JsonPropertyName("ammoTiersEnabled")] public bool AmmoTiersEnabled { get; set; } }