Cost Value - Dungeons-of-Kathallion/Bane-Of-Wargs GitHub Wiki

Introduction

What is called a 'Cost Value' is a floating number, which will be used to modify the cost of an item for example, in order to make buying stuff more interesting and it makes items more valuable depending on the place of the map. Note that on map zones, the base price of an item can also be modified by the dropoff discount if the current map zone is having a sales discount.

Explanation

Here, we'll take this item as an example:

Old Rusted Dagger:
  display name: "Old Rusted Dagger"
  upgrade tier: 0
  type: "Weapon"
  damage: 3
  defend: 2
  agility: .09
  gold: 3.56
  critical hit chance: .06
  description: "An old rusted dagger."

As you can see, this item has a value of 3.56 gold. As said sooner, the goal of a cost value is to modify an item, drink etc... gold value. We could display that as a math function:

f(gold; costvalue) = gold * costvalue 

If we choose to apply a cost value of for example 1.3 to the item gold:

f(3.56; 1.3) = 3.56 * 1.3
             = 4.628
             ≈ 4.63

Note that the game always round gold values to 2 digits after the period. Also note that the cost value apply to both buy and sell gold.


Also note that the more an item as a base value that is high, the more the cost value will affects the output price.

image

In this graph, the cost value is represented by the X value. You can see 3 items: one with a base value of 3.56, one with a base value of 7.56 and one with a base value of 29.8. As you can see, the more the base cost is high, the more the cost value affects the output price.

Where It's Used

Cost values can be defined in map zones or NPCS, anywhere you can buy/sell stuff. The cost value will be applied to items, drinks and mounts.