falltergeist icon indicating copy to clipboard operation
falltergeist copied to clipboard

Barter formula

Open JanSimek opened this issue 6 years ago • 1 comments

Implement formula for calculating barter prices to match the vanilla engine.

NovaRain came up with the following pseudo-code for FO2:

Master_Trader = 0.0;
if (player_has_master_trader) Master_Trader = 25.0;

barter_mod = script_modifier + reaction_modifier; // reaction_modifier is -15/0/25 for good/neutral/bad.
barter_percent = (barter_mod + 100.0 - Master_Trader) * 0.01;

if (barter_percent < 0.0) barter_percent = 0.0099999998;

barter_ratio = [(trader_barter_skill + 160.0) / (highest_barter_skill_in_party + 160.0)] * 2.0;

total_price = caps_total + item_total_cost_without_caps * barter_ratio * barter_percent;

JanSimek avatar Sep 24 '19 09:09 JanSimek

There seems to be a mistake. 2019-10-24_05-10-42

FakelsHub avatar Oct 24 '19 02:10 FakelsHub