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

Please help me with a d100 macro.

Hello friends.  I hope one of you could help me out. I am trying to write a macro for a d100 melee attack (Top Secret/S.I.) In this system the player rolls a d100 (2d10 where the first d10 is the 10's digit and the second d10 is the ones digit to give results from 00-99) in order to see if the attack hits.  If the attack roll is equal-to or less-than their melee skill they do an amount of damage equal to the first d10 to a location on the body determined by the second d10.  If the result is doubles (and good enough to hit) then the player does max damage (1/10th his skill level rounded down). Any and all help is appreciated.
Using the result of the dice roller is not possible without using API.
1482195295

Edited 1482195516
Tetsuo
Forum Champion
There's a simple version and a version that probably requires an API script.  here's the simple: /r ((1d10-1)*10)+(1d10-1) then you manual math the damage and location.  If you want to use the powercards API and lost which locations match up to a d10, I can make something a little more complex
Hi Franky, thanks for your response!  I'm okay with having the players roll 1d100 and I set the100 as a critical success and 99 as a critical failure in the roll macro.  (Players use visual dice and they know what the 100 means.  Plus I feel like rolling 1d100-1 takes away some of that fun of seeing the 00 result and it messes with the "doubles" mechanic that comes into play with firearms and such.) I'm looking at the powercards API now, and it looks like this is the way to go.  FYI the locations map like the following 0 Head, 1 Left Chest, 2 Right Chest, 3 Abdomen, 4 Right Arm, 5 Left Arm, 6 Right Hand, 7 Left Hand, 8 Right Leg, 9 Left Leg. You guys rock,
1482196535

Edited 1482196831
Tetsuo
Forum Champion
The 2d10 method I posted preserves the doubles aspect as well as separating the die rolls so that you or the power cards API can quickly parse the results. That method would be needed if you're going to use the Powercards API as it needs 2 unique die rolls, one for damage and one for hit location
1482196703

Edited 1482196959
Yeah, I see that now.  (embarassed face)
1482197138
Tetsuo
Forum Champion
I'll whip up a power cards script on my lunch break in 1.5 hours
1482211427

Edited 1482214759
Tetsuo
Forum Champion
Here you go! !power {{ --name|Attack --roll|[[ [$Roll1] {1d10-1}*10 + [$Roll2] {1d10-1}]] --?? $Roll1.base <> $Roll2.base ?? Damage|[^Roll1] --?? $Roll1.base == $Roll2.base ?? MAX DAMAGE|[[floor(?{skill level}*0.10)]] --?? $Roll2.base == 0 ?? Target|Head --?? $Roll2.base == 1 ?? Target|Left Chest --?? $Roll2.base == 2 ?? Target|Right Chest --?? $Roll2.base == 3 ?? Target|Abdomen --?? $Roll2.base == 4 ?? Target|Left Arm --?? $Roll2.base == 5 ?? Target|Right Arm --?? $Roll2.base == 6 ?? Target|Left Hand --?? $Roll2.base == 7 ?? Target|Right Hand --?? $Roll2,base == 8 ?? Target|Left Leg --?? $Roll2.base == 9 ?? Target|Right Leg }}
One tiny typo with the left leg, otherwise THIS WORKS PERFECTLY! Now that I see how its done, I should be able to code up the firearms rules myself. You, sir, are a scholar and a gentleman. Thanks so much for your help.
1482216105

Edited 1482216222
Tetsuo
Forum Champion
I caught that about 5 min after posting. I wrote this on my phone. So typos were expected