macro for shocking grasp

So ive done a bunch of searching but nothing i have found gives me the result im lookin for i have 0 clue how macros works but im trying. I know that i can call my class lvl using [[@{Phoebus|spellclass-0-level-total}]] but i was wondering if there was a way to use that in a macro to roll for shocking grasp from pathfinder. Im not sure how to floor or ceil things. I only have a free account but i wanted to learn enough to be able to set this up for my friends and maybe edit it enough for other spells. If anyone could help that would be awesome. im gonna post the thing i have found but that dont seem to be exactly what im lookin for /r 1d8+ [[@{Phoebus|spellclass-0-level-total}]]-([[@{Phoebus|spellclass-0-level-total}]]-5)*[[(floor(1/(floor([[@{Phoebus|spellclass-0-level-total}]]/5)+1))-1)*(floor(1/(floor([[@{Phoebus|spellclass-0-level-total}]]/5)+1))-1)]]
1541740185

Edited 1541796827
Noon
Pro
What you're actually looking for is this  https://wiki.roll20.net/Dice_Reference#Grouped_Roll_Modifiers   From what I understand, you want to roll 1d6 per class level of the character up to 5d6 at level 5 as per this . To do this you need a couple steps. Get class level ( @{Phoebus|spellclass-0-level-total} ) Use class level if lower than 5, otherwise use 5 ( [[{@{Phoebus|spellclass-0-level-total}, 5}kl1]] ) Roll that many d6s ( [[[[{@{Phoebus|spellclass-0-level-total}, 5}kl1]]d6]] ) So [[[[{@{Phoebus|spellclass-0-level-total}, 5}kl1]]d6]] should do what you're looking for. Here's it all expanded so you can see better what each step is doing. [[ [[ { @{Phoebus|spellclass-0-level-total}, 5 }kl1 ]]d6 ]] kl1 tells the parser to pick (1) value that is the lowest in the list of {@{Phoebus|spellclass-0-level-total}, 5} This value is then returned by closing it around [[ ]] so that the parser doesn't mistake the d6 for part of it's modifiers. Then the whole thing is wrapped in another inline roll [[ ]] so you don't have to use /r to use it. You can use /w gm or whatever. Try each part individually. If you want to experiment with your own values without modifying your character sheet, replace @{Phoebus|spellclass-0-level-total} with ?{level} and you can enter in whatever and see how it changes things. Also, floor and ceil are for decimals. [[ floor(5.6) ]] will return 5. [[ ceil(5.6) ]] will return 6.
That works for me if the char lvl is lower than 5 but its not capping at 5 but thank you for explaining all this for me it makes sense explained like that. Thank you for getting the first half to work.
1541749357

Edited 1541749580
Vince
Pro
Sheet Author
derek m. said: That works for me if the char lvl is lower than 5 but its not capping at 5 but thank you for explaining all this for me it makes sense explained like that. Thank you for getting the first half to work. change this [[[[@{Phoebus|spellclass-0-level-total}, 5}kl1]]d6]] to [[[[ { @{Phoebus|spellclass-0-level-total}, 5}kl1]]d6]] it was just missing "{" you also might add a query for metal armor... [[[[{@{Phoebus|spellclass-0-level-total}, 5}kl1]]d6 +?{Metal Armor?|no,0|yes,3}]]
Awesome works like a charm. Im glad you brought up the query that was my next thing to try to figure out. My pathfinder group will thank you long time. Now im sure i can figure out how to modify this for many other spells. Yay!!
1541796794
Noon
Pro
Thanks Vince. I could have swore I fixed that typo specifically. My mistake.