Skip to content

Barter formula #580

@JanSimek

Description

@JanSimek

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;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions