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

Mostly cause I was bored... I improved the auto-damage script for single target attacks [5e OGL] (An update to the script posted by the amazing Sky

1620458685

Edited 1620461397
So, I really wanted to have a way for my players to click on an attack, click on an enemy, and have it roll an attack and automatically apply it against the AC of the enemy, and automatically do damage. Basically taking the numbers out of the system so my players can focus more on the good stuff. Unfortunately, there didn't seem to be a lot of good solutions to this problem, but I did find this old post by Sky . The script was good, but not perfect, so I set out to try and update it with some more features to make it a great all in 1 tool for combat. My main changes to the above script are as follows: 1. I added in global damage modifiers to the auto-damage tracking. This will help keep track of sneak attack/hunter's mark damage. 2. Added in single target spell DC rolls. The target will automatically make a saving throw vs the DC of the spell. In order for this to work you must have either "no damage" or "half damage" in the spell's save effect spot. 3. Resistance, Vulnerability, and Immunity. Added in functionality for all 3. For this to work on your PC's, you must add attributes on their character sheet called: "npc_resistances", "npc_immunities ", " npc_vulnerabilities ". These are automatically added on NPC's, so you should only have to add these onto your player's characters. Beyond that, if your weapon is magical, make sure to change the damage type to include magical (EX. "slashing magical" instead of "slashing") for the purpose of overcoming resistance. Sneak attack and hunter's mark damage should be marked as "Sneak" and "Hunter" respectively, for their damage to be autocalculated using their weapon's damage type. Other Requirements: 1. You need Sky's AlterBar's Script 2. In the description of each attack, you need to put the following:  [[@{target|npc} [ID @{target||token_id}] ]] This will ensure that the item has the damage tracking on it. 3. You must have it set to autoroll damage on the character sheet. This setting can be found under the cog wheel in the top right corner.  4. I have it set to change bar 3, as I use that for health on npc and players. If you want to use a different bar change it in the Javascript, look for where it says bar3. You will have to have both NPC and PC tokens using the same bar as their heath, whichever you choose. Again, big thanks to Sky for creating the original, I'm just improving and updating it a bit for more campaigns. Also I know its ugly, and probably has bugs but I'm tired and it's mostly functional so I wanted to post it anyways so others can mess with it. Find it here .
Update: Added in automatic concentration rolls if the token is marked with the stopwatch token marker, as well as the ability to self target. This came up when testing it during my last session as an enemy used darkness, so the could not target the token, and they couldn't roll then. In a scenario like this, they can now target their own token and it will roll without modifying the token's health.
Update: Fixed damage from higher level casts not being added.
Update: added in tracking for healing spells. Just add in the same code to the description as attacks, and make sure that damage type is set to "Healing". Can also target self with healing spells.
1626113933

Edited 1626114052
Surok
Roll20 Production Team
API Scripter
Can you post how this looks like in game? I'm having a hard time seeing how all the parts come together. What macro do I use in the part for the Alterbar API?