×
Меню
Индекс
 

iBarterSuccessDisposition

 
iBarterSuccessDisposition - временный модификатор для успешных сделок бартера.
 
Значение по умолчанию: 1
 
Код торговли из OpenMW:
 
all prices are negative when player is buying, positive when player is selling
 
accept if playerOffer <= merchantOffer (same for buy and sell)
if npc is a creature: reject (no haggle)
 
a = abs(merchantOffer)
b = abs(playerOffer)
if buying: d = int(100 * (a - b) / a)
if selling: d = int(100 * (b - a) / b)
 
clampedDisposition = clamp int(npcDisposition) to [0..100]
dispositionTerm = fDispositionMod * (clampedDisposition - 50)
pcTerm = (dispositionTerm + pcMercantile + 0.1 * pcLuck + 0.2 * pcPersonality) * pcFatigueTerm
npcTerm = (npcMercantile + 0.1 * npcLuck + 0.2 * npcPersonality) * npcFatigueTerm
x = fBargainOfferMulti * d + fBargainOfferBase
if buying: x += abs(int(pcTerm - npcTerm))
if selling: x += abs(int(npcTerm - pcTerm))
 
roll 100, if roll <= x then trade is accepted
adjust npc temporary disposition by iBarterSuccessDisposition or iBarterFailDisposition