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 .
×

Macro Assistance

1555830470

Edited 1555831025
I am trying to think of a way to macro this but it has so many variables I am wondering if it is even possible to macro properly. Shadow's Bane 2nd-level Evocation Casting Time: 1 action Range: 60 feet Components: V, S, M Duration: Instant You wield the shadows as a scourge against your foes. Roll a spell attack against your opponent, who receives the effect below if you hit, or half damage on a miss. For this roll, ignore concealment due to dim light, but not total darkness. The result varies based on the current lighting conditions.     • Full daylight: 5d10     • Bright light, indoors: 5d8     • Some type of light(spell, torch, etc.) covers some part of the opponent: 5d8     • Dim light: 5d6     • Total darkness: 5d4 At Higher Levels when you cast this spell using a spell slot of 3rd level or higher, the spell’s damage increases by one die of the appropriate type for each slot level above 2nd.
1555831682
GiGs
Pro
Sheet Author
API Scripter
There are some things you cant do with a macro. You cant have conditional effects, like the half damage on fail. You have to handle that manually. Your description above doesnt say how you want the output. Do you want all that casting time,range, etc in the printout? Nor do you say how the attack roll is made. But the important thing is the damage roll, and here's how you do that: Method 1: Normal roll /roll [[{1,?{Level Slot?|1}-1}kh1+4]]d?{Lighting?|Daylight,10|Bright,8|Dim,6|Dark,4} Method 2: Inline Roll [[ [[{1,?{Level Slot?|1}-1}kh1+4]]d?{Lighting?|Daylight,10|Bright,8|Dim,6|Dark,4} ]] I havent tested it, so i may have a minor syntax error, but the basic principle is sound. The trick to solving this is that roll20 completes queries first, so you can build a dice roll from parts. Breaking down the first roll above: We know the number of dice has a minimum of 5, and increases by 1 level above 2. This means level 1 and 2 are the same. We can use the Keep Highest group to simulate this. First {1, Level-1}kh1 says take level -1, or 1, whichever is highest. That means level 1 and 2 are the same, and 3+ increase by 1 per level. Then we need to add a modifier to make the lowest level (1) match the spell output (5), so thats +4, giving us  {1,?{Level Slot?|1}-1}kh1+4 I then wrapped it in inline roll brackets [[ ]]  so that in the printout, you dont see that full calculation, just the number of dice. Then the Lighting is a simple query, and putting the two together, with a d between them, gives us a dice roll.
1555832630

Edited 1555832673
The damage is all I am concerned about as I dont want to automate every thing, just adding in a dice based off of spell level and the rolls based off of lighting were well beyond my macro capacity. I can manage the spell attack roll however.
Thank you very much that damage, calculator is working flawlessly.
1555834252
GiGs
Pro
Sheet Author
API Scripter
Great! :)