Store each levels spawn rates for each enemy in a 2D array? With X being level and Y being monster type and spawn value
So if you think of Y0 = Zombie, Y1 = Vampire, Y2 = goblin, Y3 = troll.
The actual array just keeps numbers, but they need to be INVERSE percentages.
So if you have:
0 % spawn rate, store 100
80 %, store 20
10%, store 90
This is because we will do a GREATER THAN check.
Then you generate a random number between 0-100.
You know what level you're at so you just loop for Array.Height, checking Random > Array.Value
If true, spawn a mob that corresponds to that level of the array.
If you always want to spawn something, you'll need a default spawn at the end of your array that has 0.
This was top of my head, and completely un tested but in theory could work... right?
You can then also dynamically change the spawn rate as you go, just update the array.