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

March 14 (2 weeks ago)

Edited March 30 (2 days ago)

Hi All,

This is my new Mod for displaying an NPC Stat Block in chat. It's for the D&D 5E (2014) by Roll20 character sheet. It requires the Scriptcards API mod.

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("https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png") ; background-size: 100% 100% ; display: block ; text-align: left ; font-size: 12px ; padding-top: 1em ; font-family: "bookmania" , serif ;  font-style: normal ; line-height: 1.2em ;'}||

titlecode::{div style='background-image: url("https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png") !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: 26px ; font-variant: small-caps ; font-family: "mrseavessmallcaps" , "monsterrat" , 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("https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png") !important ; background-size: 113% 4px ; width: 113% ; 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 

Now create your new macro and add the code below:

!Script{{

  --/|Script Name : Tim's NPC Statblock Mod (Scriptcards) for D&D 5E 2014
  --/|Version     : 1.0.2
  --/|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&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;
  --/|              https://app.roll20.net/forum/post/12267264/tims-npc-stat-block-mod-scriptcards-d-and-d-5e-2014
  --/|              or on my GitHub below as statblock.css;
  --/|              https://github.com/VirulentArc/ScriptCards
  --/|              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
  --#title|@{selected|npc_name}
  --&SourceChar|@{selected|character_id}
  --&obrac|{
  --&cbrac|}
  --&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]

  --?"@{selected|npc_actype}" -ne ""|&NPCactype;(@{selected|npc_actype})
  --+|[F::12][#000][i]@{selected|npc_type} [/i][/#][/F]
  --+|[&Divider]
  --+|[F::12][b]Armor Class[/b] @{selected|npc_ac} [&NPCactype][br][/F]
  --?"@{selected|hp}" -ne ""|&BaseHP; @{selected|hp} /
  --+|[F::12][b]Hit Points[/b][&BaseHP] @{selected|hp|max} (@{selected|npc_hpformula})[br][b]Speed[/b] @{selected|npc_speed}[/F]
  --+|[&Divider]

  --&SkillBlock|[c][t width=100%][tr]
  --&SkillBlock|+[td][F::14][b][button]STR @{selected|strength} (@{selected|strength_mod})::~selected|npc_str[/button] |[/b][/F][br][button]save::~selected|npc_str_save[/button][/td]
  --&SkillBlock|+[td][F::14][b][button]DEX @{selected|dexterity} (@{selected|dexterity_mod})::~selected|npc_dex[/button] |[/b][/F][br][button]save::~selected|npc_dex_save[/button][/td]
  --&SkillBlock|+[td][F::14][b][button]CON @{selected|constitution} (@{selected|constitution_mod})::~selected|npc_con[/button][/b][/F][br][button]save::~selected|npc_con_save[/button][/td][/tr]
  --&SkillBlock|+[tr][td][F::14][b][button]INT @{selected|intelligence} (@{selected|intelligence_mod})::~selected|npc_int[/button] |[/b][/F][br][button]save::~selected|npc_int_save[/button][/td]
  --&SkillBlock|+[td][F::14][b][button]WIS @{selected|wisdom} (@{selected|wisdom_mod})::~selected|npc_wis[/button] |[/b][/F][br][button]save::~selected|npc_wis_save[/button][/td]
  --&SkillBlock|+[td][F::14][b][button]CHA @{selected|charisma} (@{selected|charisma_mod})::~selected|npc_cha[/button][/b][/F][br][button]save::~selected|npc_cha_save[/button][/td]
  --&SkillBlock|+[/tr][/t][/c]
  --+|[&SkillBlock]
  --+|[&Divider]

  --~|array;define;SaveArray;str;dex;con;int;wis;cha
  --%SaveLoop|foreach;SaveArray
    --?"[*[&SourceChar]:npc_[&SaveLoop]_save_base]" -gt 0 -or "[*[&SourceChar]:npc_[&SaveLoop]_save_base]" -ne ""|[
      --~SaveReplace|string;replaceall;_; ;[&SaveLoop]
	  --~SaveTitle|string;totitlecase;[&SaveReplace]
      --+|[F::12][b]Saving Throws [/b][&SaveTitle] [*[&SourceChar]:npc_[&SaveLoop]_save_base][/F]
    --]|
  --%|

  --~|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
    --?"[*[&SourceChar]:npc_[&SkillLoop]_base]" -gt 0 -or "[*[&SourceChar]:npc_[&SkillLoop]_base]" -ne ""|[
      --~SkillReplace|string;replaceall;_; ;[&SkillLoop]
	  --~SkillTitle|string;totitlecase;[&SkillReplace]
      --+|[F::12][b]Skills [/b][&SkillTitle] [*[&SourceChar]:npc_[&SkillLoop]_base][/F]
    --]|
  --%|

  --#parameterDelimiter|$$$
  --?"@{selected|npc_vulnerabilities}" -ne ""|&SecondBlock$$$+[F::12][b]Damage Vulnerabilities[/b] @{selected|npc_vulnerabilities}[/F][br]
  --?"@{selected|npc_resistances}" -ne ""|&SecondBlock$$$+[F::12][b]Damage Resistances[/b] @{selected|npc_resistances}[/F][br]
  --?"@{selected|npc_immunities}" -ne ""|&SecondBlock$$$+[F::12][b]Damage Immunities[/b] @{selected|npc_immunities}[/F][br]
  --?"@{selected|npc_condition_immunities}" -ne ""|&SecondBlock$$$+[F::12][b]Conditions Immunities[/b] @{selected|npc_condition_immunities}[/F][br]
  --?"@{selected|npc_senses}" -ne ""|&SecondBlock$$$+[F::12][b]Senses[/b] @{selected|npc_senses}[/F][br]
  --?"@{selected|npc_languages}" -ne ""|&SecondBlock$$$+[F::12][b]Languages[/b] @{selected|npc_languages}[/F][br]
  --?"@{selected|npc_challenge}" -ne ""|&SecondBlock$$$+[F::12][b]Challenge[/b] @{selected|npc_challenge} (@{selected|npc_xp}xp)[/F][br]
  --?"@{selected|npc_pb}" -ne 0|&SecondBlock$$$+[F::12][b]Proficiency Bonus[/b] @{selected|npc_pb}[/F][br]
  --+|[&SecondBlock]
  --+|[&Divider]
  --#parameterDelimiter|;

  --&TraitOutput|[t width=100%]
  --~|array;fullrepeatingsection;Traits;@{selected|character_id};repeating_npctrait;name:description;:
    --%TraitLoop|foreach;Traits
      --~TraitSplit|string;split;:;[&TraitLoop]
      --Rfind|@{selected|character_id};[&TraitSplit1];repeating_npctrait;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&TraitOutput|+[tr][td title="[&TraitSplit2]"][#000][i][b][&TraitSplit1] [/b][/i][/#] [r][F::14]|[button]📜::~%[&obrac]selected|[*R>npc_roll_output]}[/button]|[/F][/r][/td][/tr]
      --]|
    --%|
  --&TraitOutput|+[/t]
  --+|[&TraitOutput]

  --Rfirst|@{selected|character_id};repeating_npcaction
  --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
    --+|[br][F::20]Actions[/F][hr #922610]
  --]|
  --&ActionOutput|[t width=100%]
  --~|array;fullrepeatingsection;Actions;@{selected|character_id};repeating_npcaction;name:description;:
    --%ActionLoop|foreach;Actions
      --~ActionSplit|string;split;:;[&ActionLoop]
      --Rfind|@{selected|character_id};[&ActionSplit1];repeating_npcaction;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&ActionOutput|+[tr][td title="[&ActionSplit2]"][#000][i][b][&ActionSplit1] [/b][/i][/#] [r][F::14]|[button]⚔️::~%[&obrac]selected|[*R>npc_action][&cbrac][/button]|[/F][/r][/td][/tr]
      --]|
    --%|
  --&ActionOutput|+[/t]
  --+|[&ActionOutput]

  --Rfirst|@{selected|character_id};repeating_npcbonusaction
  --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
    --+|[br][F::20]Bonus Actions[/F][hr #922610]
  --]|
  --&BonusOutput|[t width=100%]
  --~|array;fullrepeatingsection;Bonus;@{selected|character_id};repeating_npcbonusaction;name:description;:
    --%BonusLoop|foreach;Bonus
      --~BonusSplit|string;split;:;[&BonusLoop]
      --Rfind|@{selected|character_id};[&BonusSplit1];repeating_npcbonusaction;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&BonusOutput|+[tr][td title="[&BonusSplit2]"][#000][i][b][&BonusSplit1] [/b][/i][/#] [r]|[button]⚔️::~%[&obrac]selected|[*R>npc_action][&cbrac][/button]|[/r][/td][/tr]
      --]|
    --%|
  --&BonusOutput|+[/t]
  --+|[&BonusOutput]

  --Rfirst|@{selected|character_id};repeating_npcreaction
  --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
    --+|[br][F::20]Reactions[/F][hr #922610]
  --]|
  --&ReactionOutput|[t width=100%]
  --~|array;fullrepeatingsection;Reaction;@{selected|character_id};repeating_npcreaction;name:description;:
    --%ReactionLoop|foreach;Reaction
      --~ReactionSplit|string;split;:;[&ReactionLoop]
      --Rfind|@{selected|character_id};[&ReactionSplit1];repeating_npcreaction;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&ReactionOutput|+[tr][td title="[&ReactionSplit2]"][#000][i][b][&ReactionSplit1] [/b][/i][/#] [r]|[button]⚔️::~%[&obrac]selected|[*R>npc_roll_output][&cbrac][/button]|[/r][/td][/tr]
      --]|
    --%|
  --&ReactionOutput|+[/t]
  --+|[&ReactionOutput]

  --Rfirst|@{selected|character_id};repeating_npcaction-l
  --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
    --+|[br][F::20]Legendary Actions[/F][hr #922610][F::12][#000]@{selected|npc_legendary_actions_desc}[/#][/F]
  --]|
  --&LegendOutput|[t width=100%]
  --~|array;fullrepeatingsection;Legend;@{selected|character_id};repeating_npcaction-l;name:description;:
    --%LegendLoop|foreach;Legend
      --~LegendSplit|string;split;:;[&LegendLoop]
      --Rfind|@{selected|character_id};[&LegendSplit1];repeating_npcaction-l;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&LegendOutput|+[tr][td title="[&LegendSplit2]"][#000][i][b][&LegendSplit1] [/b][/i][/#] [r]|[button]⚔️::~%[&obrac]selected|[*R>npc_action][&cbrac][/button]|[/r][/td][/tr]
      --]|
    --%|
  --&LegendOutput|+[/t]
  --+|[&LegendOutput]

  --Rfirst|@{selected|character_id};repeating_npcaction-m
  --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
    --+|[br][F::20]Mythic Actions[/F][hr #922610][F::12][#000]@{selected|npc_mythic_actions_desc}[/#][/F]
  --]|
  --&MythicOutput|[t width=100%]
  --~|array;fullrepeatingsection;Mythic;@{selected|character_id};repeating_npcaction-m;name:description;:
    --%MythicLoop|foreach;Mythic
      --~MythicSplit|string;split;:;[&MythicLoop]
      --Rfind|@{selected|character_id};[&MythicSplit1];repeating_npcaction-m;name
      --?"[*R:name]" -ne "NoRepeatingAttributeLoaded" -and "[*R:name]X" -ne "X"|[
        --&MythicOutput|+[tr][td title="[&MythicSplit2]"][#000][i][b][&MythicSplit1] [/b][/i][/#] [r]|[button]⚔️::~%[&obrac]selected|[*R>npc_action][&cbrac][/button]|[/r][/td][/tr]
      --]|
    --%|
  --&MythicOutput|+[/t]
  --+|[&MythicOutput]

  --+|[br][hr #922610]
  --+|[c][button]Acrobatics::~selected|npc_Acrobatics[/button] | [button]Animal Handling::~selected|npc_Animal_Handling[/button] | [button]Arcana::~selected|npc_Arcana[/button][br][button]Athletics::~selected|npc_Athletics[/button] | [button]History::~selected|npc_History[/button] | [button]Insight::~selected|npc_Insight[/button] | [button]Intimidation::~selected|npc_intimidation[/button][br][button]Investigation::~selected|npc_Investigation[/button] | [button]Medicine::~selected|npc_Medicine[/button] | [button]Nature::~selected|npc_Nature[/button] | [button]Perception::~selected|npc_Perception[/button][br][button]Performace::~selected|npc_Performance[/button] | [button]Persuasion::~selected|npc_Persuasion[/button] | [button]Religion::~selected|npc_Religion[/button][br][button]Sleight of Hand::~selected|npc_Sleight_of_Hand[/button] | [button]Stealth::~selected|npc_Stealth[/button] | [button]Survivial::~selected|npc_Survival[/button][/c]

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

March 14 (2 weeks ago)

Edited March 30 (2 days ago)

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.


March 14 (2 weeks ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

That's gorgeous! Great work!

March 15 (2 weeks ago)

Edited March 15 (2 weeks ago)

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.

March 30 (2 days ago)

Edited March 30 (2 days ago)

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.