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

how to create a percentage macro?

October 13 (4 years ago)

Hello everyone. I wonder if there is how to create an attack macro with these functions in 5e? 1d20 + Mod + Proficiency + or - 20%, 50%, 90% and so on, making players less likely to hit their opponent.

For example, an enemy from 18 BC and the player rolls the die and from 19 and his weapon is a cutting type, but the enemy has + 20% resistance to cutting damage, so he would take 19-20%, so the account would be 19 * 20/100 = 3.8 so his 19 drops to 16, so if you have a way to do this in macro with api or without api, could you help me?


PS: I'm sorry if I have an error I'm not a native

October 13 (4 years ago)
Oosh
Sheet Author
API Scripter

Is the Resistance stored as an Attribute, or entered as a Query? You could do something like this, with example rolls:

[[ [[(1d20 + ?{Attack Bonus|5}[ATK]]])*(1-?{Enemy Resistance %|0}/100)]]

or you could output all the information from the roll:

&{template:default} [[ floor([[1d20 + ?{Attack Bonus|5}[ATK]]]*(1-?{Enemy Resistance %|0}/100)) ]] {{name=Attack Roll}} {{Base Attack=$[[0]]}} {{Resistance=?{Enemy Resistance %}%}} {{Final Roll=$[[1]]}}
October 13 (4 years ago)


Oosh said:

Is the Resistance stored as an Attribute, or entered as a Query? You could do something like this, with example rolls:

[[ [[(1d20 + ?{Attack Bonus|5}[ATK]]])*(1-?{Enemy Resistance %|0}/100)]]

or you could output all the information from the roll:

&{template:default} [[ floor([[1d20 + ?{Attack Bonus|5}[ATK]]]*(1-?{Enemy Resistance %|0}/100)) ]] {{name=Attack Roll}} {{Base Attack=$[[0]]}} {{Resistance=?{Enemy Resistance %}%}} {{Final Roll=$[[1]]}}

thank you friend. in this macro would you like to put amount of attack in a choice box, to make the player choose how many times he attacks so that the screen is very polluted?