Well, what the point of that? While it does what he requested technically, it seems unusable from a practical code perspective.You want a random number from 1 to 100, but not 49:
*Pick a random from 1 to 99
*If the random is 49, then use 100.
Technically impossible. You need to re roll each time, this should be done with a loop to make it easy.
loop 1-3
roll = number between 1-100
if roll is not equal to 53 then
exit loop
endloop
edit: A more effective solution (maybe, I haven't exactly benchmarked it)
Make an array of numbers.
x[1] = 22
x[2] = 66
x[..] = 45
x[99] = 98
Then do something like
roll = random number between 1-99
x[roll] is now the one that has been randomized.
In which case doing your method wont work. Because he likely got let's say 10 spawn points, setting number 5 to spawn point 11 will not work. And setting it to 10 would work, but make the chance of spawn point 10 twice as high which is counter productive to what he wants to achieve.