One way of doing this is have your bartering ability tied to a character attribute.
Then, you could decide on the transaction factor against the canonical price of the item.
For example, When buying items, the canonical price is divided by the transaction factor, and when selling item, it is multiplied.
One way to work out the transaction would be the ratio of the Merchant's bartering skills against the players.
Gwendoline has 'bartering' @ lvl 60
Merchant has 'bartering' @ lvl 30
'Sword of unholy truth' has canonical value 100 gold pieces
transaction factor is 60/30 = 2.0
Gwendoline can buy 'Sword of unholy truth' for 50 gold pieces.
Gwendoline can sell 'Sword of unholy truth' for 200 gold pieces.
Now, with the relative skills reversed:
Tristan has 'bartering' @ lvl 10
Merchant has 'bartering' @ lvl 50
'Chalice of Good Times' has canonical value 100 gold pieces
transaction factor is 10/50 = 0.2
Tristan can buy 'Sword of unholy truth' for 500 gold pieces.
Tristan can sell 'Sword of unholy truth' for 20 gold pieces.
Morrowing, Oblivion and Skyrim have a similar system, although they add several twists:
- Letting the player choose the transaction factor
- Have the merchant accept or refuse the player offer based on skills, luck and how much the merchant likes the player (the merchant's disposition towards the player)
- Every refused offer reduces the Merchant's disposition towards the player, making bartering harder.
In order to show how good/bad a deal is, you can simply display the canonical price, so that the player knows how much they've been had.
You probably don't want the players to do any math, so it would probably be best to use a traffic light system, that shows red when it's a bad deal, amber when the deal is OK, and green when you're making lots of money.
Some other twists you can have:
- Have Merchants that have better deals for some merchandise than others. This could be implemented by having the merchant skill be item-type specific. For example, it should be easy to swindle a potion merchant into buying a sword at more than fair value, but much harder to pull the same deal with an armourer.
- Don't show the players their bartering skill score, but instead increase it slightly with every transaction they make and have the score reflected in the dialogue of the merchant:
- You're eating me out of house and home! (high player skill)
- You drive a hard bargain!
- I think I gave you a fair price, don't you?
- Please come again soon
- It was such a pleasure doing business with you (low player skill)