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

Tim's NPC Stat Block Mod (ScriptCards) D&D 5e 2014

1741919110

Edited 1754422869
**** New Version Available **** Hi All, This is my new Mod for displaying an NPC Stat Block in chat. It's for the D&amp;D 5E (2014) by Roll20 character sheet. It requires the Scriptcards API mod. ******This will work on 2024 content just not with the new beacon sheets**** What Does This Mod Do? This mod displays the selected token's NPC Stat Block in chat, it is displayed as closely to the 2014 monster manual stat block as I could get it. There are buttons for all Skills, Saves, Traits and Actions; including bonus, reaction, legendary and mythic actions. Installation Instructions This mod requires a custom template to be installed. To create a custom template, create a new character called "ScriptCards_TemplateMule" without the quotes, it is case sensitive. Then create two new abilities on the character. One called "Reset Templates" and put !sc-reloadtemplates as the macro(use this to reset templates any time you make a change to one.). For the second ability, name it "statblock" without the quotes. This is the template/style for the Mod. Add the code below: boxcode::{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&amp;quot</a>;) ; background-size: 100% 100% ; display: block ; text-align: left ; font-size: 12px ; padding-top: 1em ; font-family: serif ; font-style: normal ; line-height: 1.2em ;'}|| titlecode::{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot</a>;) !important ; background-size: 101% 4px ; width: 101% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: top ; position: relative ; top: -15px ; left: -3px'}{/div}{div style='margin: 0em .25em 0em .25em ; font-size: 24px ; font-variant: small-caps ; font-family: serif ; color: #6e2425 ; display: block ; font-weight: bold ; font-style: normal ; vertical-align: top ; position: relative ; top: -10px; left: 4px';}|| textcode::{/div}{div}{div style='color: #611b1c ; font-weight: normal; display: inline-block; margin: 0 1em 0 1em; vertical-align: top ; position: relative ; top: -10px';'}|| buttonwrapper::{div style='display: block ;'}{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot</a>;) !important ; background-size: 111% 4px ; width: 111% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: bottom ; position: relative ; bottom: -10px ; left: -14px'}{/div}|| buttonstyle::style='color: #611b1c ; background-color: transparent ; padding: 2px ; border: none'|| footer:: Run your Reset Templates&nbsp; Now create your new macro and add the code below: !Script{{ --/|Script Name : Tim's NPC Statblock Mod (Scriptcards) for D&amp;D 5E 2014 --/|Version : 2.2.0 --/|Author : Timothy Beasley --/|Description : This script displays an NPC statblock that mimics the 2014 Monster Manual in chat that has buttons for all --/| rolls; Skills, Saves, Traits, and Actions(bonus, reaction, Legendary, Mythic). --/| --/|Usage : This script is for the 2014 edition of the official D&amp;D 5E Character Sheet by Roll20 and requires the --/| installation of the ScriptCards MOD using a pro account with API access. --/| This script also requires the installation of a custom ScriptCards template. Instructions for installing --/| a custom style template can be found on the Roll20 wiki page for ScriptCards. The code for the scriptcard --/| template can be found in the post associated with this Script on the Roll20 forums below; --/| <a href="https://app.roll20.net/forum/post/12267264/tims-npc-stat-block-mod-scriptcards-d-and-d-5e-2014" rel="nofollow">https://app.roll20.net/forum/post/12267264/tims-npc-stat-block-mod-scriptcards-d-and-d-5e-2014</a> --/| or on my GitHub below as statblock.css; --/| <a href="https://github.com/VirulentArc/ScriptCards" rel="nofollow">https://github.com/VirulentArc/ScriptCards</a> --/| Make sure the template "macro" name is stablock or change #overridetemplate to whatever name you'd prefer --/| it to have. --#Debug|0 --#overridetemplate|statblock --#Whisper|self --#sourceToken|@{selected|token_id} --&amp;CharID|[*S:character_id] --#title|[*S:npc_name] --#emoteState|0 --?"[*S:npc_actype]" -ne ""|&amp;NPCactype;([*S:npc_actype]) --?"[*S:hp]" -ne ""|&amp;BaseHP; [*S:hp] / --&amp;Divider|[t][tr][td height=5px][/td][/tr][/t][t][tr][td width=100% style="border: none; border-top: 0.10em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.4em; display: block;"][/td][/tr][/t][t][tr][td height=5px][/td][/tr][/t] --&amp;Space|[t][tr][td height=8px][/td][/tr][/t] --&gt;BeforeActions| --~|array;define;SectionTypes;trait;action;bonusaction;reaction;action-l;action-m --%SectionLoop|foreach;SectionTypes --Rfirst|[&amp;CharID];repeating_npc[&amp;SectionLoop] --?"[*R:name]" -ne "NoRepeatingAttributeLoaded"|&gt;ActionLoop;[&amp;SectionLoop] --%| --&gt;SkillBlock| --~|array;delete;actionarray --X| --:BeforeActions| --&amp;HeaderBlock|[t width=100%] --&amp;HeaderBlock|+[tr][td][F::12][#000][i][*S:npc_type]&amp;nbsp;[/i][/#][/F][/td][/tr] --&amp;HeaderBlock|+[tr][td][&amp;Divider][/td][/tr] --&amp;HeaderBlock|+[tr][td][F::12][b]Armor&amp;nbsp;Class[/b]&amp;nbsp;[*S:npc_ac]&amp;nbsp;[&amp;NPCactype][br][/F][/td][/tr] --&amp;HeaderBlock|+[tr][td][F::12][b]Hit&amp;nbsp;Points[/b][&amp;BaseHP]&amp;nbsp;[*S:hp^]&amp;nbsp;([*S:npc_hpformula])[br][b]Speed[/b]&amp;nbsp;[*S:npc_speed][/F][/td][/tr][/t] --+|[&amp;HeaderBlock] --+|[&amp;Divider] --&amp;StatsBlock|[t width=106% style="text-align: center; position: relative ; left: -6px"][tr] --&amp;StatsBlock|+[td width=80px][F::14][b][button]STR&amp;nbsp;[*S:strength]&amp;nbsp;([*S:strength_mod])::~selected|npc_str[/button]&amp;nbsp;&amp;#124;[/b][/F][br][button]save::~selected|npc_str_save[/button][/td] --&amp;StatsBlock|+[td width=80px][F::14][b][button]DEX&amp;nbsp;[*S:dexterity]&amp;nbsp;([*S:dexterity_mod])::~selected|npc_dex[/button]&amp;nbsp;&amp;#124;[/b][/F][br][button]save::~selected|npc_dex_save[/button][/td] --&amp;StatsBlock|+[td width=80px][F::14][b][button]CON&amp;nbsp;[*S:constitution]&amp;nbsp;([*S:constitution_mod])::~selected|npc_con[/button][/b][/F][br][button]save::~selected|npc_con_save[/button][/td][/tr] --&amp;StatsBlock|+[tr][td width=80px][F::14][b][button]INT&amp;nbsp;[*S:intelligence]&amp;nbsp;([*S:intelligence_mod])::~selected|npc_int[/button]&amp;nbsp;&amp;#124;[/b][/F][br][button]save::~selected|npc_int_save[/button][/td] --&amp;StatsBlock|+[td width=80px][F::14][b][button]WIS&amp;nbsp;[*S:wisdom]&amp;nbsp;([*S:wisdom_mod])::~selected|npc_wis[/button]&amp;nbsp;&amp;#124;[/b][/F][br][button]save::~selected|npc_wis_save[/button][/td] --&amp;StatsBlock|+[td width=80px][F::14][b][button]CHA&amp;nbsp;[*S:charisma]&amp;nbsp;([*S:charisma_mod])::~selected|npc_cha[/button][/b][/F][br][button]save::~selected|npc_cha_save[/button][/td] --&amp;StatsBlock|+[/tr][/t] --+|[&amp;StatsBlock] --+|[&amp;Divider] --&amp;SecondBlock|[t width=100%][tr][td style="width: 240px ; display: block ; font-size: 12px ; "] --~|array;define;SaveArray;str;dex;con;int;wis;cha --%SaveLoop|foreach;SaveArray --?"[*S:npc_[&amp;SaveLoop]_save_base]" -gt 0|[ --~SaveTitle|string;totitlecase;[&amp;SaveLoop] --&amp;AddSave|+[&amp;SaveTitle]&amp;nbsp;[*S:npc_[&amp;SaveLoop]_save_base],&amp;nbsp; --]| --%| --?"[&amp;AddSave]" -ne ""|[ --&amp;SavingThrows|[b]Saving&amp;nbsp;Throws&amp;nbsp;[/b] --]| --=SecondBlockCalc|[&amp;AddSave(length)] - 7 --&amp;SecondBlock|+[&amp;SavingThrows][&amp;AddSave(0,[$SecondBlockCalc.Raw])][/td][/tr][/t] --+|[&amp;SecondBlock] --&amp;ThirdBlock|[t width=100%][tr][td style="width: 240px ; display: block ; font-size: 12px ; "] --~|array;define;SkillArray;acrobatics;animal_handling;arcana;athletics;history;insight;intimidation;investigation;medicine;nature;perception;performance;persuasion;religion;sleight_of_hand;stealth;survival --%SkillLoop|foreach;SkillArray --?"[*S:npc_[&amp;SkillLoop]_base]" -gt 0|[ --~SkillTitle|string;totitlecase;[&amp;SkillLoop] --&amp;AddSkill|+[&amp;SkillTitle]&amp;nbsp;[*S:npc_[&amp;SkillLoop]_base],&amp;nbsp; --]| --%| --?"[&amp;AddSkill]" -ne ""|[ --&amp;SkillHeading|[b]Skills&amp;nbsp;[/b] --]| --=ThirdBlockCalc|[&amp;AddSkill(length)] - 7 --&amp;ThirdBlock|+[&amp;SkillHeading][&amp;AddSkill(0,[$ThirdBlockCalc.Raw])][/td][/tr][/t] --+|[&amp;ThirdBlock] --#parameterDelimiter|$$$ --&amp;FourthBlock|[t width=100%] --?"[*S:npc_vulnerabilities]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Damage&amp;nbsp;Vulnerabilities[/b]&amp;nbsp;[*S:npc_vulnerabilities][/F][br][/td][/tr] --?"[*S:npc_resistances]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Damage&amp;nbsp;Resistances[/b]&amp;nbsp;[*S:npc_resistances][/F][br][/td][/tr] --?"[*S:npc_immunities]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Damage&amp;nbsp;Immunities[/b]&amp;nbsp;[*S:npc_immunities][/F][br][/td][/tr] --?"[*S:npc_condition_immunities]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Conditions&amp;nbsp;Immunities[/b]&amp;nbsp;[*S:npc_condition_immunities][/F][br][/td][/tr] --?"[*S:npc_senses]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Senses[/b]&amp;nbsp;[*S:npc_senses][/F][br][/td][/tr] --?"[*S:npc_languages]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Languages[/b]&amp;nbsp;[*S:npc_languages][/F][br][/td][/tr] --?"[*S:npc_challenge]" -ne ""|&amp;FourthBlock$$$+[tr][td][F::12][b]Challenge[/b]&amp;nbsp;[*S:npc_challenge]&amp;nbsp;[*S:npc_xp]xp[/F][br][/td][/tr] --?"[*S:npc_pb]" -ne 0|&amp;FourthBlock$$$+[tr][td][F::12][b]Proficiency Bonus[/b]&amp;nbsp;[*S:npc_pb][/F][br][/td][/tr] --#parameterDelimiter|; --&amp;FourthBlock|+[/t] --+|[&amp;FourthBlock] --+|[&amp;Divider] --&lt;| --:ActionLoop| --&amp;Action|[%1%] --?"[&amp;Action]" -eq "action-l"|&amp;ActionName;Legendary Action|&amp;ActionName;[&amp;Action] --?"[&amp;Action]" -eq "action-m"|&amp;ActionName;Mythic Action --&amp;ActionOutput|[t width=100%] --?"[&amp;Action]" -ne "trait"|&amp;ActionOutput;+[tr][td][F::20][&amp;ActionName(totitlecase)]s[/F][hr #922610][/td][/tr] --?"[&amp;Action]" -inc "action-l"|[ --&amp;ActionOutput|+[tr][td][F::12][#000][*S:npc_legendary_actions_desc][/#][/F][/td][/tr] --]| --?"[&amp;Action]" -inc "action-m"|[ --&amp;ActionOutput|+[tr][td][F::12][#000]@{selected|npc_mythic_actions_desc}[/#][/F][/td][/tr] --]| --~|array;fromrepeatingsection;actionarray;[&amp;CharID];repeating_npc[&amp;Action];name --%ActionLoop|foreach;actionarray --Rfind|[&amp;CharID];[&amp;ActionLoop];repeating_npc[&amp;Action];name --?"[&amp;Action]" -eq "reaction" -or "[&amp;Action]" -eq "trait"|&amp;ButtonURL;[*R&gt;npc_roll_output]|&amp;ButtonURL;[*R&gt;npc_action] --#parameterDelimiter|$$$ --?"[&amp;Action]" -eq "trait"|&amp;ButtonEmote$$$&amp;#x1F4DC;|&amp;ButtonEmote$$$&amp;#x2694;&amp;#xfe0f; --#parameterDelimiter|; --&amp;ToolTip|[*R:name]|[*R:description] --?"[*R:name]X" -ne "X"|[ --&amp;ActionOutput|+[tr][td title="[&amp;ToolTip]" style="width: 200px ; display: inline-block ; white-space: nowrap ; overflow: hidden ; text-overflow: ellipsis ; color: #000 ; font-weight: bold ; "][i][*R:name][/i][/td][td style="width: 40px ; display: inline-block ; text-align: right ; "][F::14]|[sheetbutton][&amp;ButtonEmote]::@{selected|character_name}::[&amp;ButtonURL][/sheetbutton]|[/F][/td][/tr] --]| --%| --&amp;ActionOutput|+[/t] --+|[&amp;ActionOutput] --+|[&amp;Space] --&lt;| --:SkillBlock| --+|[hr #922610] --&amp;SkillOutput|[t width=100% style="text-align: center ; "] --&amp;SkillOutput|+[tr][td][button]Acrobatics::~selected|npc_Acrobatics[/button]&amp;nbsp;|&amp;nbsp;[button]Animal Handling::~selected|npc_Animal_Handling[/button]&amp;nbsp;|&amp;nbsp;[button]Arcana::~selected|npc_Arcana[/button][/td][/tr] --&amp;SkillOutput|+[tr][td][button]Athletics::~selected|npc_Athletics[/button]&amp;nbsp;|&amp;nbsp;[button]History::~selected|npc_History[/button]&amp;nbsp;|&amp;nbsp;[button]Insight::~selected|npc_Insight[/button]&amp;nbsp;|&amp;nbsp;[button]Intimidation::~selected|npc_intimidation[/button][/td][/tr] --&amp;SkillOutput|+[tr][td][button]Investigation::~selected|npc_Investigation[/button]&amp;nbsp;|&amp;nbsp;[button]Medicine::~selected|npc_Medicine[/button]&amp;nbsp;|&amp;nbsp;[button]Nature::~selected|npc_Nature[/button]&amp;nbsp;|&amp;nbsp;[button]Perception::~selected|npc_Perception[/button][/td][/tr] --&amp;SkillOutput|+[tr][td][button]Performace::~selected|npc_Performance[/button]&amp;nbsp;|&amp;nbsp;[button]Persuasion::~selected|npc_Persuasion[/button]&amp;nbsp;|&amp;nbsp;[button]Religion::~selected|npc_Religion[/button][/td][/tr] --&amp;SkillOutput|+[tr][td][button]Sleight of Hand::~selected|npc_Sleight_of_Hand[/button]&amp;nbsp;|&amp;nbsp;[button]Stealth::~selected|npc_Stealth[/button]&amp;nbsp;|&amp;nbsp;[button]Survivial::~selected|npc_Survival[/button][/td][/tr] --+|[&amp;SkillOutput] --&lt;| --X| }} 2025-03-24 Updated to include conditional to check if resource exists but is blank, do not output. 2025-03-30 Updated to remove the red line image and replace it with inline css. statblock style needs to be updated as well, don't forget to reset your templates. 2025-04-03 Updated to 1.1.0, formatting overhaul, just for consistency across platforms and browsers and fixes formatting problems with the bottom bar widening the longer the statblock is. Not a necessary update if what you're using is working for you. If you do update, also replace template code and reset your templates. 2025-04-06 Updated to 1.1.1. Found and fixed a bug with Skills and Saves. If there were multiple of any of them it completely broke the statblock. Did a bunch of complicated(for me) stuff to fix it. Also changed the size of the title a fraction, so update and reset templates as well.&nbsp; 2025-04-14 Updated to 2.0.0. Did a rewrite to create a dynamic loop that displays all different actions. Reduced the overall code by about a quarter. 2025-04-14 Updated to 2.0.1. Found a formatting bug, if the NPC has a double digit attribute bonus it didn't fit and broke the formatting. Other small bug fixes. 2025-05-05 Updated to 2.0.2 All action buttons were being output as the first action. Added the button string to the loop. 2025-05-06 Updated to 2.1.0 Consolidated Traits subroutine into Actions subroutine, reducing code size. Not a necessary update if you don't want to, function is the same just reduced size. 2025-07-17 Updated to 2.2.0 Minor HTML bug fix, missing opening table tag in fourth block. Reduced API calls by 90%.
1741919843

Edited 1744662521
The forum code boxes are acting up, so I'll continue in a new reply, I would really appreciate feedback, I don't think I missed anything, but I did please let me know. Thanks.
1741962454
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's gorgeous! Great work!
1742063801

Edited 1745029397
Thanks Keith! I should point out that the images used are not mine, they are actually the images used in the compendium. Which is actually pretty convenient for me, cause then I don't have to find a place to upload them and maintain them. As long as Roll20 doesn't delete them, for some reason, they'll be there "forever". EDIT: With the exception of the tapered divider line, that image is in my github. I couldn't figure out how to add the css to the horizontal rule as inline css, so I had to use an image.
Updated the statblock theme to reduce line height by a tiny fraction. Won't affect too much with this Mod, but will with future Mod releases that use the same theme.
Just updated to version 1.0.1. Nothing major, just adding a conditional to see if a repeating resource exists and is blank, don't output. This is really just to make it more compatible with my existing summon Mods, as depending on the NPC summon, some repeating resources might be blank and so there's button that shows that does nothing.
1743376170

Edited 1743376495
Updated to version 1.0.2. I figured out how to do the inline CSS for the divider and so no longer require an image. I'll keep the image up on my github for anyone using this that doesn't update. EDIT: Also update the statblock css, the divider threw off some of the layout. Don't forget to reset your templates.
1743662306

Edited 1743662656
Updated to version 1.1.0. It's a formatting update with static rules to avoid formatting breaking(the bottom bar would grow the longer the NPC statblock is you're viewing). If you're using this Mod and it's working for you, it's not absolutely necessary to update. If you do decide to update, also update the template code and restart your templates or the bottom bar will appear too wide.
Updated to version 1.1.1. The Saves and Skills section were completely broken, I hadn't tested on an NPC with multiple of either and so didn't know that it completely broke the statblock if that was the case. A lot of bashing my head against a wall with this one. If you are using this Mod I would suggest updated as you'll find very quickly how broken those sections are if you use certain NPC's. Update and reset template as well. Also, I didn't know this as I haven't really used the 2024 character sheet stuff yet, but the 2024 NPC's are still using the old character sheets. That means, for the time being anyway, this is compatible with the 2024 content.
Updated to 2.0.0. For some reason I found it necessary to do a rewrite of a major part of this Mod. It now uses a single subroutine with a dynamic parameter rather then a subroutine for each action.
Updated to 2.0.1. Sorry, don't mean to spam this thread repeatedly with updates, but I found a formatting bug. If the NPC's attribute bonus is in the double digits it didn't fit and broke formatting. Added a conditional for repeating sections that exist but are empty, only really applies to very rare occasions.
Updated to 2.0.2. Somehow I added the string for the buttons before the loop, so every action button was the button for the first action in the list. Just had to move it three lines down and it works properly.
1746577760

Edited 1746577802
Updated to 2.1.0 I need to stop looking at my existing mods, because I keep doing rewrites... Removed the traits subroutine and added it to actions subroutine to reduce overall size of script. There isn't necessarily any need to update from previous, also doesn't hurt to do it. Also a general code cleanup.