|
|
|
@ -78,15 +78,10 @@ func RollTownMerchantOfferGold(ilvl int, rarity model.Rarity, townLevel int) int
|
|
|
|
perIlvl := tuning.EffectiveMerchantTownGearPricePerIlvl()
|
|
|
|
perIlvl := tuning.EffectiveMerchantTownGearPricePerIlvl()
|
|
|
|
variance := tuning.EffectiveMerchantTownGearPriceVariancePct()
|
|
|
|
variance := tuning.EffectiveMerchantTownGearPriceVariancePct()
|
|
|
|
ilvlPart := float64(ilvl) * float64(perIlvl) * townMerchantRarityPriceMul(rarity)
|
|
|
|
ilvlPart := float64(ilvl) * float64(perIlvl) * townMerchantRarityPriceMul(rarity)
|
|
|
|
curve := float64(ilvl*ilvl) / 6.0
|
|
|
|
mean := float64(anchor) + ilvlPart
|
|
|
|
mean := float64(anchor) + ilvlPart + curve
|
|
|
|
|
|
|
|
if mean < 1 {
|
|
|
|
|
|
|
|
mean = 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
v := float64(variance) / 100.0
|
|
|
|
v := float64(variance) / 100.0
|
|
|
|
if v < 0 {
|
|
|
|
|
|
|
|
v = 0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if v > 0.45 {
|
|
|
|
if v > 0.45 {
|
|
|
|
v = 0.45
|
|
|
|
v = 0.45
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -94,7 +89,7 @@ func RollTownMerchantOfferGold(ilvl int, rarity model.Rarity, townLevel int) int
|
|
|
|
factor := (1.0 - v) + rand.Float64()*(2*v)
|
|
|
|
factor := (1.0 - v) + rand.Float64()*(2*v)
|
|
|
|
cost := int64(mean*factor + 0.5)
|
|
|
|
cost := int64(mean*factor + 0.5)
|
|
|
|
if cost < 1 {
|
|
|
|
if cost < 1 {
|
|
|
|
cost = 1
|
|
|
|
cost = int64(mean)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return cost
|
|
|
|
return cost
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|