Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"inraid-unable_to_migrate_pmc_quest_not_found_in_profile": "Unable to migrate post-raid quest: %s data to profile, cannot find quest in profile",
"insurance-item_not_found_in_post_raid_data": "Unable to find insured inventory item with id: %s in post-raid data",
"insurance-missing_insurance_price_multiplier": "No insurance multiplier found for trader: %s, check it exists in InsuranceConfig.js, falling back to default value of: 0.3",
"insurance-trader_missing_return_chance": "Trader is not configured for a return chance: {{traderId}}, falling back to default value of: 75%",
"insurance-post_raid_item_not_found": "Insured item: %s not found in post-raid inventory",
"insurance-pre_raid_item_not_found": "Pre raid inventory item: %s was not found",
"insurance-trader_lacks_dialogue_property": "Trader: %s does not have a dialogue property, unable to send insurance items",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,11 @@ protected void HandleLabyrinthInsurance(Dictionary<string, List<string>?> trader
const int conversionFactor = 100;

var returnChance = randomUtil.GetInt(0, maxRoll) / conversionFactor;
var traderReturnChance = insuranceConfig.ReturnChancePercent[traderId];
if (!insuranceConfig.ReturnChancePercent.TryGetValue(traderId, out var traderReturnChance))
{
logger.Warning(serverLocalisationService.GetText("insurance-trader_missing_return_chance", new { traderId = traderId }));
traderReturnChance = 75;
}
var roll = returnChance >= traderReturnChance;

// Log the roll with as much detail as possible.
Expand Down
Loading