I have a JSON in the following format:
"fire": {
"price": 25,
"uniques": [
23
],
"levels": {
"1": 30,
"2": 50,
"3": 10,
"4": 6.5,
"5": 2.5,
"6": 0.9,
"7": 0.1
}
}
The levels has my levels i need to choose, with the precentage chance as the values. (For example level 1 has a 30% chance)
I need to somehow choose a random level, while following those chances.
What I've tried: Smack my head against the wall