Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 11.14 KB | Hits: 76 | Expires: Never
Copy text to clipboard
  1.  
  2. ;************************************************
  3. ;***************** DICEROLL *********************
  4. ;************************************************
  5.  
  6. on *:TEXT:!count*roll:#: {
  7.   if ($3 == #lawfulgood) {
  8.     msg $chan #lawfulgood rolled the dice 4128 times in 2008
  9.     msg $chan #lawfulgood rolled the dice 1046 times in 2009
  10.   }
  11.   msg $chan The dice have been rolled %rollcount times this year
  12. }
  13.  
  14. on *:TEXT:!roll*:#: {
  15.   inc %rollcount  
  16.   if (%roll != $null) {
  17.     msg $chan %roll
  18.     unset %roll
  19.     halt
  20.   }
  21.   if ($2 == bag) {
  22.     msg $chan $nick dropped their bag of dice! The results are: d4: $rand(1,4) $+ , d6: $rand(1,6) $+ , d8: $rand(1,8) $+ , $&
  23.       d10: $rand(1,10) $+ , d12: $Rand(1,12) $+ , d20: $rand(1,20) $+ , and d100: $rand(1,100) $+ .
  24.     halt
  25.   }
  26.   if ($2 == stats) {
  27.     set %average 0
  28.     msg $chan $Nick rolled up a new character! Base stats are:
  29.     msg $chan $nick $+ 's 1st stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  30.     msg $chan $nick $+ 's 2nd stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  31.     msg $chan $nick $+ 's 3rd stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  32.     msg $chan $nick $+ 's 4th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  33.     msg $chan $nick $+ 's 5th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  34.     msg $chan $nick $+ 's 6th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
  35.     msg $chan Average Stat: $Calc( ( %average ) / 6 )
  36.     unset %average
  37.   }
  38.   if (($2 isnum 1-150) && ( . !isin $2 ) && ( , !isin $2)) {
  39.     var %flop $rand(1,25)
  40.     var %roll $rand(1, $2)
  41.     var %d $2
  42.   }
  43.   elseif ($2 == $null) {
  44.     var %flop $rand(1,30)
  45.     var %roll $rand(1,20)
  46.     var %d 20
  47.   }
  48.   if ((%flop == 1) && (d !isin $2)) {
  49.     msg $chan $nick rolled the d $+ %d $+ ! It fell off the table and went behind the desk. Good job, you just lost a perfectly $&
  50.       good d $+ %d $+ .
  51.     var %count $read(lostdice.txt, s, $nick))
  52.     inc %count
  53.     write -s $+ $nick lostdice.txt $nick %count
  54.   }
  55.   elseif ($2 ison $chan) { describe $chan wraps up $2 in a carpet and rolls them across the floor! }
  56.   elseif (%d isnum 1-1000) {
  57.     msg $chan $nick rolled %roll on the d $+ %d $+ !
  58.     if ((%roll == 20) && (%d == 20)) {
  59.       var %count $read(natural20.txt, s, $nick))
  60.       inc %count
  61.       write -s $+ $nick natural20.txt $nick %count
  62.     }
  63.     if ((%roll == 1) && (%d == 20)) {
  64.       var %count $read(natural1.txt, s, $nick))
  65.       inc %count
  66.       write -s $+ $nick natural1.txt $nick %count
  67.     }
  68.   }
  69.   elseif (d isincs $2) {
  70.     var %dicecheck $2
  71.     if ( $numtok(%dicecheck,100) == 1 ) {
  72.       var %dicecheck $instok(%dicecheck,1,1,100)
  73.     }
  74.     manyroll $replace(%dicecheck,$chr(100),$chr(32)) $3
  75.   }
  76.   elseif (D isincs $2) {
  77.     var %dicecheck $2
  78.     if ( $numtok(%dicecheck,68) == 1 ) {
  79.       var %dicecheck $instok(%dicecheck,1,1,68)
  80.     }
  81.     manyroll $replace(%dicecheck,$chr(68),$chr(32)) $3
  82.   }
  83. }
  84.  
  85. alias manyroll {
  86.   var %dicenum $1
  87.   if ($3 != $null) {
  88.     var %mod :: $3 (modifier)
  89.   }
  90.   while (%dicenum > 0) {
  91.     var %result %result $rand(1,$2)
  92.     dec %dicenum
  93.   }
  94.   var %total $calc(($replace(%result,$chr(32),$chr(43))) $3)
  95.   msg $chan $nick rolled $1 d $+ $2 $+ ! They rolled: %result %mod - Total %total
  96.   if (($1 == 1) && ($2 == 20) && (%result == 20)) {
  97.     var %count $read(natural20.txt, s, $nick))
  98.     inc %count
  99.     write -s $+ $nick natural20.txt $nick %count
  100.   }
  101.   if (($1 == 1) && ($2 == 20) && (%result == 1)) {
  102.     var %count $read(natural1.txt, s, $nick))
  103.     inc %count
  104.     write -s $+ $nick natural1.txt $nick %count
  105.   }
  106. }
  107.  
  108.  
  109. Alias roll4d6droplowest {
  110.   if (($1 <= $2) && ($1 <= $3) && ($1 <= $4)) {
  111.     set %average %average + $Calc($2 + $3 + $4)
  112.     Return ( $+ $1 dropped) $2 $3 $4 - Total: $Calc($2 + $3 + $4)
  113.   }
  114.   if (($2 <= $1) && ($2 <= $3) && ($2 <= $4)) {
  115.     set %average %average + $Calc($1 + $3 + $4)
  116.     Return ( $+ $2 dropped) $1 $3 $4 - Total: $Calc($1 + $3 + $4)
  117.   }
  118.   if (($3 <= $1) && ($3 <= $2) && ($3 <= $4)) {
  119.     set %average %average + $Calc($1 + $2 + $4)
  120.     Return ( $+ $3 dropped) $1 $2 $4 - Total: $Calc($1 + $2 + $4)
  121.   }
  122.   if (($4 <= $1) && ($4 <= $2) && ($4 <= $3)) {
  123.     set %average %average + $Calc($1 + $2 + $3)
  124.     Return ( $+ $4 dropped) $1 $2 $3 - Total: $Calc($1 + $2 + $3)
  125.   }
  126. }
  127.  
  128. on *:TEXT:!natural20:#: {
  129.   filter -tueffc 2 32 natural20.txt natural20.txt
  130.   msg $chan Top 5 Natural 20 Rollers This Year:
  131.   var %highscorelines 1
  132.   while (%highscorelines <= 5) {
  133.     msg $chan $read(natural20.txt, %highscorelines)
  134.     inc %highscorelines
  135.   }
  136. }
  137. on *:TEXT:!natural1:#: {
  138.   filter -tueffc 2 32 natural1.txt natural1.txt
  139.   msg $chan Top 5 Natural 1 Rollers This Year:
  140.   var %highscorelines 1
  141.   while (%highscorelines <= 5) {
  142.     msg $chan $read(natural1.txt, %highscorelines)
  143.     inc %highscorelines
  144.   }
  145. }
  146. on *:TEXT:!lostdice:#: {
  147.   filter -tueffc 2 32 lostdice.txt lostdice.txt
  148.   msg $chan Top 5 People Who Have Lost Dice This Year:
  149.   var %lost 1
  150.   while (%lost <= 5) {
  151.     msg $chan $read(lostdice.txt, %lost)
  152.     inc %lost
  153.   }
  154. }
  155.  
  156.  
  157.  
  158.  
  159. on *:TEXT:!BagOfTricks*:#: {
  160.   var %trick $rand(1,100)
  161.   if ($2 == Tan) {
  162.     if (%trick isnum 01-30) {
  163.       msg $chan $Nick pulled a Brown bear from the $2 Bag of Tricks! (Rolled %trick $+ )
  164.       msg $chan http://www.d20srd.org/srd/monsters/bearBrown.htm
  165.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 24)
  166.       if (%HP <= 51) {
  167.         msg $chan Creature has 51 HP
  168.       }
  169.       else {
  170.         msg $chan Creature has %HP HP
  171.       }
  172.     }
  173.     elseif (%trick isnum 31-60) {
  174.       msg $chan $Nick pulled a Lion from the $2 Bag of Tricks! (Rolled %trick $+ )
  175.       msg $chan http://www.d20srd.org/srd/monsters/lion.htm
  176.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 10)
  177.       if (%HP <= 32) {
  178.         msg $chan Creature has 32 HP
  179.       }
  180.       else {
  181.         msg $chan Creature has %HP HP
  182.       }
  183.     }
  184.     elseif (%trick isnum 61-80) {
  185.       msg $chan $Nick pulled a Heavy warhorse from the $2 Bag of Tricks! (Rolled %trick $+ )
  186.       msg $chan http://www.d20srd.org/srd/monsters/horse.htm#warhorseHeavy
  187.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 12)
  188.       if (%HP <= 30) {
  189.         msg $chan Creature has 30 HP
  190.       }
  191.       else {
  192.         msg $chan Creature has %HP HP
  193.       }
  194.     }
  195.     elseif (%trick isnum 81-90) {
  196.       msg $chan $Nick pulled a Tiger from the $2 Bag of Tricks! (Rolled %trick $+ )
  197.       msg $chan http://www.d20srd.org/srd/monsters/tiger.htm
  198.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 18)
  199.       if (%HP <= 45) {
  200.         msg $chan Creature has 45 HP
  201.       }
  202.       else {
  203.         msg $chan Creature has %HP HP
  204.       }
  205.     }
  206.     elseif (%trick isnum 91-100) {
  207.       msg $chan $Nick pulled a Rhinoceros from the $2 Bag of Tricks! (Rolled %trick $+ )
  208.       msg $chan http://www.d20srd.org/srd/monsters/rhinoceros.htm
  209.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 40)
  210.       if (%HP <= 76) {
  211.         msg $chan Creature has 76 HP
  212.       }
  213.       else {
  214.         msg $chan Creature has %HP HP
  215.       }
  216.     }
  217.   }
  218.   elseif ($2 == Rust) {
  219.     if (%trick isnum 01-30) {
  220.       msg $chan $Nick pulled a Wolverine from the $2 Bag of Tricks! (Rolled %trick $+ )
  221.       msg $chan http://www.d20srd.org/srd/monsters/wolverine.htm
  222.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 15)
  223.       if (%HP <= 28) {
  224.         msg $chan Creature has 28 HP
  225.       }
  226.       else {
  227.         msg $chan Creature has %HP HP
  228.       }
  229.     }
  230.     elseif (%trick isnum 31-60) {
  231.       msg $chan $Nick pulled a Wolf from the $2 Bag of Tricks! (Rolled %trick $+ )
  232.       msg $chan http://www.d20srd.org/srd/monsters/wolf.htm
  233.       var %HP $Calc($Rand(1,8) + $Rand(1,8) + 4)
  234.       if (%HP <= 13) {
  235.         msg $chan Creature has 13 HP
  236.       }
  237.       Else {
  238.         msg $chan Creature has %HP HP
  239.       }
  240.     }
  241.     elseif (%trick isnum 61-85) {
  242.       msg $chan $Nick pulled a Boar from the $2 Bag of Tricks! (Rolled %trick $+ )
  243.       msg $chan http://www.d20srd.org/srd/monsters/boar.htm
  244.       var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 12)
  245.       if (%HP <= 25) {
  246.         msg $chan Creature has 25 HP
  247.       }
  248.       else {
  249.         msg $chan Creature has %HP HP
  250.       }
  251.     }
  252.     elseif (%trick isnum 86-100) {
  253.       msg $chan $Nick pulled a Black Bear from the $2 Bag of Tricks! (Rolled %trick $+ )
  254.       msg $chan http://www.d20srd.org/srd/monsters/bearBlack.htm
  255.       var %HP $Calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 6)
  256.       if (%HP <= 19) {
  257.         msg $chan Creature has 19 HP
  258.       }
  259.       else {
  260.         msg $chan Creature has %HP HP
  261.       }
  262.     }
  263.   }
  264.   elseif (($2 == Gray) || ($2 == Grey) || ($0 == 1)) {
  265.     if (%trick isnum 01-30) {
  266.       msg $chan $Nick pulled a Bat from the Gray Bag of Tricks! (Rolled %trick $+ )
  267.       msg $chan http://www.d20srd.org/srd/monsters/bat.htm
  268.       if ($rand(1,8) == 8) {
  269.         msg $chan Creature has 2 HP
  270.       }
  271.       else {
  272.         msg $chan Creature has 1 HP
  273.       }
  274.     }
  275.     elseif (%trick isnum 31-60) {
  276.       msg $chan $Nick pulled a Rat from the Gray Bag of Tricks! (Rolled %trick $+ )
  277.       msg $chan http://www.d20srd.org/srd/monsters/rat.htm
  278.       if ($rand(1,8) == 8) {
  279.         msg $chan Creature has 2 HP
  280.       }
  281.       else {
  282.         msg $chan Creature has 1 HP
  283.       }
  284.     }
  285.     elseif (%trick isnum 61-75) {
  286.       msg $chan $Nick pulled a Cat from the Gray Bag of Tricks! (Rolled %trick $+ )
  287.       msg $chan http://www.d20srd.org/srd/monsters/cat.htm
  288.       var %HP $Rand(1,8)
  289.       if (%HP isnum 1-5) {
  290.         msg $chan Creature has 2 HP
  291.       }
  292.       elseif (%HP isnum 6-7) {
  293.         msg $chan Creature has 3 HP
  294.       }
  295.       elseif (%HP == 8) {
  296.         msg $chan Creature has 4 HP
  297.       }
  298.     }
  299.     elseif (%trick isnum 76-90) {
  300.       msg $chan $Nick pulled a Weasel from the Gray Bag of Tricks! (Rolled %trick $+ )
  301.       msg $chan http://www.d20srd.org/srd/monsters/weasel.htm
  302.       var %HP $Rand(1,8)
  303.       if (%HP isnum 1-5) {
  304.         msg $chan Creature has 2 HP
  305.       }
  306.       elseif (%HP isnum 6-7) {
  307.         msg $chan Creature has 3 HP
  308.       }
  309.       elseif (%HP == 8) {
  310.         msg $chan Creature has 4 HP
  311.       }
  312.     }
  313.     elseif (%trick isnum 91-100) {
  314.       msg $chan $Nick pulled a Badger from the $2 Bag of Tricks! (Rolled %trick $+ )
  315.       msg $chan http://www.d20srd.org/srd/monsters/badger.htm
  316.       var %HP $rand(3,10)
  317.       if (%HP <= 6) {
  318.         msg $chan Creature has 6 HP
  319.       }
  320.       else {
  321.         msg $chan Creature has %HP HP
  322.       }
  323.     }
  324.   }
  325.   elseif ($2 == Burlap) {
  326.     if (%trick isnum 1-30) {
  327.       msg $chan $nick pulled some Lint from the $2 Bag of Tricks! (Rolled %trick $+ )
  328.     }
  329.     elseif (%trick isnum 31-60) {
  330.       msg $chan $nick pulled a Hairball from the $2 Bag of Tricks! (Rolled %trick $+ )
  331.     }
  332.     elseif (%trick isnum 61-100) {
  333.       msg $chan $nick pulled a Dust Bunny from the $2 Bag of Tricks! (Rolled %trick $+ )
  334.     }
  335.   }
  336. }