Quoted By:
As an fyi if you see
<---This
That's a debug line. Basically if the first number is bigger then the second, you win.
If anyone wants to make better algorithms, your welcome to.
int difficulty = rand.Next(Convert.ToInt32(me.getPartyLevel() * (0.22 * dificultyMod)) + (50 * (me.badges * me.badges))) + offset;
difficulty mod is a small number usual between 1-5. and offset is a large one, meaning the minimum level of your party.