DragonBlade
06-23-2010, 10:00 PM
Original:
https://vborg.vbsupport.ru/showthread.php?t=113972
https://vborg.vbsupport.ru/showpost.php?p=1017963&postcount=167
With tuxz0r's permission, I have ported his version of his dice roll mod for vb 4.0. This also fixes the first post issue.
Shameless copy paste from tuxz0r's post:
This mod uses the standard AdX+B notation where
A = the number of dice to roll (1 if not present)
X = the number of faces on the dice
B = represents a modifier, usually a + or - but also a divides or multiply.
I also need it to do certain things like, only show the sum/result of the roll or show all the die results and the sum of the roll. I also wanted the ability to do open rolls, e.g. if you roll 6, six sided die, you keep rerolling any dice that come up a 6.
So, basically, I have concocted three different bbcodes in one product:
1d4 - for rolling and showing only the results or sum
1d4 - for rolling and seeing the result of each dice as well as the sum
1d4 - for open rolls
Each of these takes and optional label for the roll, to be included in the tag after the '=' sign, e.g. 4d6 and so forth. It is, however, optional as the actual notation for the roll is displayed before the results in the final posting.
So, for example, you can enter rolls like the following:
4d6 to get the sum of 4 six sided die.
d% for a percentage roll (same as 1d100)
4d6b3 to roll 4 six sided dice and only sum the "best" three results
Installation:
1. Upload class_dice.php into vb's includes folder.
1. Import product-dice.xml.
https://vborg.vbsupport.ru/showthread.php?t=113972
https://vborg.vbsupport.ru/showpost.php?p=1017963&postcount=167
With tuxz0r's permission, I have ported his version of his dice roll mod for vb 4.0. This also fixes the first post issue.
Shameless copy paste from tuxz0r's post:
This mod uses the standard AdX+B notation where
A = the number of dice to roll (1 if not present)
X = the number of faces on the dice
B = represents a modifier, usually a + or - but also a divides or multiply.
I also need it to do certain things like, only show the sum/result of the roll or show all the die results and the sum of the roll. I also wanted the ability to do open rolls, e.g. if you roll 6, six sided die, you keep rerolling any dice that come up a 6.
So, basically, I have concocted three different bbcodes in one product:
1d4 - for rolling and showing only the results or sum
1d4 - for rolling and seeing the result of each dice as well as the sum
1d4 - for open rolls
Each of these takes and optional label for the roll, to be included in the tag after the '=' sign, e.g. 4d6 and so forth. It is, however, optional as the actual notation for the roll is displayed before the results in the final posting.
So, for example, you can enter rolls like the following:
4d6 to get the sum of 4 six sided die.
d% for a percentage roll (same as 1d100)
4d6b3 to roll 4 six sided dice and only sum the "best" three results
Installation:
1. Upload class_dice.php into vb's includes folder.
1. Import product-dice.xml.