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

Macro Query Token HP

I'm attempting to create a macro for Toll of the Dead and would like to know if it's possible to do check HP so that if damaged it rolls the correct dice. I have a simple macro that queries myself to give a yes or no. I just started playing around with macro's so forgive the crude nature of the macro lacking a template or anything of real substance lol i.e. /em raises is hand and points, the sound of a dolorous bell fills the air around the target. **Spell DC @{Manshune|spell_save_dc}** ***Wisdom Save*** if successful *negates* damage. Otherwise take ?{Damaged?| No, [[1d8]] |Yes,[[1d12]] } damage. I would like to be able to do something more dynamic to query the enemy token to see if it is missing HP so I'm not required to constantly ask the DM.
1532732938

Edited 1532733620
Vanakoji
KS Backer
[[[[{@{target|Target|bar1} + 1d0}<[[@{target|Target|bar1|max}-1]]]] * [[ceil( [[(@{level} + 2) / 6]])]]d12 + [[{@{target|Target|bar1} + 1d0}>@{target|Target|bar1|max}]]*[[ceil((@{level} + 2) / 6)]]d8]] Autocalculates the number of dice to roll based of level (note using shaped sheet, no idea on others) [[ [[ {@{target|Target|bar1} + 1d0}<[[@{target|Target|bar1|max}-1]] ]] * 1d12 + [[{@{target|Target|bar1} + 1d0}>@{target|Target|bar1|max}]] * 1d8]] with doing the numbers yourself
1532733365
Ziechael
Forum Champion
Sheet Author
API Scripter
Depending on how you store HP in your game you could do a bit of max value success checking: Otherwise take [[ 1d[[8 + {1d1 + @{target|Target|hitpoints}}<@{target|Target|hitpoints|max}*4]] ]] damage.
Vanakoji said: [[[[{@{target|Target|bar1} + 1d0}<[[@{target|Target|bar1|max}-1]]]] * [[ceil( [[(@{level} + 2) / 6]])]]d12 + [[{@{target|Target|bar1} + 1d0}>@{target|Target|bar1|max}]]*[[ceil((@{level} + 2) / 6)]]d8]] Autocalculates the number of dice to roll based of level (note using shaped sheet, no idea on others) [[ [[ {@{target|Target|bar1} + 1d0}<[[@{target|Target|bar1|max}-1]] ]] * 1d12 + [[{@{target|Target|bar1} + 1d0}>@{target|Target|bar1|max}]] * 1d8]] with doing the numbers yourself I'll have to see if I can tweak this for the OGL sheet thanks! I still don't really understand the syntax for the complicated macro's yet I've only been reading up on them and testing them for 1 day. Ziechael said: Depending on how you store HP in your game you could do a bit of max value success checking: Otherwise take [[ 1d[[8 + {1d1 + @{target|Target|hitpoints}}<@{target|Target|hitpoints|max}*4]] ]] damage. I'll have to ask the DM how he's storing HP because I tested this and got this error "No attribute was found for targeted token by the name of hitpoints"  Thanks!
1532762677

Edited 1532763121
Ziechael
Forum Champion
Sheet Author
API Scripter
Oh, if you want it for the 5E OGL you run into PC v NPC and mook issues, Vanakoji's suggestion of referencing the hit point bar of a token is likely best: Otherwise take [[ 1d[[8 + {1d1 + @{target|Target|bar1}}<@{target|Target|bar1|max}*4]] ]] damage.