[Package Index | Mudlib Index | Effect Index]
Factors of relevance:
int bargain_factor(object keeper,
object customer)
int insult_factor(object keeper,
object customer)
int * sell_haggle(int value,
int offer,
int asking,
int insults,
string place,
object keeper,
object customer)
if offer > asking then give back a boggle response else if offer == asking then sell the thing and give an accepted saying else if offer * insult_factor > asking * 100 then adjustment = ( ( asking - offer ) * bargain_factor ) / 100 asking -= adjustment return an adjustment message else return an insulted message endifThe return from this function is an array of three elements, the first is the a flag saying if the item was accepted or not, the second is the current asking price and the last is the current insult level.
({
flag (0/1), // This is 0 if unable to sell, 1 if sold
asking, // the current asking price
insults, // the current insult level
})