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

Making a spell Roll on a table

Is there a way to make a spell when cast roll on a table?
1478636775
The Aaron
Pro
API Scripter
I think you need to provide a bit more background.  Are you talking about a particular character sheet's spells?
1478637351
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
There's inline rolls: [[Xt[tableName] ]]; will only display the first result in the chat (others shown on mouse hover) unless you use a script to expand out the roll.
Ok so in our campaign Divine magic users are unable to always harness their powers, is it possible to have when they click a spell on the OGL sheet that the spell Rolls on a table to see if it can even be used or if it fails and then won't count against them for spell tracking. Spell tracking API is turned on. So I try to cast Cure wounds on Warrior and I have 50% chance spell will work and then 20% half as powerful, 20%Fail, 5% Wild magic, or 5% Max damage. I'm sure The Aaron recursive would allow for multiple tables if you had to roll on the wild magic table. Though I don't know how to get it to roll on the first table and not spend the spell slot if it fails.
1478639182
The Aaron
Pro
API Scripter
I think you can do all of that but the spell slot spending by just adding an inline rollable table reference somewhere (like Scott says), either in the spell title, or in some other sub field:
1478639336
The Aaron
Pro
API Scripter
As another Damage type works pretty well:
1478639420
The Aaron
Pro
API Scripter
Handling the spell slots is a different beast, not easily tackled. For wild Magic, I'd probably have a separate macro any player can call.  You could use Recursive Tables for that macro.
Thanks The Aaron and Scott I can always count on your amazing skillz to make great things happen.
1478722809

Edited 1478722836
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You could do the, "not use a spell slot unless successful" without a script by making an ability called "pray to the gods" which would roll on the table for the result and then have a spellbook of buttons at the bottom to cast the spell you were attempting. Example macro: &{template:atk} {{rname=Pray to the Gods for Assistance}} {{r1=[[1t[pray] ]]}} {{normal=1}} {{desc=[Cure Light Wounds](~details of your cure light wounds spell)...add the rest of your divine spells here as well. Can also organize them by spell level and probably have whether there is a use left or not displayed}} This is assuming that you are using the OGL 5e sheet. Use the atk template as it does some nice formatting of the ability command buttons.
That actually would be perfect. Because currently we have to do a Wisdom Check to cast a spell, could place the wisdom check at the front of this and then be able to click the spell if you are successful on finding the Wisdom to cast.