Finished at last! The code is triggered by a macro which asks the user for the values relevant to the critical hit. Those values would be the attacker and defender's sizes, the attack roll, the defense roll, the damage roll, the defender's DR, and the weapon type. Here's the macro which I just dubbed "Critical." !Critical ?{Enter the number corresponding to the ATTACKER's size. Tiny (1), Small (2), Medium (3), Large (4), Huge (5), Gargantuan (6), Enormous (7), and Colossal (8)|1|2|3|4|5|6|7|8}, ?{Enter the number corresponding to the DEFENDER's size. Tiny (1), Small (2), Medium (3), Large (4), Huge (5), Gargantuan (6), Enormous (7), and Colossal (8)|1|2|3|4|5|6|7|8}, ?{Enter the attack roll after all modifiers have been applied.}, ?{Enter the defense roll after all modifiers have been applied.}, ?{Enter the damage, but do not deduct the defender's DR.}, ?{Enter the defender's DR.}, ?{What kind of weapon did the attack use? Crushing (1), Hacking (2), and Piercing (3)|1|2|3}
After the macro is filled out it triggers the script with a line that looks like this. The script could also be triggered if this sequence of numbers were entered manually into the chat. !Critical [atksize], [defsize], [atkroll], [defroll], [atkdmg], [defdr], [weapontype] The script then goes through an enormous tree of if/else statements to spit out the critical hit result along with the location roll and the severity if you want to crosscheck it in the Hackmaster GMG. There was probably a more elegant way of doing the script than an if/else tree, but I'm new to programming and learning how to use an array for this seemed like it was more trouble than it was worth. Since I'm new to programming I don't really know how to upload this thing to github or whatever the appropriate thing to do is. I would drop the script here, but it ended up being ~2500 lines of code which I believe is too big for the forums. If anyone's got any tips for getting it onto github and sharing it I'd appreciate it. And a big thanks to Warklaw for having a setup that I used in my code for extracting the variables from the macro. <a href="https://github.com/Warklaw/roll20/blob/master/rol" rel="nofollow">https://github.com/Warklaw/roll20/blob/master/rol</a>...