Skip to content

Instantly share code, notes, and snippets.

@haliphax
Last active August 28, 2018 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haliphax/7643e3c0fc8dcf0d982695e61f32b612 to your computer and use it in GitHub Desktop.
Save haliphax/7643e3c0fc8dcf0d982695e61f32b612 to your computer and use it in GitHub Desktop.
Roll20 NPC spell slots bookmarklet

Roll20 NPC spell slots bookmarklet

This bookmarklet can be used to produce a clickable list of spells for an NPC chat macro. You input the spell level (0 for cantrips), the number of slots available for that level, and it will produce the markup to put into a chat macro.

As far as building the shell for the spellbook is concerned, this should get you started:

/w GM &{template:default}{{name=@{selected|character_name} Spellcasting
}}{{ DC @{selected|spell_save_dc} = +@{selected|spell_attack_bonus} to hit
}}{{ Cantrips = [@{selected|repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell)
}}{{ 1st = [@{selected|repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell)
}}
javascript:(function(l,n,t,i){l=(l==0?'cantrip':l);t='';for(i=0;i<n;t+='[@{selected|repeating_spell-'+l+'_$'+i+'_spellname}](~selected|repeating_spell-'+l+'_$'+(i++)+'_spell) ');prompt('Snippet',t)})(prompt('Spell level'),prompt('#%20slots'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment