Advertisement
Guest User

exalted 3e mirc dice roller

a guest
Mar 4th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. /exroll {
  2.  
  3. %name = $nick
  4.  
  5. if (%name == $null) {
  6. %name = $me
  7. }
  8.  
  9. %grammar = die
  10. %dice = 1
  11.  
  12. if ((strip($$1) isnum) && ($$1 >= 1)){
  13. %dice = $int($$1)
  14. %grammar = dice
  15. }
  16.  
  17. if (%dice > 50) {
  18. % dice = 50
  19. }
  20.  
  21. %success = 0
  22. %counter = 1
  23. %success = 0
  24. %crits = 0
  25. %botches = 0
  26. %target = 7
  27. %auto = 0
  28. %double = 10
  29. %reroll = 0
  30. %rerollones = 0
  31. %rerolltriggered = 0
  32. %result = 0
  33. %readout = -
  34. %roll = 0
  35. %die
  36. %diestart
  37. %parenthetical
  38. %reason
  39. %total = 0
  40.  
  41. %arg2 = $2
  42. %arg3 = $3
  43. %arg4 = $4
  44. %arg5 = $5
  45.  
  46. %arg = %arg2
  47. %argsused = 0
  48.  
  49. if ($0 < 2) {
  50. goto rolling
  51. }
  52.  
  53. %curarg = 2
  54.  
  55. :argchecks
  56.  
  57. if ($left(%arg,1) == t) && ($mid(%arg,2) isnum) {
  58. /inc %argsused
  59. %target = $mid(%arg,2)
  60. if (%target > 10) {
  61. %target = 10
  62. }
  63. }
  64.  
  65. if ($left(%arg,1) == a) && ($mid(%arg,2) isnum) {
  66. /inc %argsused
  67. %auto = $mid(%arg,2)
  68. }
  69.  
  70. if ($left(%arg,1) == d) && ($mid(%arg,2) isnum) {
  71. /inc %argsused
  72. %double = $mid(%arg,2)
  73. if (%double < 1) {
  74. %double = 11
  75. }
  76. }
  77.  
  78. if ($left(%arg,1) == r) && ($mid(%arg,2,1) isnum) && (!$regex($mid(%arg,2),[a-z || A-Z])) {
  79. /inc %argsused
  80. %reroll = $mid(%arg,2)
  81. if ($count(%arg,1) > $count(%arg,10)) {
  82. %rerollones = 1
  83. }
  84. }
  85.  
  86. if (%curarg == 2) {
  87. %arg = %arg3
  88. %curarg = 3
  89. goto argchecks
  90. }
  91.  
  92. if (%curarg == 3) {
  93. %arg = %arg4
  94. %curarg = 4
  95. goto argchecks
  96. }
  97.  
  98. if (%curarg == 4) {
  99. %arg = %arg5
  100. %curarg = 5
  101. goto argchecks
  102. }
  103.  
  104. %ticker = 2
  105. %rerollednumbers = 0
  106.  
  107. while (%ticker < 11) {
  108. if ($count(%reroll,%ticker) > 0) {
  109. /inc %rerollednumbers
  110. }
  111. /inc %ticker
  112. }
  113. if (%rerollednumbers == 9) && (%rerollones == 1) {
  114. %rerollones = 0
  115. %reroll = 0
  116. }
  117.  
  118. :rolling
  119.  
  120. if (%double < %target) {
  121. %double = %target
  122. }
  123.  
  124. while (%counter <= %dice) {
  125. %roll = $rand(1,10)
  126.  
  127. if ((%roll isin %reroll) && (%roll > 1)) || (%roll == %rerollones) {
  128. %rerolltriggered = 1
  129.  
  130. if (%roll < %target) {
  131. %die = 05 $+ %roll $+ 
  132. }
  133. if (%roll == 1) {
  134. %die = 04 $+ 1! $+ 
  135. }
  136. if (%roll >= %target) {
  137. %die = 12 $+ %roll $+ 
  138. /inc %success
  139. }
  140. if (%roll >= %double) {
  141. %die = 12 $+ %roll $+ 12!
  142. /inc %crits
  143. }
  144.  
  145. %diestart = 5( $+ %die
  146.  
  147. while ((%roll isin %reroll) && (%roll > 1)) || (%roll == %rerollones) {
  148. %roll = $rand(1,10)
  149. if ((%roll isin %reroll) && (%roll > 1)) || (%roll == %rerollones) {
  150. if (%roll >= %target) && (%roll < %double) {
  151. %diestart = %diestart $+ → $+ 12 $+ %roll $+ 
  152. /inc %success
  153. }
  154. if (%roll >= %double) {
  155. %diestart = %diestart $+ → $+ 12 $+ %roll $+ 12!
  156. /inc %crits
  157. /inc %success
  158. }
  159. }
  160. }
  161. }
  162.  
  163. if (%roll < %target) {
  164. %die = 05 $+ %roll $+ 
  165. }
  166.  
  167. if (%roll >= %target) {
  168. %die = 12 $+ %roll $+ 
  169. /inc %success
  170. }
  171.  
  172. if (%roll >= %double) {
  173. %die = 12 $+ %roll $+ 12!
  174. /inc %crits
  175. }
  176.  
  177. if (%roll == 1) {
  178. %die = 04 $+ 1! $+ 
  179. /inc %botches
  180. }
  181.  
  182. :nextdie
  183.  
  184. /inc %counter
  185. if (%rerolltriggered == 1) {
  186. %die = %diestart $+ → $+ %die $+ 5) $+ 
  187. }
  188. %rerolltriggered = 0
  189. %readout = %readout %die
  190. /unset %roll
  191. /unset %die
  192.  
  193. }
  194.  
  195. %total = %success + %crits
  196. %total = %total + %auto
  197. /unset %parenthetical
  198. /unset %reason
  199.  
  200. if (%auto > 0) || (%double < 11) || (%reroll > 0) {
  201. %parenthetical = (
  202. }
  203.  
  204. if (%double < 11) {
  205. %parenthetical = %parenthetical $+ Doubling12 %double $+ s
  206. }
  207.  
  208. if (%auto > 0) {
  209. if (%double < 11) {
  210. %parenthetical = %parenthetical $+ , 
  211. }
  212. %parenthetical = %parenthetical $+ Adding12 %auto $+ 
  213. }
  214.  
  215. if (%reroll > 0) {
  216. if (%auto > 0) || (%double < 11) {
  217. %parenthetical = %parenthetical $+ , 
  218. }
  219. %parenthetical = %parenthetical $+ Rerolling12 %reroll $+
  220. }
  221.  
  222. if (%auto > 0) || (%double < 11) || (%reroll > 0) {
  223. %parenthetical = %parenthetical $+ )
  224. }
  225.  
  226. if (%argsused == 0) && ($0 > 1) {
  227. %reason = to12 $2- $+ 
  228. }
  229.  
  230. if (%argsused == 1) && ($0 > 2) {
  231. %reason = to12 $3- $+ 
  232. }
  233.  
  234. if (%argsused == 2) && ($0 > 3) {
  235. %reason = to12 $4- $+ 
  236. }
  237.  
  238. if (%argsused == 3) && ($0 > 4) {
  239. %reason = to12 $5- $+ 
  240. }
  241.  
  242. if (%argsused == 4) && ($0 > 5) {
  243. %reason = to12 $6- $+ 
  244. }
  245.  
  246. /msg $chan %name rolls $+ 12 %dice  $+ %grammar at TN4 %target $+  %parenthetical %reason [Successes:12 %total $+ , Doubled:12 %crits $+ , Ones:4 %botches $+ ]
  247. /msg $chan %readout -
  248. /unsetall
  249. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement