From NWN LexiconJump to navigationJump to search
Rolls a 2-sided die.
- The number of dice to roll. (Default: 1, maximum 255)
Returns the total from rolling nNumDice x d2 dice.
If nNumDice is less than 1, then 1 is used. If nNUmDice is over 255 it overflows, making 256 be "0" dice rolled, 257 be 1 die, and so on.
An easier way to have dice rolls visible in code, which in D&D comes up a lot.
A d2 (two sided die) has a 50% probability of turning up either 1 or 2.
A single roll is equivalent of running:
Random(2) + 1;
author: Charles Feduke