2012-03-24, 07:25 AM
Fiel Wrote:I call bull on the scrolls failing to pass.
100% agree.
For anyone not clear on the code there, the relevant part is;
Code:
iSuccess = rankdom 32 bit number;
if (iSuccess % 101 > Scroll->SuccessRate)
{
/* fail and do similar test for destruction if it has a Scroll->CurseRate */
}
{
/* succeed */
}Regardless of what the random number that comes back as, it will never be greater than 100, because it's being modded by 101.
The highest value it can achieve is a 100, and since it's > not >=, it'd still succeed.
This logic has been around since the dawn of time, even MUDs typically used;
Code:
int number_percent( void )
{
return (number_mm() % 100)+1;
}To do their probability tests since the early days.
It's not having what you want - It's wanting what you've got.

