fix prices

master
Denis Ranneft 1 month ago
parent f593691e45
commit e5336d313f

@ -1,5 +1,16 @@
{
"releases": [
{
"version": "0.3.1-dev",
"title": "AutoHero — 0.3.1",
"items": [
"Graphics optimization! We've found a bastard. Minimap was causing huge recalc.",
"Auto potions (now hero will use them even in the online battle",
"Formulae for atk reworked",
"Reduced merchant and monster meet chance",
"Something else"
]
},
{
"version": "0.3.0-dev",
"title": "AutoHero — 0.3.0",

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

@ -962,7 +962,7 @@ func (h *NPCHandler) MerchantStock(w http.ResponseWriter, r *http.Request) {
townLv := game.TownEffectiveLevel(town)
n := tuning.EffectiveMerchantTownStockCount()
slots := model.GearVendorSlots(npc.Type)
items := game.RollTownMerchantStockItemsForSlots(townLv, n, slots)
items := game.RollTownMerchantStockItemsForSlots(int(float64(hero.Level) * float64(1 + hero.Level / townLv)), n, slots)
costs := make([]int64, len(items))
for i, it := range items {
if it == nil {

Loading…
Cancel
Save