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

[Help] Don't know Java or the API system, is this possible to do this task easily?

I am running a Warhammer Fantasy Role Play v2 (WFRP 2) campaign and the most common dice roll is the attack roll. The attack roll itself is very simple, just a d100 result. Where it gets complicated is hit location. To find hit location, you switch the digits on the dice result and compare it to a chart to see where that attack hit. Thus if you roll an 18, the hit location is an 81 and you would look on the chart to see where the hit landed. The locations are these: 1-15 Head, 16-35 Right Arm, 36-55 Left Arm, 56-80 Body, 81-90 Right Leg, 91-00 Left Leg. What I'd like to have is a way for both player and GM to do a chat function where the to hit roll is displayed (d100 result) and immediately afterward the hit location is displayed. With the digit reversal thing, it seem the only way might be to assign each number from 1-100 with a specific hit location, basically creating a massive table with 100 individual results. Does anyone have a better idea?
Hi Brandon, What you're requesting is relatively simple. However, being in the reverse position (not knowing WFRP 2 but knowing Javascript) I can only make a limited version of what I believe you will require. One thing I was particularly confused about is that both a roll of 10 and a 100 are considered headshots. I have created a variable "message" (see big box with "var message =") that you can edit to allow for different flavours of text to be sent in chat by your players. At the moment it is a simple emote and pseudo inline roll. To call this API simply type "!attack" without the quotation marks. Please find the code here. Feel free to contact me regarding any further functionality. Goodluck, GM King
1399361867
Lithl
Pro
Sheet Author
API Scripter
King said: One thing I was particularly confused about is that both a roll of 10 and a 100 are considered headshots. That is intentional (although I believe in WFRP like in W40kRP, 95-100 is a fumble, so it wouldn't actually connect with a 100). The point is that you can potentially hit any part of the target's body, no matter your skill level. If you only succeed on a 01-55, but you needed say for example 90+ for a headshot, very few characters would be capable of hitting a target in the head, even with a fully-automatic weapon firing at point-blank range with explosive cartridges. So, hit location is determined by flipping the digits of the attack. It reduces the number of rolls required, and while your chances to hit a particular body part vary as you increase in skill level, the percentages are roughly constant.