I was working on a spreadsheet to track magic items today and I had to figure out a formula to convert magic item levels to prices. It was a bit tricky, so I thought I'd share it with you.
First, the formula. "$A1" is the item's level. I'll explain it below.
Now, how it works.
Magic items are divided into "half-tiers." Items of levels 1-5 are in a half-tier, levels 6-10 are in another half-tier, and so forth. We'll number those tiers starting with zero, so levels 1-5 are in tier 0, levels 6-11 are in tier 1, and so on.
There's a big jump in price between half-tiers. Each half-tier has its own "base price," which is the same as the price of the first item in the half-tier. So the base price of half-tier 0 (levels 1-5) is 360 gold, the base price of half-tier 1 (levels 6-11) is 1800 gold, and so on.
Within a tier, the price increases more slowly. It increases differently in each tier, but always by the same amount. For example, in tier 1 (levels 6-10), level 7 items are 800 gold more expensive than level 6 items, and level 8 items are 800 gold more expensive than level 7 items. In tier 0 (levels 1-5), the price increases by 160 gold each time. We'll call this the "per-level increase."
To calculate the price of an item, we need to know the level relative to its tier. We'll count from zero again. For example, a level 6 item is level 0 relative to its tier (which starts at 6), and a level 18 item is level 2 relative to its tier (which starts at 16). This is the "relative level."
Given an item's relative level and how much the price increases every level, it's easy to calculate the price increase within the tier. For example, an item of level 8 is in tier 1, which has a per-level increase of 800. It has a level of 2 relative to its tier (which starts at level 6), so the item is 1600 gold more than a level 6 item. We'll call this the "relative price."
Once we have the relative price, we just add in the base price for the tier, and we're done!
Now, to put it all together...
Simple.
First, the formula. "$A1" is the item's level. I'll explain it below.
Code:
=360*POWER(5,INT((-1)/5))+((360*POWER(5,INT((-1)/5))/2.25)*((MOD(-1,5))))
Magic items are divided into "half-tiers." Items of levels 1-5 are in a half-tier, levels 6-10 are in another half-tier, and so forth. We'll number those tiers starting with zero, so levels 1-5 are in tier 0, levels 6-11 are in tier 1, and so on.
Code:
half_tier = int((level - 1) / 5)
Code:
base_price = 360 * (5 ^ half_tier)
Code:
per_level = base_price / 2.25
Code:
rel_level = (level - 1) % 5
Code:
rel_price = per_level * rel_level
Code:
price = base_price + rel_price
Code:
price = (360 * (5 ^ (int((level - 1) / 5)))) + (((360 * (5 ^ (int((level - 1) / 5)))) / 2.25) * ((level - 1) % 5))
Last edited: