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

5e NPC Character Sheet Attribute in Damage (and AC)

1670431749
Erik O.
Pro
API Scripter
Hi there! I’ve created two NPCs for my cleric to control when they cast Summon Celestial. The trouble is that a few abilities of the summoned creature are affected by the level at which the spell was cast. The biggest issue for me is that damage dealt by both forms is <roll>+2+<spell_level>. I can’t remember now if I added the spell_level attribute, or if it was already there, but I’ve tried to use it in damage rolls, to no avail. The damage rolls seem to strip out or ignore square brackets and @{spell_level} macros in its computation and rolls. For example the damage for the Radiant Bow on the Celestial Avenger lists as 9 (2d6+2+@{spell_level}) even when spell_level is set to 5, and I can’t seem to get it to compute the value using the spell_level attribute. Am I missing something obvious, or is this just not possible? (I’d also love to do the same for AC and to pull the to hit roll from the controlling character‘s spell attack bonus, but I can work around those for now.) Thanks!
1670456217
Gauss
Forum Champion
Which character sheet is being used? 
1670457102
Erik O.
Pro
API Scripter
Oh, sorry, I thought I specified: “D&D 5E by Roll20“ but this is on the simplified NPC sheet, if that matters.
1670465508

Edited 1670465684
Gauss
Forum Champion
Damage : You can put in a query so that every time you make an attack it asks what damage you want to use.  However, there is no way I know of short of an API script (which as a Pro you have access to) to call for the spell level you used when you cast the spell.  If you do want to go the API scripting route, the simplest method would be to do the following:  1) Create an Attribute on your main character sheet. Call it "Summon Celestial" or something.  2) When you cast the spell, use the same query to push a change (this is the API script part) to the Attribute which lists the spell level.  The query is:  ?{Cast at what level?|Level 5,5|Level 6,6|Level 7,7|Level 8,8|Level 9,9} 3) On the Celestial, put the damage formula as 2d6+2+@{charname|attributename} (where charname is the name of the character with the attribute, presumably the spell caster, and attributename is the name of the attribute.  Spell Attack bonus is very simple: @{charname|spell_attack_bonus} AC : This cannot be automated without using API scripts again. This is because the NPC sheet's AC is not calculated, it is just written down.  However, the API can do a calculation and push the value to the attribute "npc_ac" (without quotes).  The calculation is 11+@{charname|attributename} (the attribute you created for the Damage calculation) Then the API takes that attribute and the 11, does the math, and then pushes the value to the npc_ac attribute.  Regarding which API script to use, someone else will need to advise you there, I only use a couple of them and I don't come up with them. :)
1670682264

Edited 1670682340
What i did for my player is as such :  I created one character named celestial spirit <name of the player> copied from celestial spirit and i use spawn to have it appear on the board Here's the spawn script that gets the right calculations :  !Spawn {{ --name| Celestial Spirit Arnaud --offset| 2,0 --size|2,2 --bar1| [[40 + (10*?{What spell level?|5|6|7|8|9})-50]] --bar2| [[11 + ?{What spell level?} + ?{Defender bonus?|0}]] --bar3| [[0 + ?{What spell level?}]] }} where bar 1 is HP, bar 2 is AC, and bar3 is the spell level (used for the rest of the calculations in the character sheet) Then, you can enter the atk bonus and dmg formulas etc .. in the character sheet and record the character sheet of that npc as default token. hope that helps.
1671156365

Edited 1671156426
Erik O.
Pro
API Scripter
Thanks for your help! @Gauss: I added an attribute on the Celestial itself, but did not include the character name. I thought this did not work, because the average damage listed in the description is wrong ( Hit: 9 (2d6+2+@{Celestial Avenger|spell_level}) radiant damage). The same is true with the character object name and without. That’s what prompted me to ask the question in the forum. HOWEVER , I happened to click it and discovered that while the description is wrong, the actual damage rolled is correct!  (With and without the character specified, since it defaults to the current one, that makes sense) I can live without the AC change, TBH, it was mostly just needing the damage rolls to be correct. Thank you both! If I want to get it exactly right I might write a script to automatically update the AC in the character when cast.