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

Colossus Slayer Macro

Hey all, Since I have 0 macro skills and been trying to make a macro to add to attacks for the colossus slayer which only applies when the lower than max hp for the target is met, I have come up with the following, which does not seem to work right. [[1d8]] Col. Slayer + (On crit [[1d8]])@{target|HP<HP_max} I have it added to the Class Actions and applied to all attacks, just hoping that this will mean the dice only roll when the target HP is less than the max. Firstly I guess I am wondering if it can work like that at all, and secondly, if it can, can one of you out there with a much better understanding of the macro coding clean up the mess I have created above...after you finish cringing, laughing, or both... Thanks Whick
(For reference this is specific to 5th Edition D&D. Only the Weapon Dice get added on a crit, btw. Colossal Killer would always be 1d8 once per round) Honestly; I just put the Colossus added damage on its own line via the {{freetext=}} attribute, to be visually added in when appropriate. &{template:5eDefault} {{weapon=1}} {{title=Silver Long Sword}} {{subheader=@{Selected|Token_Name}}} {{subheaderright=Two Strikes}} {{attack=[[ 1d20ro1 + @{STR}[STR] + @{Prof}[Prof] ]]}} {{attackadv=[[ 1d20ro1 + @{STR}[STR] + @{Prof}[Prof] ]]}} {{damage=[[ 1d8 + @{STR}[STR] ]]}} {{critdamage=[[1d8]] Addt'l Dmg}}}{{spellshowattack=1}}{{spellattack=[[ 1d20ro1+ @{STR}[STR + @{Prof}[Prof] ]]}} {{spellshowattackadv=1}}{{spellattackadv=[[ 1d20ro1 + @{STR}[STR] + @{Prof}[Prof] ]]}}{{spellshowdamage=1}}{{spelldamage=[[ 1d8 + @{STR}[STR] ]] }}{{spellcancrit=1}}{{spellcritdamage=[[1d8]] Addt'l Dmg}} {{freetext=**Colossal Killer:** [[1d8]] (if injured) **Hunter's Mark:** [[1d6]]}} I tend to stay away from targeting a token's HP both as player and GM, for gameplay purposes rather than technical. I don't generally want players to know how many HP something has.
1434120062

Edited 1434134452
The Aaron
Roll20 Production Team
API Scripter
I'll explain how you could accomplish this because it is a useful technique across many possible problems. You need to pursue a more complicated equation, a summation of terms where you would multiple by either 1 or 0 to turn on certain terms. For example, assuming hit points are in bar3 of the token: Damage: [[ 2d6 + (1d8 * [[ (@{target|Enemy?|bar3|max}-@{target|Enemy?|bar3})d1kl1 ]] [Colossus Slayer]) ]] This will add the result of 1d8 in the case where the target has less than max hit points. The important part is this nested inline roll: [[ (@{target|Enemy?|bar3|max}-@{target|Enemy?|bar3})d1kl1 ]] Explained in parts: @{target|Enemy?|bar3|max}-@{target|Enemy?|bar3} This equation will take the difference between the max hit points and current hit points of the target. It will be a 0 if they are at max hit points, or some positive integer if they have taken damage. (...0 or more...)d1kl1 This part then rolls that many d1's, resulting in either a 0 (in the case of 0d1) or some number of 1s based on the difference. The kl1 part will keep the lowest value (a 0 for no difference, a 1 if there is one). The practical upshot being that this nested inline roll will be 0 when the creature is at max health, and 1 when it is not.
1434120131

Edited 1434120258
Ziechael
Forum Champion
Sheet Author
API Scripter
A simple macro solution would be to add a query which would activate the extra damage or not: [[ <normal damage macro> + ?{Target already wounded? (1 for yes)|0}d8]] damage. The macro then prompts you to supply a 1 if you are attacking something that qualifies for the ability, the default zero simply prevents it from adding the extra d8 damage. This also works for multiple attacks per round since colossal slayer only works once per round i believe. Hope that helps? edit - Ha! was trying to get the 0 or 1 result for ages before i gave in and suggested a query instead... at least mine can be applied for managing multiple attacks per round ;)
Thanks all for your replies. Mark G., I think yours is a little too complex for me at this point, but I see what you have done thanks to the screenshot you added. If I was creating my own sheet and not using the supplied dnd 5e one I would figure how to rework it for the character weapons. A more enlightened friend said the coding is "pretty", I think that is a good thing. The Aaron, that is what I was looking for, now just to make sure I use the same bar (bar 1 so far) for HP for each monster, so that it works, but I can make sure that happens. Changed it to Damage: [[ (1d8 * [[ (@{target|Enemy?|bar1|max}-@{target|Enemy?|bar1})d1kl1 ]] [Colossus Slayer]) ]] since I am using it at the class actions section and the main weapon damage is already there from the weapon macro on the sheet. Works great. Ziechael, yours is simple and would work great too, get a pop up with Aaron's or yours. Will give my players the choice of either when they need something similar. Thanks again for your quick and awesome help. Whick
1434162085
The Aaron
Roll20 Production Team
API Scripter
No problem! :). Happy rolling!
1434227072
Kryx
Pro
Sheet Author
API Scripter
Mark G. said: Hunters mark would apply twice - once for each attack. IMO it's much easier to just roll each attack individually and just add hunter's mark as a class action. You could also add a colossus slayer class action or separate macro.
Good point. This is from a character that won't see gameplay for another week :) thankyou for the heads up