$gain+=rand(1,3)/rand(800,1000)*rand(2000,5000)*(($ir['will']+20)/150);
The gain from 1 train = A random number 1, 2 or 3. which is divided by a random number between 800 and 1000 multiply that answer by 1 over a random number between 2000 and 5000 and times that by 1 over the users will + another 20 and then divide by 150
LOL