- ;************************************************
- ;***************** DICEROLL *********************
- ;************************************************
- on *:TEXT:!count*roll:#: {
- if ($3 == #lawfulgood) {
- msg $chan #lawfulgood rolled the dice 4128 times in 2008
- msg $chan #lawfulgood rolled the dice 1046 times in 2009
- }
- msg $chan The dice have been rolled %rollcount times this year
- }
- on *:TEXT:!roll*:#: {
- inc %rollcount
- if (%roll != $null) {
- msg $chan %roll
- unset %roll
- halt
- }
- if ($2 == bag) {
- msg $chan $nick dropped their bag of dice! The results are: d4: $rand(1,4) $+ , d6: $rand(1,6) $+ , d8: $rand(1,8) $+ , $&
- d10: $rand(1,10) $+ , d12: $Rand(1,12) $+ , d20: $rand(1,20) $+ , and d100: $rand(1,100) $+ .
- halt
- }
- if ($2 == stats) {
- set %average 0
- msg $chan $Nick rolled up a new character! Base stats are:
- msg $chan $nick $+ 's 1st stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan $nick $+ 's 2nd stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan $nick $+ 's 3rd stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan $nick $+ 's 4th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan $nick $+ 's 5th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan $nick $+ 's 6th stat: $roll4d6droplowest($rand(1,6),$rand(1,6),$rand(1,6),$rand(1,6))
- msg $chan Average Stat: $Calc( ( %average ) / 6 )
- unset %average
- }
- if (($2 isnum 1-150) && ( . !isin $2 ) && ( , !isin $2)) {
- var %flop $rand(1,25)
- var %roll $rand(1, $2)
- var %d $2
- }
- elseif ($2 == $null) {
- var %flop $rand(1,30)
- var %roll $rand(1,20)
- var %d 20
- }
- if ((%flop == 1) && (d !isin $2)) {
- msg $chan $nick rolled the d $+ %d $+ ! It fell off the table and went behind the desk. Good job, you just lost a perfectly $&
- good d $+ %d $+ .
- var %count $read(lostdice.txt, s, $nick))
- inc %count
- write -s $+ $nick lostdice.txt $nick %count
- }
- elseif ($2 ison $chan) { describe $chan wraps up $2 in a carpet and rolls them across the floor! }
- elseif (%d isnum 1-1000) {
- msg $chan $nick rolled %roll on the d $+ %d $+ !
- if ((%roll == 20) && (%d == 20)) {
- var %count $read(natural20.txt, s, $nick))
- inc %count
- write -s $+ $nick natural20.txt $nick %count
- }
- if ((%roll == 1) && (%d == 20)) {
- var %count $read(natural1.txt, s, $nick))
- inc %count
- write -s $+ $nick natural1.txt $nick %count
- }
- }
- elseif (d isincs $2) {
- var %dicecheck $2
- if ( $numtok(%dicecheck,100) == 1 ) {
- var %dicecheck $instok(%dicecheck,1,1,100)
- }
- manyroll $replace(%dicecheck,$chr(100),$chr(32)) $3
- }
- elseif (D isincs $2) {
- var %dicecheck $2
- if ( $numtok(%dicecheck,68) == 1 ) {
- var %dicecheck $instok(%dicecheck,1,1,68)
- }
- manyroll $replace(%dicecheck,$chr(68),$chr(32)) $3
- }
- }
- alias manyroll {
- var %dicenum $1
- if ($3 != $null) {
- var %mod :: $3 (modifier)
- }
- while (%dicenum > 0) {
- var %result %result $rand(1,$2)
- dec %dicenum
- }
- var %total $calc(($replace(%result,$chr(32),$chr(43))) $3)
- msg $chan $nick rolled $1 d $+ $2 $+ ! They rolled: %result %mod - Total %total
- if (($1 == 1) && ($2 == 20) && (%result == 20)) {
- var %count $read(natural20.txt, s, $nick))
- inc %count
- write -s $+ $nick natural20.txt $nick %count
- }
- if (($1 == 1) && ($2 == 20) && (%result == 1)) {
- var %count $read(natural1.txt, s, $nick))
- inc %count
- write -s $+ $nick natural1.txt $nick %count
- }
- }
- Alias roll4d6droplowest {
- if (($1 <= $2) && ($1 <= $3) && ($1 <= $4)) {
- set %average %average + $Calc($2 + $3 + $4)
- Return ( $+ $1 dropped) $2 $3 $4 - Total: $Calc($2 + $3 + $4)
- }
- if (($2 <= $1) && ($2 <= $3) && ($2 <= $4)) {
- set %average %average + $Calc($1 + $3 + $4)
- Return ( $+ $2 dropped) $1 $3 $4 - Total: $Calc($1 + $3 + $4)
- }
- if (($3 <= $1) && ($3 <= $2) && ($3 <= $4)) {
- set %average %average + $Calc($1 + $2 + $4)
- Return ( $+ $3 dropped) $1 $2 $4 - Total: $Calc($1 + $2 + $4)
- }
- if (($4 <= $1) && ($4 <= $2) && ($4 <= $3)) {
- set %average %average + $Calc($1 + $2 + $3)
- Return ( $+ $4 dropped) $1 $2 $3 - Total: $Calc($1 + $2 + $3)
- }
- }
- on *:TEXT:!natural20:#: {
- filter -tueffc 2 32 natural20.txt natural20.txt
- msg $chan Top 5 Natural 20 Rollers This Year:
- var %highscorelines 1
- while (%highscorelines <= 5) {
- msg $chan $read(natural20.txt, %highscorelines)
- inc %highscorelines
- }
- }
- on *:TEXT:!natural1:#: {
- filter -tueffc 2 32 natural1.txt natural1.txt
- msg $chan Top 5 Natural 1 Rollers This Year:
- var %highscorelines 1
- while (%highscorelines <= 5) {
- msg $chan $read(natural1.txt, %highscorelines)
- inc %highscorelines
- }
- }
- on *:TEXT:!lostdice:#: {
- filter -tueffc 2 32 lostdice.txt lostdice.txt
- msg $chan Top 5 People Who Have Lost Dice This Year:
- var %lost 1
- while (%lost <= 5) {
- msg $chan $read(lostdice.txt, %lost)
- inc %lost
- }
- }
- on *:TEXT:!BagOfTricks*:#: {
- var %trick $rand(1,100)
- if ($2 == Tan) {
- if (%trick isnum 01-30) {
- msg $chan $Nick pulled a Brown bear from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/bearBrown.htm
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 24)
- if (%HP <= 51) {
- msg $chan Creature has 51 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 31-60) {
- msg $chan $Nick pulled a Lion from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/lion.htm
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 10)
- if (%HP <= 32) {
- msg $chan Creature has 32 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 61-80) {
- msg $chan $Nick pulled a Heavy warhorse from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/horse.htm#warhorseHeavy
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 12)
- if (%HP <= 30) {
- msg $chan Creature has 30 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 81-90) {
- msg $chan $Nick pulled a Tiger from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/tiger.htm
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + $rand(1,8) + 18)
- if (%HP <= 45) {
- msg $chan Creature has 45 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 91-100) {
- msg $chan $Nick pulled a Rhinoceros from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/rhinoceros.htm
- 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)
- if (%HP <= 76) {
- msg $chan Creature has 76 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- }
- elseif ($2 == Rust) {
- if (%trick isnum 01-30) {
- msg $chan $Nick pulled a Wolverine from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/wolverine.htm
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 15)
- if (%HP <= 28) {
- msg $chan Creature has 28 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 31-60) {
- msg $chan $Nick pulled a Wolf from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/wolf.htm
- var %HP $Calc($Rand(1,8) + $Rand(1,8) + 4)
- if (%HP <= 13) {
- msg $chan Creature has 13 HP
- }
- Else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 61-85) {
- msg $chan $Nick pulled a Boar from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/boar.htm
- var %HP $calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 12)
- if (%HP <= 25) {
- msg $chan Creature has 25 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- elseif (%trick isnum 86-100) {
- msg $chan $Nick pulled a Black Bear from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/bearBlack.htm
- var %HP $Calc($rand(1,8) + $rand(1,8) + $rand(1,8) + 6)
- if (%HP <= 19) {
- msg $chan Creature has 19 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- }
- elseif (($2 == Gray) || ($2 == Grey) || ($0 == 1)) {
- if (%trick isnum 01-30) {
- msg $chan $Nick pulled a Bat from the Gray Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/bat.htm
- if ($rand(1,8) == 8) {
- msg $chan Creature has 2 HP
- }
- else {
- msg $chan Creature has 1 HP
- }
- }
- elseif (%trick isnum 31-60) {
- msg $chan $Nick pulled a Rat from the Gray Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/rat.htm
- if ($rand(1,8) == 8) {
- msg $chan Creature has 2 HP
- }
- else {
- msg $chan Creature has 1 HP
- }
- }
- elseif (%trick isnum 61-75) {
- msg $chan $Nick pulled a Cat from the Gray Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/cat.htm
- var %HP $Rand(1,8)
- if (%HP isnum 1-5) {
- msg $chan Creature has 2 HP
- }
- elseif (%HP isnum 6-7) {
- msg $chan Creature has 3 HP
- }
- elseif (%HP == 8) {
- msg $chan Creature has 4 HP
- }
- }
- elseif (%trick isnum 76-90) {
- msg $chan $Nick pulled a Weasel from the Gray Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/weasel.htm
- var %HP $Rand(1,8)
- if (%HP isnum 1-5) {
- msg $chan Creature has 2 HP
- }
- elseif (%HP isnum 6-7) {
- msg $chan Creature has 3 HP
- }
- elseif (%HP == 8) {
- msg $chan Creature has 4 HP
- }
- }
- elseif (%trick isnum 91-100) {
- msg $chan $Nick pulled a Badger from the $2 Bag of Tricks! (Rolled %trick $+ )
- msg $chan http://www.d20srd.org/srd/monsters/badger.htm
- var %HP $rand(3,10)
- if (%HP <= 6) {
- msg $chan Creature has 6 HP
- }
- else {
- msg $chan Creature has %HP HP
- }
- }
- }
- elseif ($2 == Burlap) {
- if (%trick isnum 1-30) {
- msg $chan $nick pulled some Lint from the $2 Bag of Tricks! (Rolled %trick $+ )
- }
- elseif (%trick isnum 31-60) {
- msg $chan $nick pulled a Hairball from the $2 Bag of Tricks! (Rolled %trick $+ )
- }
- elseif (%trick isnum 61-100) {
- msg $chan $nick pulled a Dust Bunny from the $2 Bag of Tricks! (Rolled %trick $+ )
- }
- }
- }
