Difference between revisions of "MUDL:die roll"

From SlothMUD Wiki
Jump to: navigation, search
(Created page with " __TOC__ = Summary = {|class="abilitiestable" border="0" cellspacing="0" cellpadding="0" ! Function Name | die_roll |- ! Settable | No |- ! Returns | Integer |} {|class="...")
 
(No difference)

Latest revision as of 23:36, 7 November 2018


Summary

Function Name die_roll
Settable No
Returns Integer


Parameter Options
Number of Dice (integer), Size of Dice (integer)


This function performs a die roll using the specified number and size of dice. It is similar to using the "#d#" notation in MUDL but allows for variables to be provided rather than constants.


Example

setproc <parent> # NUM 3
setproc <parent> # SIZE 5

setproc <parent> # on_foo
msg_room(%room,
        '' + die_roll(integer(get_attr('NUM')), integer(get_attr('SIZE')))),
return(true)
@


setproc <parent> # PROC_ENABLED 1