Research:Trading and Services

Barter function
All bartering and services use a common function to evaluate costs. Uses common formula fatigueTerm for each side of a transaction.

Trainers
Standard Morrowind uses the current skill value, including fortifies and drains, which allows cheap training exploits with drain spells. A new implementation should use the skill's base value.

Comments
Multiple enchantments stack in a expensive manner, as both variables y and enchantPoints are accumulators. Strangely, the price is based on the equivalent to the spellmaking accumulator rather than the enchantment points used. Constant effect enchantments override the duration in an over-complicated manner. As fEnchantmentConstantDurationMult is 100 by default, it would be much cleaner to use that for duration in both cases.

Comments
NPCs currently following the player and currently in range when the player selects the Travel option will come with. Travel costs are actually scaled (multiplied) according to the number of passengers taken, however, there seems to be a bug where the first follower is ignored (or free): the price will only increase if the player has more than one follower. So if the player has 4 followers in range, he will pay quadruple the price he would pay alone (or with a single follower), rather than 5x the price (for 5 passengers total). The same likely applies to creatures that are following, but that needs confirmation.