Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Request/Help] API script to lookup 'To-Hit' based on attackers Level, targets AC, target armor type.

I could use some help getting an API script set up. I have no desire to learn another programming language at this point in my life, so I'm really hoping someone can set me up with a framework that I can then modify and load up with hard-coded charts. I need a script to help streamline some AD&D 1st Edition look ups. Step 1) Player launches an attack by clicking a macro button. Step 2) cross reference player's level (stored on character sheet as attribute "LEVEL") and class (stored on character sheet as "CLASS") against target's AC (stored on target sheet as "AC") to determine the 'To-Hit' number. CLASS determines which of 5 charts to use, level determines the row of the chart and the target's AC determines the column - cross reference to get the 'To-Hit'. Step 3) Cross reference the player's weapon modifier vs the target's apparent AC (stored on the target's sheet as AC|Max). In 1st Ed AD&D the weapon you are using has various degrees of effectiveness. So a long sword vs plate mail has a modifier (for example) of -1, while a long sword vs no armor is +2. Stored on the player's sheet would be an attribute called "WEAPON". This weapon name ("Long Sword", "Long Bow", etc) would then be cross referenced against the apparent armor class of the target (or could be stored as a series of attributes on the character sheet I guess). Step 4) Roll to hit with all the modifiers applied. IF the roll is => 'To-Hit' THEN roll damage (either looked up or stored as attribute). As I said, I'm happy to do the heavy lifting (entering line after line of charts) if someone call help with the finesse.
I've got a script put together that does this for fourth edition, it should be easy enough to modify for 1st edition. <a href="https://app.roll20.net/forum/post/540414/script-4e" rel="nofollow">https://app.roll20.net/forum/post/540414/script-4e</a>...
Awesome, thank you so much! I'll dig into it and see if I can figure it out.