For a MMORPG World of Warcraft im trying to write a lib. Money in that games is stored as an Integer and in game currency is not an integer it's based of Gold, Silver and Copper coins.
Every 100 copper is 1 silver and every 100 silver is 1 gold.
Now I need to convert such an integer to the WoW Money format: for example
123123 should return:
23c 31s 12g
Anyone knows how to do this
Gold Can only be exchanged for a WoW Token which then can be turned into bnet Balance. bnet balance can be used to purchase any battle.net digital goods, including games and services, or whatever else they have on their digital shop. Returns do not turn into real money, it will just return to your bnet balance.
Copper coins with the face of a peon. ), or a combination of any those types of coins. Your current total is shown at the bottom right of your open backpack window.
"Why is this random figure the gold cap? Because they most likely store the data in a 32 bit signed integer, which has a maximum size of 2147483647. So the actual cap could potentially be 214748 gold, 36 silver and 47 copper, or they use that last byte for something else."
C#:
int[] WoWMoney(int m)
{
int[] result = new int[3];
int copper = m % 100;
m = (m - copper) / 100;
int silver = m % 100;
int gold = (m - silver) / 100;
result[0] = copper;
result[1] = silver;
result[2] = gold;
return result;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With