Simple code, copy and paste into any file in your SRC
This code is based on dungeons and dragons percentile
dice system for rolling up loot using 2, 10 sided dice
one dice representing the 10's and the other representing
1's.. hope you enjoy ( no need for credit or email )

int percentile_dice_roll( void )
{
    char buf[80];
    int x = number_range(0,9); /* low dice  */
    int y = number_range(0,9); /* high dice */
    int z; /* total roll number 100 being the highest */

    if(x == 0 && y == 0)
    {
        z = 100;
    }
    else
    {
        sprintf(buf, "%d%d", y, x); /* y being the high dice represents 10's so it must go first */
        z = atoi(buf);
    }
    return z;
}