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

Scritpcard API Working and Sharing.

1627148612

Edited 1627166272
Kurt J.
Pro
API Scripter
5E Action Menu Script This ScriptCards script will display (to the person executing the script) a menu containing buttons for actions (NPCs), attacks (PCs) and spells (Both). These buttons can be clicked to execute the action, which will be displayed as an output card to everyone. While not technically required, there are some features that won't work on ScriptCards below 1.3.9. With any character token selected, executing the macro will present the caller with a list of actions and spells available to that character as a set of buttons. Items in the Character's "Attacks & Spellcasting" section will only be displayed as actions if the AREN'T a spell (they will be displayed under the appropriate spell level instead). The reentrant functions attempt to analyze the attack or spell and construct an appropriate output card. This should work for most 5e spells and attacks. You can define a "spell mule" (see the beginning of the script). If you do, the script will check for Ability names on the spell mule character that match the names of the spells it is creating buttons for. If it finds on (CASE SENSITIVE) it will create a sheet button to that ability instead of a reentrant button. This allows odd-ball spells to fire their own custom scripts from the same card interface (I've got a character named "Spell_Mule" in my game, with an ability "Fireball" that contains the fireball macro. When the card is displayed and fireball is clicked it will run the full fireball script instead of trying to come up with something on its own). If you wish to suppress the output of ACs from public view, change the "showGmInfo" value near the top of the script from 0 to 1. If you don't upgrade to 1.3.9, the formatting will look a little weird and the spell mule stuff won't work, but otherwise the script should function. The script is hosted on a GIST, and is  available here . It is likely to be updated and revised as bugs are discovered, etc. I do intend to add support for global modifiers, but I haven't gotten there yet. Here is a sample video using the script for a couple of PCs and NPCs, as well as how to use the "Spell_Mule" to substitute custom scripts for spells. In this case, I fire the Lightning Bolt spell without the Spell_Mule setup and then set up the mule and fire it again to see the custom script.
1627491997

Edited 1627492068
David M.
Pro
API Scripter
Scriptcard for Random Terrain My players are journeying into a cursed forest region, so I just picked up Gabriel Pickard's Excellent Critical Trails: Blighted Forest asset pack. Faced with the prospect of manually assembling a bunch of maps for random encounters, I wondered how hard it would be to make a random terrain generator using Scriptcards & SpawnDefaultToken. Turns out, not that hard! A bit of a kluge, but might give some folks ideas :) Dependencies: Scriptcards, SpawnDefaultToken, SelectManager Setup: I bulk downloaded the relevant art assets and dropped them into my personal art library (required for the api to be able to access them) Created Rollable table tokens for each class of art (Trees, Mushrooms, Blight patches, and Blight Pools for this example) Wrote a scriptcard querying for number of trees and some size and offset ranges. Due to wanting to properly layer the features (e.g. mushrooms below patches below pools below trees), I set it up as individual loops for each class in the proper layering order. I also used roll variables to create the desired ratios of Trees to more infrequent features (e.g. Blight Patches roughly 1/5th and Blight Pools roughly 1/8th of the tree frequency) I created a "default" blank map with my blight forest background and a perimeter of trees, and placed an origin token on the GM layer in the center. The objects are placed randomly within the given offset ranges relative to the selected origin token. Random side and rotation is handled by standard Spawn syntax.   Note:  Here's a gif of it in action: The code: !script {{ --#hideCard|1 --=Qty|?{How many Trees?|20} --=XRange|?{Plus/minus how many squares (X)?|14} --=YRange|?{Plus/minus how many squares (Y)?|11} --=MinSize|?{Minimum Size?|2} --=MaxSize|?{Maximum Size?|6} --=i|0 --:Loop1| --=i|[$i]+1 --:MUSHROOMS| -->RandomizeSize|1;3 -->RandomizeOffset| -->Spawn|Temp --?[$i] -lt [$Qty]|Loop1 --=i|0 --:Loop2| --=i|[$i]+1 --:BLIGHT PATCHES| --=AddPatch|1d5 -->RandomizeSize|[$MinSize.Raw]; [$MaxSize.Raw] -->RandomizeOffset| --?[$AddPatch] -eq 1|>Spawn;Blight Patch --?[$i] -lt [$Qty]|Loop2 --=i|0 --:Loop3| --=i|[$i]+1 --:BLIGHT POOLS| --=AddPool|1d8 -->RandomizeSize|[$MinSize.Raw]; [$MaxSize.Raw] -->RandomizeOffset| --?[$AddPool] -eq 1|>Spawn;Blight Pool --?[$i] -lt [$Qty]|Loop3 --=i|0 --:Loop4| --=i|[$i]+1 --:TREES| -->RandomizeSize|[$MinSize.Raw]; [$MaxSize.Raw] -->RandomizeOffset| -->Spawn|Blight Trees --?[$i] -lt [$Qty]|Loop4 --X| --:Spawn| accepts Rollable Table Token Name as parameter --@forselected|Spawn _name|[%1%] _offset|[$XOffset.Raw],[$YOffset.Raw] _layer|map _side|rand _size|[$ThisSize.Raw] _rotation|rand --<| --:RandomizeSize| accepts MinSize, MaxSize as parameters --=SizeRange|[%2%] - [%1%] + 1 --=ThisSize|[%1%] + 1d[$SizeRange] --<| --:RandomizeOffset| -->PlusMinus| --=XOffset|[$PlusMinus]*1d[$XRange] -->PlusMinus| --=YOffset|[$PlusMinus]*1d[$YRange] --<| --:PlusMinus| --=temp|1d2-1 --=PlusMinus|[$temp]*2-1 --<| }} Index Entry Random Terrain Generation -  link  
1627583237

Edited 1627589922
Scriptcard for 5e Shove Action The following script can be used to execute a D&D 5e Shove attack. This new script requires version 1.3.9a of scriptcards, specifically the new math "Angle" function.   !script {{ --#title|Shove --#reentrant|Shove --#emoteText|attempts to shove --#bodyFontSize|11px --+|[b][c]Shoving a Creature[/c][/b] --+|Using the Attack action, you can make a special melee attack to shove a creature, either to knock it prone or push it away from you. If you're able to make multiple attacks with the Attack action, this attack replaces one of them. --+|The target must be no more than one size larger than you and must be within your reach. Instead of making an attack roll, you make a Strength (Athletics) check contested by the target's Strength (Athletics) or Dexterity (Acrobatics) check (the target chooses the ability to use). You succeed automatically if the target is incapacitated. --+|If you succeed, you either knock the target prone or push it 5 feet away from you. --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#debug|1 --&STid|@{selected|token_id} --&TTid|@{target|token_id} --#leftsub|[*[&STid]:t-name] --#rightsub|[*[&TTid]:t-name] -->GET_SKILL_BONUS|[&STid];athletics --&SBonus|[&Bonus] -->GET_SKILL_BONUS|[&TTid];athletics --&TAthBonus|[&Bonus] -->GET_SKILL_BONUS|[&TTid];acrobatics --&TAcrBonus|[&Bonus] --&tStyle|style = "width:100%;padding:1px;border-spacing:0px;border-collapse:collapse;text-shadow: 0px 0px 0px black;border:0px dashed black;" --&trStyle1|style="border-top:0px dashed black;" --&tdStyle1|style="width:100%;text-align:center;background-color:#FFFFFF;font-size:80%" --:STEP1| Setup the Shove Attack, ask if attacker is using advantage --+|Select the Roll Type for the attacker([*[&STid]:t-name]) using [b]athletics[/b]: --+|[t [&tStyle]] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Normal::STEP2;N[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Advantage::STEP2;A[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Disadvantage::STEP2;D[/rbutton][/td][/tr] [/t] --X| --:STEP2| Process result from step 1 and Get defender info --#emotetext| --#emoteState|1 --#hideTitleCard|1 --&SRT|1d20 --?[&reentryval] -eq A|&SRT;2d20kh1 --?[&reentryval] -eq D|&SRT;2d20kl1 --+|Defender ([*[&TTid]:t-name]) preferred skill for countering shove? --+|[t [&tStyle]] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Athletics/Str([&TAthBonus])::STEP3;athletics[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Acrobatics/Dex([&TAcrBonus])::STEP3;acrobatics[/rbutton][/td][/tr] [/t] --X| --:STEP3| Process result from step 2 and Get defender roll type --&TSkill|athletics --&TBonus|[&TAthBonus] --?[&reentryval] -eq athletics|STEP3_ASK --&TSkill|acrobatics --&TBonus|[&TAcrBonus] --:STEP3_ASK| --+|Select the Roll Type for the defender([*[&TTid]:t-name]) using [b][&TSkill][/b]: --+|[t [&tStyle]] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Normal::STEP4;N[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Advantage::STEP4;A[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Disadvantage::STEP4;D[/rbutton][/td][/tr] [/t] --X| --:STEP4| Process result from step 3 and execute the roll --&TRT|1d20 --?[&reentryval] -eq A|&TRT;2d20kh1 --?[&reentryval] -eq D|&TRT;2d20kl1 --=SResult|[&SRT] + [&SBonus] --=TResult|[&TRT] + [&TBonus] --?[$SResult.Raw] -ge [$TResult.Raw]|WON|LOST --:WON| --+|Attacker [b]won[/b] ([$SResult] vs. [$TResult])the contest, select the desired effect: --+|[t [&tStyle]] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Knock it Prone::STEP5;PRONE[/rbutton][/td][/tr] [tr [&trStyle1]][td [&tdStyle1]][rbutton]Push it away 5'::STEP5;PUSH[/rbutton][/td][/tr] [/t] --x| --:LOST| --+|Defender [b]won[/b] ([$SResult] vs. [$TResult]) the contest, better luck next time! --x| --:STEP5| If attacker won the contest, decide on prone or shoved back 5 feet --?[&reentryval] -eq PUSH|PUSH|PRONE --:PUSH| -->MOVE_TOKEN|[&STid];[&TTid];1 --+|[*[&STid]:t-name] has pushed [*[&TTid]:t-name] back five feet! --X| --:PRONE| --@token-mod|_set statusmarkers|Prone _ids [&TTid] _ignore-selected --+|[*[&TTid]:t-name] is now [b]prone[/b]! --+|A [b][i]prone[/b][/i] creature’s only movement option is to crawl, unless it stands up and thereby ends the condition. --+|The creature has **Disadvantage** on attack rolls. --+|An attack roll against the creature has **Advantage** if the attacker is within 5 feet of the creature. Otherwise, the attack roll has **Disadvantage**. --X| --:GET_SKILL_BONUS|TokenID, skill --&Tid|[%1%] --&Skill|[%2%] --&SB|[&Skill]_bonus --/|*Token|[*[&Tid]:t-name] --/|*Skill|[&Skill] --/|*SB|[&SB]: [*[&Tid]:[&SB]] --/|*NPC|[*[&Tid]:npc] --?"[*[&Tid]:npc]" -eq 1|NPC|CHAR --:NPC| --&NSF|npc_[&Skill]_flag --&NSB|npc_[&Skill] --/|*NSF|[&NSF]: [*[&Tid]:[&NSF]] --/|*NSB|[&NSB]: [*[&Tid]:[&NSB]]: [*[&Tid]:[&NSB]] --?[*[&Tid]:[&NSF]] -eq 1|&Bonus;[*[&Tid]:[&NSB]]|&Bonus;[*[&Tid]:[&SB]] --/|*Bonus|[&Bonus] --<|Return --:CHAR| --&Bonus|[*[&Tid]:[&SB]] --/|*Bonus|[&Bonus] --<|Return --x| --:MOVE_TOKEN|STokenid, TTokenId, Units --&TId1|[%1%] --&TId2|[%2%] --&Units|[%3%] --/| Angle function returns a string variable (&) with lots of decimal points. --~A|math;angle;[&TId1];[&TId2] --/| I've found that TokenMod chokes on a movement angle with lots of decimal points, so rounding is needed --/|$Ar will now contain a rounded integer version of &A --~Ar|math;round;[&A] --/|&Angle will end up being one of the common directions which may work better for grids --?[$Ar] -gt 337.5 -or [$Ar] -le 22.5|&Angle;0 --?[$Ar] -gt 22.5 -and [$Ar] -le 67.5|&Angle;45 --?[$Ar] -gt 67.5 -and [$Ar] -le 112.5|&Angle;90 --?[$Ar] -gt 112.5 -and [$Ar] -le 157.5|&Angle;135 --?[$Ar] -gt 157.5 -and [$Ar] -le 202.5|&Angle;180 --?[$Ar] -gt 202.5 -and [$Ar] -le 247.5|&Angle;225 --?[$Ar] -gt 247.5 -and [$Ar] -le 292.5|&Angle;270 --?[$Ar] -gt 292.5 -and [$Ar] -le 337.5|&Angle;315 --/| Added for dealing with a SC 1.39a bug (returns negative angles beteen 270 and 360) --?[$Ar] -gt -90 -and [$Ar] -le -67.5|&Angle;270 --?[$Ar] -gt -67.5 -and [$Ar] -le -22.5|&Angle;315 --?[$Ar] -gt -22.5 -and [$Ar] -le 0|&Angle;0 --&UnitsFactor|1 --?[&Angle] -eq 45|&UnitsFactor;1.4142 --?[&Angle] -eq 135|&UnitsFactor;1.4142 --?[&Angle] -eq 225|&UnitsFactor;1.4142 --?[&Angle] -eq 315|&UnitsFactor;1.4142 --=U|[&Units] * [&UnitsFactor] --*Angles|[&Angle] ([&A]) ([$Ar]) --/| Time to call the magic TokenMod function to make the target token move across the screen --@token-mod|_move =[&Angle]|[$U.Raw]g _ids [&TId2] _ignore-selected --<|Return }} Index Entry 5e Shove Attack action - Link
1627589808

Edited 1627589903
Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.   !script {{ --#title|Spell: Gust of Wind --#reentrant|GustOfWind --#debug|1 --#sourcetoken|@{selected|token_id} --#targettoken|@{target|token_id} --&TTokenId|@{target|token_id} --=SpellSaveDC|[*S:spell_save_dc] --=Result|1d20 + [*T:strength_save_bonus] --?[$Result.Base] -eq 1|TARGET_FAILED --?[$Result.Base] -eq 20|TARGET_PASSED --?[$Result.Raw] -lt [$SpellSaveDC]|TARGET_FAILED --:TARGET_PASSED| --+|Target [b]succeeded[/b] on their strength saving throw with a [$Result] vs. Spellsave DC of [$SpellSaveDC] --x| --:TARGET_FAILED| --+|Target [b]failed[/b] on their strength saving throw with a [$Result] vs. Spellsave DC of [$SpellSaveDC] --&tStyle|style = "width:100%;padding:1px;border-spacing:0px;border-collapse:collapse;text-shadow: 0px 0px 0px black;border:0px dashed black;" --&trStyle1|style="border-top:0px dashed black;" --&tdStyle1|style="width:33%;text-align:center;background-color:#FFFFFF;font-size:80%" --/| Angle function returns a string variable (&) with lots of decimal points. --~A|math;angle;@{selected|token_id};@{target|token_id} --/| I've found that TokenMod chokes on a movement angle with lots of decimal points, so rounding is needed --/|$Ar will now contain a rounded integer version of &A --~Ar|math;round;[&A] --/|&Angle will end up being one of the common directions which may work better for grids --?[$Ar] -gt 337.5 -or [$Ar] -le 22.5|&Angle;0 --?[$Ar] -gt 22.5 -and [$Ar] -le 67.5|&Angle;45 --?[$Ar] -gt 67.5 -and [$Ar] -le 112.5|&Angle;90 --?[$Ar] -gt 112.5 -and [$Ar] -le 157.5|&Angle;135 --?[$Ar] -gt 157.5 -and [$Ar] -le 202.5|&Angle;180 --?[$Ar] -gt 202.5 -and [$Ar] -le 247.5|&Angle;225 --?[$Ar] -gt 247.5 -and [$Ar] -le 292.5|&Angle;270 --?[$Ar] -gt 292.5 -and [$Ar] -le 337.5|&Angle;315 --/| Added for dealing with a SC 1.39a bug (returns negative angles beteen 270 and 360) --?[$Ar] -gt -90 -and [$Ar] -le -67.5|&Angle;270 --?[$Ar] -gt -67.5 -and [$Ar] -le -22.5|&Angle;315 --?[$Ar] -gt -22.5 -and [$Ar] -le 0|&Angle;0 --&UnitsFactor|1 --?[&Angle] -eq 45|&UnitsFactor;1.4142 --?[&Angle] -eq 135|&UnitsFactor;1.4142 --?[&Angle] -eq 225|&UnitsFactor;1.4142 --?[&Angle] -eq 315|&UnitsFactor;1.4142 --=U|3 * [&UnitsFactor] --/|*Angles|[&Angle] ([&A]) ([$Ar]) --/| Time to call the magic TokenMod function to make the target token move across the screen --@token-mod|_move =[&Angle]|[$U.Raw]g _ids @{target|token_id} _ignore-selected --X| }} Index Entry 5e Gust of Wind spell -  Link
Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.   Very Sweet! Thank you
David M. said: Scriptcard for Random Terrain My players are journeying into a cursed forest region, so I just picked up Gabriel Pickard's Excellent Critical Trails: Blighted Forest asset pack. Faced with the prospect of manually assembling a bunch of maps for random encounters, I wondered how hard it would be to make a random terrain generator using Scriptcards & SpawnDefaultToken. Turns out, not that hard! A bit of a kluge, but might give some folks ideas :) Dependencies: Scriptcards, SpawnDefaultToken, SelectManager Beautiful thank you for sharing
Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.   Very nice, I used this and modified it for my Minotaur player for his Hammering Horn attack.
1627940675

Edited 1627941241
Scriptcard for Away From Keyboard (AFK) toggle Here's a simple script to toggle an AFK status marker (make sure you have one loaded in your campaign) when someone steps away and then back.  Place this in your campaign macros area or on a Macro Mule and give all your players access to it.  When they click it for the first time it will: Places your assigned AFK marker on their token Sends the GM a message that the player is AFK When they get back and click it: Clears the AFK marker from their token Sends the GM a message that the player is Back If you don't have a marker called AFK, you could always designate one you do have and change the name in the code below to your desired marker name.   Requires: TokenMod API !script {{ --/|Script Name : Away From Keyboard (AFK) --/|Version : 0.1 --/|Requires SC : 1.3.7+, TokenMod --/|Author : Will M. --/|Description : Quick AFK Toggle. Assumes you have an AFK Status Marker --/| --:TOP| --#sourceToken|@{selected|token_id} --#leftsub|@{selected|character_name} --#hidecard|0 --#oddRowBackground|#FFFFFF --#evenRowBackground|#FFFFFF --#whisper|gm --#titleCardBackground|[&SendingPlayerColor] --#debug|1 --/| Name of Status Marker for indicating AFK --&AFK|AFK --/|Loop through all of the status markers on the targetted token --~|array;statusmarkers;aryToken_SM;@{selected|token_id} --~SMItem|array;getfirst;aryToken_SM --:LOOPTOP| --?[&SMItem] -eq ArrayError|ENDLOOP --&SMItem_Name|[&SMItem] --/| The rbutton syntax doesn't like '::' in the name- messes with the parser --~SMItem|string;replace;::;^^;[&SMItem] --~SMItem_Name|string;before;::;[&SMItem_Name] --?[&AFK] -eq [&SMItem_Name]|AFK_ON --~SMItem|array;getnext;aryToken_SM --^LOOPTOP| --:ENDLOOP| Not AFK --#title|AFK --@token-mod|_set statusmarkers|[&AFK] _ids @{selected|token_id} _ignore-selected --/|+|[c]@{selected|character_name} is now [b]"Away From Keyboard"[/b][/c] --X| --:AFK_ON| --#title|Back --@token-mod|_set statusmarkers|-[&AFK] _ids @{selected|token_id} _ignore-selected --/|+|[c]@{selected|character_name} is [b]back[/b][/c] --X| }} Index Entry Away from Keyboard (AFK) Toggle -  Link
FYI - I've started maintaining all my Scriptcards and Macros on my personal GitHub:  MadCar-Dev/Default: My Default Repository (github.com) .  I'll continue to post here from time to time, but having written about 40 Scriptcards now, it will be easier for me to maintain my growing library on GitHub.   
Per request here is my (beginner) Scorching Ray using Kurt's MM as a template, along with Will's (? There are so many excellent contributors it is hard for an old man like me to keep them straight!) color template and other borrowings.   !scriptcards {{    --#title|Scorching Ray   --#sourceToken|@{selected|token_id}   --#emoteText|@{selected|character_name} Casts Scorching Rays!   --&TFColor|#FFFFFF   --&STFColor|#000000   --&FColor1|#000000   --&FColor2|#000000   --&EBColor|#7DEDFF   --&BColor1|#7C83FD   --&BColor2|#96BAFF   --#titlecardbackground|[&BColor1]   --#titlecardbackgroundimage|linear-gradient(to bottom, #96BAFF, #7C83FD)   --#titleFontColor|[&TFColor]   --#subtitleFontColor|[&STFColor]   --#emoteBackground|[&EBColor]   --#titlefontsize|2.0em   --#titlefontlineheight|1.2em   --#titlefontface|Times New Roman   --#norollhighlight|0   --#hideTitleCard|0   --#bodyfontsize|12px   --#bodyfontface|Algerian   --#oddrowbackground|[&BColor1]   --#oddrowfontcolor|[&FColor2]   --#evenrowbackground|[&BColor2]   --#evenrowfontcolor|[&FColor1]   --#leftsub|Level 2 | Evocation | Action   --#rightsub| 120' | V S M   --#debug|1   --:Setup|      -->GetAndCheckSlotInformation|      --&DamageType|fire     --=MissileCount|[$SlotLevel] + 1     -->BuildAndAskTargets|[$MissileCount.Total]     --=DisplayCount|1     --=MissileDamage|2d6     --+|[c]Spell Save DC: [*S:spell_save_dc]   Damage: [#ffff00][$MissileDamage][/#][/c]   --:MissileLoop|      -->FireMissile|[$DisplayCount.Total]      --=DisplayCount|[$DisplayCount] + 1      --?[$DisplayCount] -le [$MissileCount]|MissileLoop|EndMacro   --X|   --:FireMissile|      --&ThisTarget|[&target[%1%]]      -->PlayEffects|@{selected|token_id};[&ThisTarget];none;burst-smoke;beam-magic      -->Attack|[&ThisTarget]   --<|   --:EndMacro|   --X|   --:PROCEDURES|   --:GetAndCheckSlotInformation|      --=SlotLevel|?{Spell Slot Level?|2|3|4|5|6|7|8|9}      --=SlotsTotal|[*S:lvl[$SlotLevel]_slots_total]      --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended]      --?[$SlotsExpended.Total] -ge [$SlotsTotal.Total]|NoSlotsLeft   --:DeductSpellSlot|      --=SlotsExpended|[$SlotsExpended] + 1      --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent      --=SlotsRemaining|[$SlotsTotal] - [$SlotsExpended]   --<|   --:NoSlotsLeft|      --+|[*S:character_name] has no level [$SlotLevel.Total] spell slots available.   --X| --:Attack|     --?"[*[%1%]:npc_ac]" -gt 0|=TargetAC;[*[%1%]:npc_ac]|=TargetAC;[*[%1%]:ac]     --=TotalDamage|[$MissileDamage]     --?"[*[%1%]:npc_immunities]" -inc "[&DamageType]"|Immune     --?"[*[%1%]:npc_resistances]" -inc "[&DamageType]"|>DamageResist;[%1%];[$MissileDamage]     --?"[*[%1%]:npc_vulnerabilities]" -inc "[&DamageType]"|>DamageVuln;[%1%];[$MissileDamage]     --=AttackRoll|1d20 [BASE] + [*S:spell_attack_bonus]     --+Attack|[*S:character_name] rolls [$AttackRoll] vs AC [$TargetAC].   --:Determine results|     --?[$AttackRoll.Base] -eq 1|>Fumble;[&ThisTarget]     --?[$AttackRoll.Total] -lt [$TargetAC.Total]|>Miss;[&ThisTarget]     --?[$AttackRoll.Base] -eq 20]>DamageCrit;[&ThisTarget];[$TotalDamage]     --?[$AttackRoll.Total] -ge [$TargetAC.Total] -and [$AttackRoll.Base] -ne 20|>Hit;[&ThisTarget];[$TotalDamage]   --X|   --:DamageResist|     --=TotalDamage|[%2%] \ 2     --+[b]Resistant![/b]|[b][*[%1%]:character_name] takes [$TotalDamage] damage![/b]   --<|   --:DamageVuln|     --=TotalDamage|[%2%] * 2     --+[b]Vulnerable![/b]|[b][*[%1%]:character_name] takes [$TotalDamage] damage![/b]   --<|   --:Fumble|       --+Fumble!|The attack on [*[%1%]:character_name] went horribly wrong.   --^MissileLoop|   --:Miss|       --+Miss!|The attack on [*[%1%]:character_name] missed.   --^MissileLoop|   --:Hit| pass Damage string      --+Hit!|[*S:character_name]'s Spell hits [*[%1%]:character_name] for [$TotalDamage] [&DamageType] damage.   -->ApplyDamage|[%1%];[$TotalDamage]   --:DamageCrit|     --=TotalDamage|[%2%] * 2     --+[b]Crit![/b]|[b][*[%1%]:character_name] takes [$TotalDamage] [&DamageType] damage![/b]   -->ApplyDamage|[%1%];[$TotalDamage]   --:Immune|      --=DisplayCount|[$DisplayCount] + 1      --+|[b][*[%1%]:character_name] is immune to [&DamageType] damage![/b]   --^MissileLoop|   --:ApplyDamage|     --@alter|_target|[%1%] _bar|1 _amount|-[%2%]      --=DisplayCount|[$DisplayCount] + 1      --?[$DisplayCount] -le [$MissileCount]|MissileLoop|EndMacro   --:BuildAndAskTargets|      --&TargetString|      --=targetCount|1      --:TargetLoop|         --&TargetString|+t;target[$targetCount.Raw];Missile [$targetCount.Raw] Target         --=targetCount|[$targetCount.Total] + 1         --?[$targetCount.Total] -le [%1%]|>AddSeparator         --?[$targetCount.Total] -le [%1%]|TargetLoop      --iClick button below to select targets. The same target may be selected more than once;Select [%1%] Targets|[&TargetString]   --<|   --:AddSeparator|      --&TargetString|+||   --<|   --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect      --vtoken|[%1%] [%3%]      --vtoken|[%2%] [%4%]      --vbetweentokens|[%1%] [%2%] [%5%]   --<| }}
1628983690

Edited 1633373274
Spell: Scorching Ray  My version of Scorching Ray.  Based largely on Michael C's original version but with the following differences: Modified to work with TokenMod (instead of AlterBars) to apply damage. Asks for targets one at a time instead of all at once.  Formatting changes !script {{ --/|Script Name : Scoring Ray --/|Version : 1.0 --/|Requires SC : 1.3.7+, TokenMod --/|Author : Will M. --/|Updated : 8/14/2021 --/|Description : Scorching Ray Spell --/| --/| --#title|Scorching Ray --#sourceToken|@{selected|token_id} --#emoteText|@{selected|character_name} Casts Scorching Rays! --&TFColor|#FFFFFF --&STFColor|#000000 --&FColor1|#000000 --&FColor2|#000000 --&EBColor|#FFFFFF --&BColor1|#FFFFFF --&BColor2|#FFFFFF --#titlecardbackground|[&BColor1] --#titlecardbackgroundimage|linear-gradient(to bottom, #FFF000, #FF0000) --#titleFontColor|[&TFColor] --#subtitleFontColor|[&STFColor] --#emoteBackground|[&EBColor] --#titlefontsize|2.0em --#titlefontlineheight|1.2em --#titlefontface|Times New Roman --#norollhighlight|0 --#hideTitleCard|0 --#bodyfontsize|12px --#oddrowbackground|[&BColor1] --#oddrowfontcolor|[&FColor2] --#evenrowbackground|[&BColor2] --#evenrowfontcolor|[&FColor1] --#leftsub|Level 2 | Evocation | Action --#rightsub| 120' | V S | Fire --#debug|1 --:STEP1| Setup --&DamageType|fire --=MissileDamage|2d6 --=DisplayCount|0 --+|You create three rays of fire and hurl them at targets within range. You can hurl them at one target or several. Make a ranged spell attack for each ray. On a hit, the target takes 2d6 fire damage. --+|[b]At Higher Levels.[/b] When you cast this spell using a spell slot of 3rd level or higher, you create one additional ray for each slot level above 2nd. --+|[br] --+|[c][b]Spell Save DC: [#FF0000][*S:spell_save_dc][/#] Damage: [#FF0000][$MissileDamage.Raw][/#][/b][/c] --+|[br] --+|[b][c]Spell Level?[/c][/b] --+|[c][rbutton]2nd::STEP2;2[/rbutton][rbutton]3rd::STEP2;3[/rbutton][rbutton]4th::STEP2;4[/rbutton][rbutton]5th::STEP2;5[/rbutton][/c] --+|[c][rbutton]6th::STEP2;6[/rbutton][rbutton]7th::STEP2;7[/rbutton][rbutton]8th::STEP2;8[/rbutton][rbutton]9th::STEP2;9[/rbutton][/c] --+|[br] --+|After picking a level above, you will be asked to select a series of targets until all your rays are delivered - [b]Good Luck![/b] --X| --:STEP2| --&SlotLevel|[&reentryval] --=SlotsTotal|[*S:lvl[&SlotLevel]_slots_total] --=SlotsRemaining|[*S:lvl[&SlotLevel]_slots_expended] --?[$SlotsRemaining.Total] -le 0|NoSlotsLeft --=MissileCount|[&SlotLevel] - 2 + 3 --:MissileLoop| --=DisplayCount|[$DisplayCount] + 1 --?[$DisplayCount] -gt [$MissileCount]|EndMacro --?[$DisplayCount] -ne 1|[ --+|[hr] --+|[br] --+|[c][rbutton]Next Target::NEXT_TARGET[/rbutton][/c] --+|[br] --+|[c][b]Spell Save DC: [#FF0000][*S:spell_save_dc][/#] Damage: [#FF0000][$MissileDamage.Raw][/#][/b][/c] --+|[br] --X| --]| --:NEXT_TARGET| --I Select the target of your Scoring Ray.;Scoring Ray #[$DisplayCount].|t;ThisTarget;Scorching Ray #[$DisplayCount]: --#leftsub|Ray # [$DisplayCount.Raw] --#rightsub|[*[&ThisTarget]:t-name] --#targetToken|[&ThisTarget] --#emoteText|Scorching Ray #[$DisplayCount.Raw] -->PlayEffects|@{selected|token_id};[&ThisTarget];none;burst-smoke;beam-magic --&DamageResistNote| --=TotalDamage|[$MissileDamage] --?"[*[&ThisTarget]:npc_ac]" -gt 0|[ --=TargetAC|[*[&ThisTarget]:npc_ac] --?"[*[&ThisTarget]:npc_immunities]" -inc "[&DamageType]"|>Immune --?"[*[&ThisTarget]:npc_resistances]" -inc "[&DamageType]"|>DamageResist --?"[*[&ThisTarget]:npc_vulnerabilities]" -inc "[&DamageType]"|>DamageVuln --]|[ --=TargetAC|[*[&ThisTarget]:ac] --]| --=AttackRoll|1d20 [BASE] + [*S:spell_attack_bonus] --/|Determine results| --?[$AttackRoll.Base] -eq 1|FUMBLE --?[$AttackRoll.Base] -eq 20|CRITICAL --?[$AttackRoll.Total] -lt [$TargetAC.Total]|MISS --?[$AttackRoll.Total] -ge [$TargetAC.Total]|HIT --X| --<| --:EndMacro| --X| --/|PROCEDURES --:DeductSpellSlot| --=SlotsRemaining|[$SlotsRemaining] - 1 --@setattr|_charid [*S:character_id] _lvl[&SlotLevel]_slots_expended|[$SlotsRemaining] _silent --<| --:NoSlotsLeft| --+|[*S:character_name] has no level [&SlotLevel] spell slots available. --X| --:DamageResist| --=TotalDamage|[$MissileDamage] \ 2 --&DamageResistNote|(Resistant) --<| --:DamageVuln| --=TotalDamage|[$MissileDamage] * 2 --&DamageResistNote|(Vulnerable) --<| --:Immune| --=TotalDamage|0 --&DamageResistNote|(Immune) --<| --:FUMBLE| --+😓Ray #[$DisplayCount.Raw] Fumbles! |[*S:character_name] rolls [$AttackRoll] to attack [*[&ThisTarget]:t-name] and something went horribly wrong. --^MissileLoop| --:MISS| --+❌Ray #[$DisplayCount.Raw] Misses! |[*S:character_name] rolls [$AttackRoll] to attack [*[&ThisTarget]:t-name] and missed. --^MissileLoop| --:HIT| pass Damage string --+🎯Ray #[$DisplayCount.Raw] hits! |[*S:character_name] rolls [$AttackRoll] to attack and hits [*[&ThisTarget]:t-name] for [$TotalDamage] [&DamageType] damage. [&DamageResistNote] -->ApplyDamage| --^MissileLoop| --:CRITICAL| --=TotalDamage|[$TotalDamage] * 2 --+❗❗❗Crits!|[*S:character_name] rolls [$AttackRoll] to attack and CRITS [*[&ThisTarget]:t-name] for [$TotalDamage] [&DamageType] damage. [&DamageResistNote] -->ApplyDamage| --^MissileLoop| --:ApplyDamage| --=CurrentHP|[*[&ThisTarget]:t-bar1_value] --@token-mod|_ids [&ThisTarget] _ignore-selected _set bar1_value|-[$TotalDamage.Raw] --/|@alter|_target|[&ThisTarget] _bar|1 _amount|-[$TotalDamage.Raw] --/|Did that kill them? --?[$CurrentHP.Raw] -gt [$TotalDamage.Raw]|ALIVE|DEAD --:ALIVE| --/+|[*[&ThisTarget]:character_name] is still alive and kicking! --<| --:DEAD| --+Congrats|You managed to kill [*[&ThisTarget]:character_name] --@token-mod|_ids [&ThisTarget] _ignore-selected _set statusmarkers|dead bar1_value|0 --<| --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect --vtoken|[%1%] [%3%] --vtoken|[%2%] [%4%] --vbetweentokens|[%1%] [%2%] [%5%] --<| }} Spell: Scorching Ray -  Link
Hello all Magic Scriptcards writers ! Here's a little demand from someone who absolutely cannot code ! I'd like to know if anyone could create a scriptcard that would do the same as grpcheck and apply damages scripts but with the slight difference that these checks would take into consideration the immunities/resistances/vulnerabilities of the selected tokens. As a reminder, you can have a look on how the groupcheck and apply damages works on this very good Nick Olivo's Group Check and apply damage video . The only thing about this script is that it doesn't make any difference if the monster is especially affected by fire or cold or whatsoever. So there will probably be a need for including the damage type query in the scriptcard. I know that fireball scriptcard for example does all this, but i really would like to have a similar and generic dm accessible group check+apply damages procedure only. Please accept the challenge :)
1630178407

Edited 1630179038
5E Hexblade's Curse I handle this like I do Hunter's mark.  You will need an attribute added called hexblade.  I also keep track of this on the class_resource.  The rest API script I use will reset it on a short or long rest.  This will also use token-mod to mark the token. !scriptcards{{ --:Hexblade's Curse| --#title|Hexblade's Curse --#rightsub|Class Ability --#leftsub|30 Feet --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} -->GetAndCheckSlotInformation| --#emoteText| @{selected|token_name} has chosen @{target|token_name} as their next victim of vengance. --@token-mod| _ids @{target|token_id} _set statusmarkers|death-zone --@setattr|_charid [*S:character_id] _hexblade|[*T:t-id] _silent --@act| -1| 10| _Hexblade Curse Braeden -->DeductSpellSlot| --:AllDone| --X| --:GetAndCheckSlotInformation| --=SlotsTotal|0 --=SlotsExpended|[*S:class_resource] --?[$SlotsExpended.Total] -eq [$SlotsTotal.Total]|NoSlotsLeft --<| --:DeductSpellSlot| --=SlotsLeft|[$SlotsExpended] - 1 --@setattr|_charid [*S:character_id] _class_resource|[$SlotsLeft] _silent --+|You need to rest before you can curse someone else. --X|Full Stop --:NoSlotsLeft| --+|You need to rest before you can do this again. --#emoteText|[*S:character_name] cannot use Hexblade's Curse --X|NoSlotsLeftStop }} Next you will need to add this to your attack macro.  I added this to check if a 19 was roll for Crit. --?"@{selected|hexblade}" -ninc "@{target|token_id}"|notHexed --?[$AttackRoll.Base] -eq 19|Crit --:notHexed|  I usually put   -->CheckHexBlade| right after the attack roll. --:CheckHexBlade| --&HexBlade| --+|@{selected|hexblade} --+|@{target|token_id} --?"@{selected|hexblade}" -ninc "@{target|token_id}"|noHexBlade --&HexBlade|+ + @{pb} [Hexblade Curse] --:noHexBlade| --<|
1630178926

Edited 1630185140
5E Pact of the Blade No one should have to create this again.&nbsp; First thing is the Warlock using their action to create the weapon.&nbsp; You will need to create an attribute called pactblade.&nbsp; It will warn the GM to unequip shields or other weapons if they select a 2 handed weapon. !Scriptcard {{ --#sourceToken|@{selected|token_id} --#Title|Pact of the Blade --#leftsub|Class Ability --#rightsub|Action --&amp;Weapon|?{Choose what weapon you would like to create.|Greatsword|Longsword|Glaive|Halberd|Club|Dagger|Greatclub|Handaxe|Javelin|Light hammer|Mace|Quarterstaff|Sickle|Spear|Battleaxe|Flail|Greataxe|Lance|Maul|Morningstar|Pike|Rapier|Scimitar|Shortsword|Triden|War Pick|Warhammer|Whip} --#emoteText|@{selected|character_name} creates a magical [&amp;Weapon] in his empty hand. --@setattr|_charid [*S:character_id] _pactblade|[&amp;Weapon] _silent --?[&amp;Weapon] -inc "Greatclub" -or "Glaive" -or "Greataxe" -or "Greatsword" -or "Halberd" -or "Maul" -or "Pike"|TwoHanded --X| --:TwoHanded| --*|Uneqiup Shield and other weapon. }} Next is the attack script.&nbsp; &nbsp;It does have the hexblade curse script I added the post before this. !Scriptcard {{ --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --&amp;Which|@{selected|pactblade} --?"[&amp;Which]" -inc "Club"|&gt;Attack;Club;bludgeoning;1d4; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Dagger"|&gt;Attack;Dagger;piercing;1d4; @{dexterity_mod} [DEX];none;no;5 ft;thrown;none;none --?"[&amp;Which]" -inc "Greatclub"|&gt;Attack;Greatclub;bludgeoning;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Handaxe"|&gt;Attack;Handaxe;slashing;1d6; @{strength_mod} [STR];none;no;5 ft;thrown;none;none --?"[&amp;Which]" -inc "Javelin"|&gt;Attack;Javelin;piercing;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Light hammer"|&gt;Attack;Greatclub;bludgeoning;1d4; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Mace"|&gt;Attack;Mace;bludgeoning;6; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Quarterstaff"|&gt;Attack;Quarterstaff;bludgeoning;1d6; @{strength_mod} [STR];Versa;1d8;5 ft;melee;none;none --?"[&amp;Which]" -inc "Sickle"|&gt;Attack;Sickle;slashing;1d4; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Spear"|&gt;Attack;Spear;piercing;1d6; @{strength_mod} [STR];Versa;1d8;5 ft;melee;none;none --?"[&amp;Which]" -inc "Greatclub"|&gt;Attack;Greatclub;bludgeoning;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Battleaxe"|&gt;Attack;[&amp;Which];slashing;1d8; @{strength_mod} [STR];Versa;1d10;5 ft;melee;none;none --?"[&amp;Which]" -inc "Flail"|&gt;Attack;[&amp;Which];bludgeoning;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Glaive"|&gt;Attack;[&amp;Which];slashing;1d10; @{strength_mod} [STR];none;no;10 ft;melee;none;none --?"[&amp;Which]" -inc "Greataxe"|&gt;Attack;[&amp;Which];slashing;1d12; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Greatsword"|&gt;Attack;[&amp;Which];slashing;2d6; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Halberd"|&gt;Attack;[&amp;Which];slashing;1d10; @{strength_mod} [STR];none;no;10 ft;melee;none;none --?"[&amp;Which]" -inc "Lance"|&gt;Attack;[&amp;Which];piercing;1d12; @{strength_mod} [STR];none;no;10 ft;melee;none;none --?"[&amp;Which]" -inc "Longsword"|&gt;Attack;[&amp;Which];slashing;1d8; @{strength_mod} [STR];Versa;1d10;5 ft;melee;none;none --?"[&amp;Which]" -inc "Maul"|&gt;Attack;[&amp;Which];bludgeoning;2d6; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Morningstar"|&gt;Attack;[&amp;Which];piercing;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Pike"|&gt;Attack;[&amp;Which];piercing;1d10; @{strength_mod} [STR];none;no;10 ft;melee;none;none --?"[&amp;Which]" -inc "Rapier"|&gt;Attack;[&amp;Which];piercing;1d8; @{dexterity_mod} [DEX];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Scimitar"|&gt;Attack;[&amp;Which];slashing;1d6; @{dexterity_mod} [DEX];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Shortsword"|&gt;Attack;[&amp;Which];slashing;1d6; @{dexterity_mod} [DEX];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Trident"|&gt;Attack;[&amp;Which];piercing;1d6; @{strength_mod} [STR];Versa;1d8;5 ft;melee;none;none --?"[&amp;Which]" -inc "War pick"|&gt;Attack;[&amp;Which];piercing;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none --?"[&amp;Which]" -inc "Warhammer"|&gt;Attack;[&amp;Which];bludgeoning;1d8; @{strength_mod} [STR];Versa;1d10;5 ft;melee;none;none --?"[&amp;Which]" -inc "Whip"|&gt;Attack;[&amp;Which];slashing;1d4; @{dexterity_mod} [DEX];none;no;10 ft;melee;none;none --:Attack|Variables are 1 Weapon Name;2 damage type;3 damage dice amount;4 damage modifier;5 Versaile;6 Versatile Damage;7 range;8 melee or thrown;9 resource used;10 resource used name (not used in this script) --&amp;Weapon|[%1%] --=Weap|[%1%] --&amp;DamageAmount|[%3%] --&amp;DamageType|[%2%] --&amp;DamageMod|[%4%] --&amp;Versatile|[%5%] --&amp;VersitileDamage|[%6%] --&amp;AttackType|[%8%] --&amp;ResourceUsed|[%9%] --&amp;AmmoName|[%10%] --?"[&amp;AttackType]" -ninc "Thrown"|notThrown --iAre you going to throw the weapon;Click to select a if you are going to throw the weapon or not.|q;AttackType;Throw the weapon or Melee attack?|Melee|Thrown --:notThrown| --?"[&amp;Versatile]" -ninc "Versa"|notVersatile --iThis weapon is Versatile.;Click to select if you are going to use this as a one or two-handed weapon.|q;UseVersatile;One or Two Handed|Two|One --?"[&amp;UseVersatile]" -inc "One"|notVersatile --&amp;DamageAmount|[&amp;VersitileDamage] --:notVersatile| --#Title|[%1%] --#leftsub|[&amp;AttackType] Attack --#rightsub|[%7%] --=AttackRoll| ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + [%4%] + @{pb} [PROF] --&gt;CheckHexBlade| --#emoteText|@{selected|token_name} attempts to attack @{target|token_name} with their Pact Weapon. --+Roll|You rolled a [$AttackRoll]. --?"@{selected|hexblade}" -ninc "@{target|token_id}"|notHexed --?[$AttackRoll.Base] -eq 19|Crit --:notHexed| --?[$AttackRoll.Base] -eq 20|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -lt @{target|npc_AC}|Miss --:Hit| --&gt;RollDamage| --:AfterDamageHit| --&gt;PlayEffects|none;none;none;[&amp;Weapon] --+Hit!|Your attack hit for [$Damage] [%2%] damage! --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --?"[&amp;AttackType]" -ninc "Thrown"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Miss| --+Miss|Your attack missed! --?"[&amp;AttackType]" -ninc "Thrown"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Fumble| --=Fumblet|[T#Fumble-Table] --&gt;PlayEffects|none;none;none;Failure --+|[img]<a href="https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&amp;rid=giphy.gif&amp;ct=g[/img]" rel="nofollow">https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&amp;rid=giphy.gif&amp;ct=g[/img]</a> --+Fumble|The attack went really bad! --+Bad Stuff| [$Fumblet.tableEntryText] --=FDamage| 1d[%3%] + [%4%] --=FCrit|1d[%3%] + [%4%] + 1d[%3%] [CRIT] --*Possible Damage| Normal Damage is [$FDamage] and Crit Damage is [$FCrit]. --?"[&amp;AttackType]" -ninc "Thrown"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Crit| --&gt;RollDamage|crit --:AfterDamageCrit| --&gt;PlayEffects|none;none;none;[&amp;Weapon] --+Critical Hit|You deal [$Damage] [%2%] damage CRITICAL HIT! --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --?"[&amp;AttackType]" -ninc "Thrown"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:RollDamage| --&amp;vuln| --?"[*T:npc_immunities]" -inc "nonmagical"|notImmune --?"[*T:npc_immunities]" -inc "[&amp;DamageType]"|immune --:notImmune| --?"[*T:npc_resistances]" -inc "nonemagical"|notResistant --?"[*T:npc_resistances]" -inc "[&amp;DamageType]"|HalfD --:notResistant| --?"[*T:npc_vulnerabilities]" -inc "[&amp;DamageType]"|DoubleD --^gettoit| --:HalfD| --&amp;vuln| \ 2 --^gettoit| --:DoubleD| --&amp;vuln| * 2 --^gettoit| --:immune| --+|@{target|token_name} is immune to [&amp;DamageType] damage. --&amp;vuln| * 0 --:gettoit| --?[%1%] -eq crit|CritDamage --=Damage|[&amp;DamageAmount] + [&amp;DamageMod][&amp;HexBlade][&amp;vuln] --&gt;AfterDamageHit| --:CritDamage| --=Damage|[&amp;DamageAmount] + [&amp;DamageMod] + [&amp;DamageAmount] [CRIT][&amp;HexBlade][&amp;vuln] --&gt;AfterDamageCrit| --:AmmoSpent| --&amp;pactblade| --@setattr|_charid [*S:character_id] _pactblade|[&amp;pactblade] _silent --&amp;ResourceUsed|+_name --&amp;ResourceTitle|[*S:[&amp;ResourceUsed]] --+|You can't use your pact blade again until you retrieve it or recreate it. --&lt;| --:PlayEffects|Parameters are : source effect; target effect; line effect; sound effect --vtoken|@{selected|token_id} [%1%] --vtoken|@{target|token_id} [%2%] --vbetweentokens|@{selected|token_id} @{target|token_id} [%3%] --@roll20AM|_audio,play,nomenu|[&amp;Weapon] --&lt;| --:CheckHexBlade| --&amp;HexBlade| --?"@{selected|hexblade}" -ninc "@{target|token_id}"|noHexBlade --&amp;HexBlade|+ + @{pb} [Hexblade Curse] --:noHexBlade| --&lt;| --:NoBlade| --+|You don't have a pact blade. --X| }}
1630181946

Edited 1631591031
5E basic attack script V1.1 Here is an example of a basic attack script I use.&nbsp; I like it this way because if a weapon is bought or discovered, I can add it quickly.&nbsp; As always, I am not a programmer, so if you have any recommendations, it would be appreciated.&nbsp; I might have missed it, but I didn't see anyone else post one, so I thought I would share mine. I would like to add library references, but for some reason the variable carry downs, i.e. [%1%], don't seem to be working.&nbsp; I don't know if I am doing something wrong or how to fix it.&nbsp; Once I figure it out, I will add those. V1.1 updates I added Kurt's Ammo check script so that you just need the name of the Ammo used, you don't have to change it for each Ammo slot. I added a magical weapon section. I added a check for proficiency that the DM changes with yes or no. Added the formatting section that Craven uses.&nbsp; I thought that was nice. Separated out vulnerability check from damage roll.&nbsp; I use this with things like hunters and paladins because I will add procedures that do their own damage, such as Ensnaring Strike, that might do a different damage type.&nbsp; This will allow me to reference the vulnerability/resistance check an additional time without writing it out. !Scriptcard {{ --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --/| &gt;&gt;&gt;&gt;&gt; Formatting &lt;&lt;&lt;&lt;&lt; --#titlecardbackgroundimage|linear-gradient(360deg, rgba(2,0,36,1) 0%, rgba(0,227,208,1) 100%); --#emoteBackground|#transparent --#titleCardBackground|#00e3d0 --#titlefontsize|1.75em --#titlefontlineheight|1.75em --#titleFontColor|white --#titlefontface|Shadows Into Light --#subtitleFontSize|12px --#subtitleFontFace|Verdana --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --#Title|Attack --#whisper|self,gm --/his will whisper the possible attacks that can be used. It will whisper the buttons to the PC and the DM, that way the DM can see where the Player is at in the process. --+Choose your weapon.|[rbutton]Dragon Slayer 1 handed::knowYourWeapon;5[/rbutton][rbutton]Dragon Slayer 2 handed::knowYourWeapon;6[/rbutton][rbutton]Ice Pick::knowYourWeapon;3[/rbutton][rbutton]Handaxe Thrown::knowYourWeapon;2[/rbutton][rbutton]Handaxe Melee::knowYourWeapon;1[/rbutton][rbutton]Sling::knowYourWeapon;4[/rbutton] --X| --:knowYourWeapon| --#whisper|self,gm --=Which|[&amp;reentryval] --?[$Which] -eq 1|&gt;Attack;Handaxe;slashing;1d6; @{strength_mod} [STR];Handaxe;no;5 ft;melee;no;0;yes --?[$Which] -eq 2|&gt;Attack;Handaxe;slashing;1d6; @{strength_mod} [STR];Handaxe;yes;20/60;thrown;no;0;yes --?[$Which] -eq 3|&gt;Attack;Ice Pick;piercing;1d8; @{strength_mod} [STR];none;no;5 ft;melee;none;none;no;0;yes --?[$Which] -eq 4|&gt;Attack;Sling;bludgeoning;1d4; @{dexterity_mod} [DEX];Sling bullets;yes;30/120;ranged;no;0;yes --?[$Which] -eq 5|&gt;Attack;Dragon Slayer;slashing;1d8; @{strength_mod} [STR];none;no;5 ft;melee;yes;1;yes --?[$Which] -eq 6|&gt;Attack;Dragon Slayer;slashing;1d10; @{strength_mod} [STR];none;no;5 ft;melee;yes;1;yes --/This will pass down the variables to save them for use later. --:Attack|Variables are 1 Weapon Name;2 damage type;3 damage dice amount;4 damage modifier;5 ammo;6 If it will use ammo;7 range;8 melee, ranged, or thrown;9 magical;10 Magic Level (Sword +2 would just be 2.);Profficient(Yes or No) --&amp;Weapon|[%1%] --=Weap|[%1%] --&amp;DamageType|[%2%] --&amp;DamageAmount|[%3%] --&amp;DamageMod|[%4%] --&amp;ResourceUsed|[%5%] --&amp;SpendAmmo|[%6%] --&amp;Range|[%7%] --&amp;AttackType|[%8%] --&amp;Magical|[%9%] --&amp;MagicLvl|[%10%] --&amp;Prof|[%11%] --#Title|[&amp;Weapon] --#leftsub|[&amp;AttackType] Attack --#rightsub|[&amp;Range] --&gt;Profficient|Check for the yes or no on &amp;Prof. If yes, will add profiency bonus. --&gt;MagicalWeapon|Will check if yes or no on &amp;Magical and add &amp;MagicLvl bonus to attack and damage. This example also adds damage from Dragon slayer for example. --/This section will check if there is a resource needed for an attack. Since a handaxe can be thrown, the PC may not have it in order to attack. First it will see if there is Ammo needed, then it will find where it is, and then it will check if the PC still has some. --?"[&amp;ResourceUsed]" -eq "none"|noAmmoNeeded --&gt;GetAndCheckAmmoInformation|[*S:character_id];[&amp;ResourceUsed];Ammoname;Ammo --&gt;AmmoAvailable| --:noAmmoNeeded| --/This will whisper to the DM and Player the possible rolls and allow the DM to inform the player for where they ar at. --+Choose an attack roll type.|[rbutton]Standard::knowYourRoll1;1d20[/rbutton][rbutton]Advantage::knowYourRoll1;2d20kh1[/rbutton][rbutton]Disadvantage::knowYourRoll1;2d20kl1[/rbutton] --X| DONE --:knowYourRoll1| --=AttackRoll|[&amp;reentryval] + [&amp;DamageMod][&amp;PB] --#emoteText|@{selected|token_name} attempts to attack @{target|token_name} with their [&amp;Weapon]. --&gt;RollResults|I have a seperate procedure for roll result due to PCs having spells and abilities like Bless and Bardic Inspiration. --?[$AttackRoll.Base] -eq 20|Crit --?[$AttackRoll.Base] -eq 1|Fumble --/This is where you can put roll modifier procedures like bless and bardic inspiration, as these will just add to the roll, they won't affect Crit or Fumble. I will provide examples of those procedures of how I have them at the bottom. --=AttackRoll|[$AttackRoll] + [$BlessRoll] + [$BardicRoll] --?[$AttackRoll.Total] -lt @{target|npc_AC}|Miss --:Hit| --#whisper| --&gt;Vulnerable| --&gt;RollDamage| --&gt;PlayEffects|none;none;none;[&amp;Weapon] --+Hit!|Your attack hit for [$Damage] [&amp;DamageType] damage! --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --?"[&amp;SpendAmmo]" -eq "no"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Miss| --#whisper| --+Miss|Your attack missed! --?"[&amp;SpendAmmo]" -eq "no"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Fumble|This will roll a fumble table for a "Bad" thing that happened and show it to everyone. You can intrupret how you want to use it. I got mine from <a href="https://saveversus.wordpress.com/2014/09/15/fumble-charts-dd-5th-edition/" rel="nofollow">https://saveversus.wordpress.com/2014/09/15/fumble-charts-dd-5th-edition/</a> --#whisper| --=Fumblet|[T#Fumble-Table] --&gt;PlayEffects|none;none;none;Failure --+|[img]<a href="https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&amp;rid=giphy.gif&amp;ct=g[/img]" rel="nofollow">https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&amp;rid=giphy.gif&amp;ct=g[/img]</a> --+Fumble|The attack went really bad! --+Bad Stuff| [$Fumblet.tableEntryText] --=FDamage| [&amp;DamageAmount] + [&amp;DamageMod] --=FCrit|[&amp;DamageAmount] + [&amp;DamageMod] + [&amp;DamageAmount] [CRIT] --*Possible Damage| Normal Damage is [$FDamage] and Crit Damage is [$FCrit]. --?"[&amp;SpendAmmo]" -eq "no"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Crit| --#whisper| --&gt;Vulnerable| --&gt;RollDamage|crit --&gt;PlayEffects|none;none;none;[&amp;Weapon] --+Critical Hit|You deal [$Damage] [%2%] damage CRITICAL HIT! --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --?"[&amp;SpendAmmo]" -eq "no"|noAmmoSpent --&gt;AmmoSpent| --:noAmmoSpent| --X| --:Vulnerable| --&amp;vuln| --?"[*T:npc_vulnerabilities]" -inc "[&amp;DamageType]"|DoubleD --?"[&amp;Magical]" -inc "yes"|MagVuln --?"[*T:npc_resistances]" -inc "[&amp;DamageType]"|HalfD --?"[*T:npc_immunities]" -inc "[&amp;DamageType]"|immune --&lt;| --:MagVuln| --?"[*T:npc_immunities]" -inc "nonmagical"|notImmune --?"[*T:npc_immunities]" -inc "[&amp;DamageType]"|immune --:notImmune| --?"[*T:npc_resistances]" -inc "nonmagical"|notResistant --?"[*T:npc_resistances]" -inc "[&amp;DamageType]"|HalfD --:notResistant| --&lt;| --:HalfD| --&amp;vuln| \ 2 [Resistant] --&lt;| --:DoubleD| --&amp;vuln| * 2 [Vulnerable] --&lt;| --:immune| --+|@{target|token_name} is immune to [&amp;DamageType] damage. --&amp;vuln| * 0 [Immune] --&lt;| --:RollDamage| --?[%1%] -eq crit|CritDamage --=Damage|[&amp;DamageAmount] + [&amp;DamageMod][&amp;MagWeapDamBonus][&amp;vuln] --&lt;| --:CritDamage| --=Damage|[&amp;DamageAmount] + [&amp;DamageMod] + [&amp;DamageAmount] [CRIT][&amp;MagWeapDamBonus][&amp;vuln] --&lt;| --/This is going to find the ammo used on the character sheet and determine how much is available. --:GetAndCheckAmmoInformation|character_id;resourceName;Ammoname;Ammo --?"[%2%]" -eq "[*[%1%]:class_resource_name]"|_Lib5E_IsResourceClass --?"[%2%]" -eq "[*[%1%]:other_resource_name]"|_Lib5E_IsResourceOther --Rfirst|[%1%];repeating_resource --:_Lib5E_ResourceLoop| --?"[*R:resource_left_name]" -eq "[%2%]"|_Lib5E_IsResourceLeft --?"[*R:resource_right_name]" -eq "[%2%]"|_Lib5E_IsResourceRight --Rnext| --?"[*R:resource_left_name]" -ne "NoRepeatingAttributeLoaded"|_Lib5E_ResourceLoop --&amp;[%3%]|NotFound --&amp;[%4%]|NotFound --$[%4%]|0 --&lt;| --:_Lib5E_IsResourceClass| --&amp;[%3%]|class_resource_name --&amp;[%4%]|class_resource --=[%4%]|[*[%1%]:class_resource] --&lt;| --:_Lib5E_IsResourceOther| --&amp;[%3%]|other_resource --&amp;[%4%]|other_resource --=[%4%]|[*[%1%]:other_resource] --&lt;| --:_Lib5E_IsResourceLeft| --&amp;[%3%]|[*R&gt;resource_left_name] --&amp;[%4%]|[*R&gt;resource_left] --=[%4%]|[*R:resource_left] --&lt;| --:_Lib5E_IsResourceRight| --&amp;[%3%]|[*R&gt;resource_right_name] --&amp;[%4%]|[*R&gt;resource_right] --=[%4%]|[*R:resource_right] --&lt;| --&lt;| --:AmmoAvailable|This will determine if the Ammo needed is available. --?[$Ammo] -eq 0|NoAmmoLeft --=Ammo|[$Ammo] - 1 --&lt;| --:NoAmmoLeft|This will inform the PC that they are out of that ammo they tried to use. --#whisper| --+|[*S:character_name] has no [&amp;ResourceUsed] left. --#emoteText|[*S:character_name] is all out of [&amp;ResourceUsed]. --X|NoSlotsLeftStop --:AmmoSpent|This will reduce the ammo if used. --@setattr|_charid [*S:character_id] _[&amp;Ammo]|[$Ammo] _silent --+|[&amp;ResourceUsed] Left: [$Ammo] --X| --:PlayEffects|Parameters are : source effect; target effect; line effect; sound effect --vtoken|@{selected|token_id} [%1%] --vtoken|@{target|token_id} [%2%] --vbetweentokens|@{selected|token_id} @{target|token_id} [%3%] --@roll20AM|_audio,play,nomenu|[&amp;Weapon] --&lt;| --:Profficient| --&amp;PB| --?[&amp;Prof] -inc "no"|NotProf --&amp;PB|+ + @{pb} [PROF] --:NotProf| --&lt;| --:MagicalWeapon|This will check to see if the weapon is magical and add the correct attributes. --&amp;MagWeapHitBonus| --&amp;MagWeapDamBonus| --?"[&amp;Magical]" -inc "Yes"|YesMagic --&lt;| --:YesMagic| --&amp;MagWeapHitBonus|+ + [&amp;MagicLvl] [Magical Weapon] --&amp;MagWeapDamBonus|+ + [&amp;MagicLvl] [Magical Weapon] --?"[*T:npc_type]" -inc "dragon"|dragon --&lt;| --:dragon| --&amp;MagWeapDamBonus|+ + 3d6 [Dragon Slayer] --&lt;| --:RollResults|This will display the roll results depending on if you have Bardic inspiration or bless activated. This will allow you to mouse over the results and see what happened. --?[$BardicRoll] -ge 1 -and [$BlessRoll] -ge 1|BothBardAndBless --?[$BardicRoll] -ge 1|BardTalk --?[$BlessRoll] -ge 1|BlessTalk --+Attack Roll|You rolled a [$AttackRoll] to hit. --&lt;| --:BardTalk| --+Attack Roll|You rolled a [$AttackRoll] to hit. --+Bardic Inspiration|You rolled [$BardicRoll] for bardic inspiration. --&lt;| --:BlessTalk| --+Attack Roll|You rolled [$AttackRoll] to hit and [$BlessRoll] from blessed. --&lt;| --:BothBardAndBless| --+Attack Roll|You rolled [$AttackRoll] to hit, [$BlessRoll] from blessed, and [$BardicRoll] for bardic inspiration. --&lt;| --:Bardic|The player character will need an attribut under the Attributes &amp; Abilities tab called Bard. This should get toggled on when the bard uses Bardic Inspiration on the character. --=BardicRoll|0 --?@{selected|Bard} -eq 1|BardOn --&gt;AfterBardic| --:BardOn| --?[$Bless] -ne 0|BardBlessed --+You rolled a [$AttackRoll.Base] for attack for a total of [$AttackRoll]. Do you want to use Bardic Inspiration?|[rbutton]Yes::BardYes[/rbutton][rbutton]No::AfterBardic[/rbutton] --X| DONE --:BardBlessed| --+You rolled a [$AttackRoll.Base] for attack for a total of [$AttackRoll]. You rolled [$BlessRoll] for blessed. Do you want to use Bardic Inspiration?|[rbutton]Yes::BardYes[/rbutton][rbutton]No::AfterBardic[/rbutton] --X| DONE --:BardYes| --?@{Bard|level} -eq 20|&gt;BardDie;20 --?@{Bard|level} -lt 20|&gt;BardDie;@{Bard|level} \ 5 + 1 * 2 + 4 --:BardDie| --=BardicRoll| 1d[%1%] --@setattr|_charid @{selected|character_id} _Bard|0 _silent --&gt;AfterBardic| --:CheckBless|This will look at the savemod on the PC character sheet to see if they have bless. I usually have Bless as the first glabal save modifier. --=Bless|@{selected|repeating_savemod_$0_global_save_active_flag} --?[$Bless] -ne 0|Blessed --=BlessRoll|0 --&lt;| --:Blessed| --=BlessRoll|1d4 --&lt;| }}
5E Bardic Inspiration This one is pretty simple.&nbsp; First, you will need to add an attribute called Bard to all the other PCs.&nbsp; I have the bard use the ability on another character.&nbsp;&nbsp; !scriptcards{{ --#Title|Bardic Inspiration --#leftsub|Class Ability --#rightsub|Bonus Action 60 Feet --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --&gt;GetAndCheckSlotInformation| --#emoteText|@{selected|token_name} gives @{target|token_name} Bardic Inspiration with some tasty jams. --@setattr|_charid @{target|character_id} _Bard|1 _silent --&gt;PlayEffects|@{selected|token_id};@{target|token_id}|none|none|none|Bardic Inspiration --&gt;ApplyDamage| --:GetAndCheckSlotInformation| --=SlotsTotal|0 --=SlotsExpended|@{selected|repeating_resource_$0_resource_left} --?[$SlotsExpended] -eq [$SlotsTotal]|NoSlotsLeft --=SlotsExpended|[$SlotsExpended] - 1 --&lt;| --:NoSlotsLeft| --#emoteText|@{selected|token_name} doesn't have what it takes to cast Bardic Inspiration. --+|You need a long rest before you can do that again. --X| --:ApplyDamage| --@setattr|_charid [*S:character_id] _repeating_resource_$0_resource_left|[$SlotsExpended] _silent --+|bardic Inspiration Left left: [$SlotsExpended] --X| --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect --vtoken|[%1%] [%3%] --vtoken|[%2%] [%4%] --vbetweentokens|[%1%] [%2%] [%5%] --@roll20AM|_audio,play,nomenu|Bardic Inspiration --&lt;| }} In the attack macro for the other PCs, I add this right after I check for Crit or Fumble check: &nbsp; --?[$AttackRoll.Base] -eq 20|Crit &nbsp; --?[$AttackRoll.Base] -eq 1|Fumble &nbsp; --&gt;Bardic| &nbsp; --:AfterBardic| &nbsp; --=AttackRoll|[$AttackRoll] + [$BardicRoll] and then I have this that will check if they have bardic inspiration and then ask if they want to use it: --:Bardic| --?@{selected|Bard} -eq 1|BardOn --&gt;AfterBardic| --:BardOn| --iYou rolled a [$AttackRoll.Base] for attack for a total of [$AttackRoll].;Click this button to to decide if you want to use Bardic Inspraition.|q;maybe;Yes or No?|Yes|No| --?"[&amp;maybe]" -inc "yes"|BardYes --&gt;AfterBardic| --:BardYes| --=BardDie|@{Bob|class2_classlevel} \ 5 * 2 + 6 --=BardicRoll| 1d[$BardDie] --+Bardic Inspiration|You added [$BardicRoll] to your roll. --@setattr|_charid @{selected|character_id} _Bard|0 _silent --&gt;AfterBardic| Our bard's name is Bob and he is multileveled into Bard.&nbsp; You will need to change&nbsp; @{Bob|class2_classlevel}&nbsp; to match your bards name and level.&nbsp; You can do the same thing for savings rolls and ability checks very easily. I would also recommend adding this to turn it off or for a rest: --@setattr|_charid @{selected|character_id} _Bard|0 _silent
Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&amp;D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.&nbsp;&nbsp; That's a cool script. One question though, how complicated would it be to add the limitation when encountering a wall or a door (or a window of course). For the moment, tokens pass through the walls when blown away against one wall.
1630353493

Edited 1630353733
My weapons script and break down. If anyone has a question send me a message and I will try to help. I am no expert at this and I am sure it can be done better but it works.&nbsp; First the code:&nbsp; !scriptcard {{ +++dnd5elib+++ --#title|Dagger --#leftsub|Melee Attack, Thrown --#rightsub|Range: 5' :20/60, Finesse --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|@{selected|token_name} attacks @{target|token_name} --/| &gt;&gt;&gt;&gt;&gt; Formatting &lt;&lt;&lt;&lt;&lt; --#titlecardbackgroundimage|linear-gradient(360deg, rgba(2,0,36,1) 0%, rgba(147,39,41,1) 100%); --#emoteBackground|#transparent --#titleCardBackground|#932729 --#titlefontsize|1.75em --#titlefontlineheight|1.75em --#titleFontColor|white --#titlefontface|Shadows Into Light --#subtitleFontSize|12px --#subtitleFontFace|Verdana --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --:|What is the Base Weapons Damage express 1dx --&amp;BaseWeaponDamage|1d4 --:|Magic change settings here --=Magic|0 --:|Damage Type Slashing, Bludgeoning, Piercing --=DamageType|Piercing --:| Check for attack mods like Bless and Damage mods like Sneak Attack --&gt;Lib5E_Active_Global_Attack_Modifiers|@{selected|character_id};Bless --&gt;Lib5E_Active_Global_Damage_Modifiers|@{selected|character_id};Sneak;CritDam --:|Get Targets AC --=TargetAC|@{target|npc_ac} --?[$TargetAC.Total] -gt 0|DoneWithAC --=TargetAC|@{target|ac} --:DoneWithAC| --?[*S:strength_mod] -gt [*S:dexterity_mod]|&gt;SetMod;strength|&gt;SetMod;dexterity --:|Advantage, Disadvantage, Normal --&amp;RollType|?{Advantage or Disadvantage?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} --=AttackRoll|[&amp;RollType] [BASE] + [&amp;FinesseMod] [MOD] + [*S:pb] [PROF] + [$Magic] [Magic] [&amp;Bless] --+Attack|@{selected|token_name} rolls [$AttackRoll] vs AC [$TargetAC]. --+Base roll:| [b] [$AttackRoll.Base] [/b] --?[$AttackRoll.Base] -eq 20|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -ge [$TargetAC.Total]|Hit --+Miss|The attack missed. --^Final| --:Fumble| --+Fumble!|The attack went horribly wrong. --^Final| --:Hit| --=Damage| [&amp;BaseWeaponDamage] + [&amp;FinesseMod] [MOD] + [$Magic] [Magic] [&amp;Sneak] --+Hit!|The attack hit @{target|token_name} for [$Damage] [$DamageType.RollText]. --+Rolled:|[b][$Damage.Text] [/b] --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --^Healthcheck| --:Crit| --=Damage|[&amp;BaseWeaponDamage]+ [&amp;FinesseMod] [MOD] + [&amp;BaseWeaponDamage] [CRIT] [&amp;Sneak] [&amp;CritDam] --+Critical Hit!|The attack hit @{target|token_name} for [$Damage] [$DamageType.RollText]. --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --:Healthcheck| --=targethp|@{target|Bar1}-[$Damage] --?[$targethp] -lt 1|Dead --^Final| --:Dead| --+Status:|[b]@{target|token_name} is Dead and worth @{target|npc_XP}[/b] --@token-mod|_ids @{Target|token_id} _set statusmarkers|path-dead --:Final| --:SetMod|which mod to use --&amp;FinesseMod|[*S:[%1%]_mod] --&lt;| --:Final| --X| }} What it looks like:&nbsp; Break down: The Finesse part is use for Finesse weapons and I use&nbsp; --&amp;FinesseMod|[*S:strength_mod] Other changes I use are for Versatile&nbsp;and Great Weapon Fighting.&nbsp; --:|What is the Base Weapons Damage express 1dx --&amp;BaseWeaponDamage|1d8 --:|What is the Base Weapons Damage express 1dx 1dxro&lt;2 re-roll once if less then 2 --&amp;BaseWeaponDamage|1d8ro&lt;2 --:|What is the Base Weapons Damage express 1dx --&amp;BaseWeaponDamage|?{ How many hands?|1,1d6|2,1d8} --&amp;BaseWeaponDamage|?{ How many hands?|1,1d6|2,1d8ro&lt;2} --&amp;BaseWeaponDamage|?{Do you have Great Weapon Fighting?|Yes,2d6ro&lt;2|No,2d6} Hope this can help someone.&nbsp; Craven
I'm just starting to teach myself how to write these scripts. I want to do an Eldritch Blast. Is anyone working on this? If not I'll post what I come up with once I get it to work.
Gene S. said: I'm just starting to teach myself how to write these scripts. I want to do an Eldritch Blast. Is anyone working on this? If not I'll post what I come up with once I get it to work. I think that Will M. has created one on this <a href="https://github.com/MadCar-Dev/Default" rel="nofollow">https://github.com/MadCar-Dev/Default</a> Have a look at it
Lionel V. said: Gene S. said: I'm just starting to teach myself how to write these scripts. I want to do an Eldritch Blast. Is anyone working on this? If not I'll post what I come up with once I get it to work. I think that Will M. has created one on this <a href="https://github.com/MadCar-Dev/Default" rel="nofollow">https://github.com/MadCar-Dev/Default</a> Have a look at it That is really good. I want to add to it so the caster can select multiple targets and some other functionality. Thanks for the info.
Kurt, I'm trying to get this updated to check and deduct spell slots. Any guidance? Kurt J. said: 5E Lightning Bolt (Easily changeable for other line-based spells)
1630876729

Edited 1630894913
This is great. I'm curious if there is a way to run a macro from the script? I have a macro that i use to mark a token as dead and that automatically adds the XP to a character that i call Viewers (I got the idea from Carnivorous Meat on YouTube). Here is the macro I have: /fx nova-blood @{selected|token_id} /w gm @{selected|token_name} has died. !token-mod --set statusmarkers|=dead !token-mod --set bar3_value|0 !token-mod --set bar3_max|0 !token-mod --off light_hassight !token-mod --off showname !token-mod --set aura1_radius| aura2_radius|&nbsp; !wammo @{Viewers|character_id} experience [[@{selected|npc_xp}*?{Award experience (Y=1/N=0)?|1}]] EarnedXP !noturn &nbsp;Any ideas? Craven said: My weapons script and break down. If anyone has a question send me a message and I will try to help. I am no expert at this and I am sure it can be done better but it works.&nbsp;
Will,&nbsp; I'm trying to rework this for another spell. Is there a way to query each target for something like Hex? Will M. said: Spell: Scorching Ray&nbsp; My version of Scorching Ray.&nbsp; Based largely on Michael C's original version but with the following differences: Modified to work with TokenMod (instead of AlterBars) to apply damage. Asks for targets one at a time instead of all at once.&nbsp; Formatting changes
Kurt, I'm trying to update this for a breath weapon for a dragonborn character. His breath weapon is a 30ft line. How do I stop the calculation at 30ft? Also it keeps crashing my sandbox. Any ideas? Kurt J. said: 5E Lightning Bolt (Easily changeable for other line-based spells)
With some help from Kurt and David, I made 1 change to Will's Awesome Spell Book.&nbsp; Just before the Cast Spell sheetbutton, I added: --~MacroName|string;replaceall; ;;[*R:spellname] I then changed the button to be: --+|[c][sheetbutton] Cast Spell 慄::@{selected|character_name}::[&amp;MacroName][/sheetbutton][/c] I generally have a macro for every spell.&nbsp; Now I will just change the macro name to the spell name with no spaces and it uses the macro for the spell. Thanks for the Spell Book Will and for the help David and Kurt. Will's spell book: <a href="https://github.com/MadCar-Dev/Default/blob/main/ScriptCards/Spellbook.sc" rel="nofollow">https://github.com/MadCar-Dev/Default/blob/main/ScriptCards/Spellbook.sc</a> Will: <a href="https://app.roll20.net/users/464055/will-m" rel="nofollow">https://app.roll20.net/users/464055/will-m</a> David: <a href="https://app.roll20.net/users/3987469/david-m" rel="nofollow">https://app.roll20.net/users/3987469/david-m</a> Kurt: <a href="https://app.roll20.net/users/2365448" rel="nofollow">https://app.roll20.net/users/2365448</a>
This looks awesome.&nbsp; I might be missing something, but is there a way to tell who the target was other than AC once an action was taken? Kurt J. said: 5E Action Menu Script This ScriptCards script will display (to the person executing the script) a menu containing buttons for actions (NPCs), attacks (PCs) and spells (Both). These buttons can be clicked to execute the action, which will be displayed as an output card to everyone. While not technically required, there are some features that won't work on ScriptCards below 1.3.9. With any character token selected, executing the macro will present the caller with a list of actions and spells available to that character as a set of buttons. Items in the Character's "Attacks &amp; Spellcasting" section will only be displayed as actions if the AREN'T a spell (they will be displayed under the appropriate spell level instead). The reentrant functions attempt to analyze the attack or spell and construct an appropriate output card. This should work for most 5e spells and attacks. You can define a "spell mule" (see the beginning of the script). If you do, the script will check for Ability names on the spell mule character that match the names of the spells it is creating buttons for. If it finds on (CASE SENSITIVE) it will create a sheet button to that ability instead of a reentrant button. This allows odd-ball spells to fire their own custom scripts from the same card interface (I've got a character named "Spell_Mule" in my game, with an ability "Fireball" that contains the fireball macro. When the card is displayed and fireball is clicked it will run the full fireball script instead of trying to come up with something on its own). If you wish to suppress the output of ACs from public view, change the "showGmInfo" value near the top of the script from 0 to 1. If you don't upgrade to 1.3.9, the formatting will look a little weird and the spell mule stuff won't work, but otherwise the script should function. The script is hosted on a GIST, and is&nbsp; available here . It is likely to be updated and revised as bugs are discovered, etc. I do intend to add support for global modifiers, but I haven't gotten there yet. Here is a sample video using the script for a couple of PCs and NPCs, as well as how to use the "Spell_Mule" to substitute custom scripts for spells. In this case, I fire the Lightning Bolt spell without the Spell_Mule setup and then set up the mule and fire it again to see the custom script.
1631058871
Kurt J.
Pro
API Scripter
Justin G. said: This looks awesome.&nbsp; I might be missing something, but is there a way to tell who the target was other than AC once an action was taken? Kurt J. said: 5E Action Menu Script This ScriptCards script will display (to the person executing the script) a menu containing buttons for actions (NPCs), attacks (PCs) and spells (Both). These buttons can be clicked to execute the action, which will be displayed as an output card to everyone. While not technically required, there are some features that won't work on ScriptCards below 1.3.9. With any character token selected, executing the macro will present the caller with a list of actions and spells available to that character as a set of buttons. Items in the Character's "Attacks &amp; Spellcasting" section will only be displayed as actions if the AREN'T a spell (they will be displayed under the appropriate spell level instead). The reentrant functions attempt to analyze the attack or spell and construct an appropriate output card. This should work for most 5e spells and attacks. You can define a "spell mule" (see the beginning of the script). If you do, the script will check for Ability names on the spell mule character that match the names of the spells it is creating buttons for. If it finds on (CASE SENSITIVE) it will create a sheet button to that ability instead of a reentrant button. This allows odd-ball spells to fire their own custom scripts from the same card interface (I've got a character named "Spell_Mule" in my game, with an ability "Fireball" that contains the fireball macro. When the card is displayed and fireball is clicked it will run the full fireball script instead of trying to come up with something on its own). If you wish to suppress the output of ACs from public view, change the "showGmInfo" value near the top of the script from 0 to 1. If you don't upgrade to 1.3.9, the formatting will look a little weird and the spell mule stuff won't work, but otherwise the script should function. The script is hosted on a GIST, and is&nbsp; available here . It is likely to be updated and revised as bugs are discovered, etc. I do intend to add support for global modifiers, but I haven't gotten there yet. Here is a sample video using the script for a couple of PCs and NPCs, as well as how to use the "Spell_Mule" to substitute custom scripts for spells. In this case, I fire the Lightning Bolt spell without the Spell_Mule setup and then set up the mule and fire it again to see the custom script. I've updated the GitHub with version 1.6.5 of this script. It corrects a couple of bugs, and now enables emote display with the source/target tokens and a description of the action.
You da man. Kurt J. said: Justin G. said: This looks awesome.&nbsp; I might be missing something, but is there a way to tell who the target was other than AC once an action was taken? Kurt J. said: 5E Action Menu Script This ScriptCards script will display (to the person executing the script) a menu containing buttons for actions (NPCs), attacks (PCs) and spells (Both). These buttons can be clicked to execute the action, which will be displayed as an output card to everyone. While not technically required, there are some features that won't work on ScriptCards below 1.3.9. With any character token selected, executing the macro will present the caller with a list of actions and spells available to that character as a set of buttons. Items in the Character's "Attacks &amp; Spellcasting" section will only be displayed as actions if the AREN'T a spell (they will be displayed under the appropriate spell level instead). The reentrant functions attempt to analyze the attack or spell and construct an appropriate output card. This should work for most 5e spells and attacks. You can define a "spell mule" (see the beginning of the script). If you do, the script will check for Ability names on the spell mule character that match the names of the spells it is creating buttons for. If it finds on (CASE SENSITIVE) it will create a sheet button to that ability instead of a reentrant button. This allows odd-ball spells to fire their own custom scripts from the same card interface (I've got a character named "Spell_Mule" in my game, with an ability "Fireball" that contains the fireball macro. When the card is displayed and fireball is clicked it will run the full fireball script instead of trying to come up with something on its own). If you wish to suppress the output of ACs from public view, change the "showGmInfo" value near the top of the script from 0 to 1. If you don't upgrade to 1.3.9, the formatting will look a little weird and the spell mule stuff won't work, but otherwise the script should function. The script is hosted on a GIST, and is&nbsp; available here . It is likely to be updated and revised as bugs are discovered, etc. I do intend to add support for global modifiers, but I haven't gotten there yet. Here is a sample video using the script for a couple of PCs and NPCs, as well as how to use the "Spell_Mule" to substitute custom scripts for spells. In this case, I fire the Lightning Bolt spell without the Spell_Mule setup and then set up the mule and fire it again to see the custom script. I've updated the GitHub with version 1.6.5 of this script. It corrects a couple of bugs, and now enables emote display with the source/target tokens and a description of the action.
Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&amp;D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.&nbsp;&nbsp; Very cool!&nbsp; I was able to take this and quickly modify it for my player that has the Telekinetic feat which can push or pull a target 5 ft.&nbsp; But your code was supereasy to understand and will be impressive the next time they use that ability! :-)
Lionel V. said: Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&amp;D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.&nbsp;&nbsp; That's a cool script. One question though, how complicated would it be to add the limitation when encountering a wall or a door (or a window of course). For the moment, tokens pass through the walls when blown away against one wall. I thought about that while I was writing it, but there isn't a way to read the map layer and determine what's a wall.&nbsp; It may be that you would could use the Dynamic Lighting lines to draw borders and select the option to restrict token movement.&nbsp; Not sure if that would work as I've not tested it.
I tested this and lines on the Lighting Layer and with Restrict Movement option enabled, it does not prevent the token from moving through the wall.&nbsp; I think this may be a limitation of tokenmod (doesn't check or respect dynamic lighting barriers). Will M. said: Lionel V. said: Will M. said: Scriptcard for "Gust of Wind" spell The following script can be used to execute a D&amp;D 5e "Gust of Wind" spell attack This new script requires version 1.3.9a+ of scriptcards, specifically the new math "Angle" function.&nbsp;&nbsp; That's a cool script. One question though, how complicated would it be to add the limitation when encountering a wall or a door (or a window of course). For the moment, tokens pass through the walls when blown away against one wall. I thought about that while I was writing it, but there isn't a way to read the map layer and determine what's a wall.&nbsp; It may be that you would could use the Dynamic Lighting lines to draw borders and select the option to restrict token movement.&nbsp; Not sure if that would work as I've not tested it.
This is awesome for line-based spells and easily adaptable!&nbsp; Thanks.&nbsp;&nbsp; One question: How would I only target tokens on the object layer (or remove tokens on the gm or map layer).&nbsp; As it stands, if the line goes through a token on the gm layer it shows in the output (and takes damage).&nbsp; Or maybe this can be an option to customize at the top (which layers to include)? Kurt J. said: 5E Lightning Bolt (Easily changeable for other line-based spells) NOTE: This requires v1.2.8+ of ScriptCards and uses AlterBars to apply damage. NOTE 2: Updated on 5/19/2021 to fix a bug in the saving throw roll This script requires a selected token and a target token. The token can be a non-creature token if you want to create one for spell targeting. The script will calculate a line between the two tokens and determine which squares are impacted by the spell and apply damage to the tokens hit taking resistance, vulnerability, and immunity into account. The script can easily be updated for other line-based spells by changing the variables near the top of the script, including spellName, spellDamageDice, spellDamageDieType, damageType, and saveType. You can alter the list of spell levels the player can select from by changing the SpellLevel roll query.
1631526043
Kurt J.
Pro
API Scripter
I have made some updates to my 5E sample scripts on the GitHub : Dragon Breath has had some formatting cleaned up. I plan to do a code walkthrough youtube video on this script in the near future, so I wanted to add some additional comments and rearrange a couple of things. Dragon Breath, Lightning Bolt, and Burning Hands have all been updated to allow for a "checkLayers" setting to mask out tokens on some layers. By default, both object and gmlayer tokens are included, since invisible tokens don't normally escape AOE damage just because they are invisible, but it is now customizable as a setting in all three scripts. Lightning Bolt and Burning Hands have received ports of my newer apply damage code, allowing for settings for the script (alterbar or token-mod) to use and the bar to change. The fireball sample will need more or less a complete rewrite to incorporate these features, but I'll work on that over the next week or so. I'll probably use one of the above scripts as a base for rewriting it.
That's great!&nbsp; I did get it to skip tokens on the gmlayer by adjusting it with your modifications and adding:&nbsp; &nbsp; &nbsp; --?[&amp;checkLayers] -ninc [*[&amp;tokenid]:t-layer]|skipThisToken I also added this to skip over tokens that were already "dead".&nbsp; I referenced the new &amp;hitPointsBar variable. &nbsp; &nbsp; --?[*[&amp;tokenid]:t-bar[&amp;hitPointsBar]_value] -le 0|skipThisToken Very nice.&nbsp; Thanks! Kurt J. said: I have made some updates to my 5E sample scripts on the GitHub : Dragon Breath has had some formatting cleaned up. I plan to do a code walkthrough youtube video on this script in the near future, so I wanted to add some additional comments and rearrange a couple of things. Dragon Breath, Lightning Bolt, and Burning Hands have all been updated to allow for a "checkLayers" setting to mask out tokens on some layers. By default, both object and gmlayer tokens are included, since invisible tokens don't normally escape AOE damage just because they are invisible, but it is now customizable as a setting in all three scripts. Lightning Bolt and Burning Hands have received ports of my newer apply damage code, allowing for settings for the script (alterbar or token-mod) to use and the bar to change. The fireball sample will need more or less a complete rewrite to incorporate these features, but I'll work on that over the next week or so. I'll probably use one of the above scripts as a base for rewriting it.
Kurt J. said: The fireball sample will need more or less a complete rewrite to incorporate these features, but I'll work on that over the next week or so. I'll probably use one of the above scripts as a base for rewriting it. I ended up doing a rewrite of the fireball script for myself using the above features.&nbsp; But I also do it a little differently by spawning a target icon on the caster, letting them move that to target the AoE spell, then clicking a button to "cast" the spell.&nbsp; I had to reverse some of the variables since the source is now the target icon, not the spellcaster, but ended up getting it working pretty smoothly.&nbsp; I look forward to seeing what you come up with on the updated Fireball script.
Scriptcard for Cone of Cold Spell Based off of Kurt's Burning Hands Scriptcard Can be used for Breath Weapon attack of Dragon by changing damage type.&nbsp; Or prompt for damage type with ?{Damage Type|acid|cold|fire|lightning|poison} Arrays are expanded for 60 ft cones (I used Excel to map out the cells).&nbsp; Visually, the Up, Down, Left and Right arrays are overlapped by the Diagonals, but the arrays are the full area of effect. Expanded Saving Throws section to show if target was Resistant, Immune or Vulnerable Maybe some other changes, since I based this off my Burning Hands script which was based on Kurt's !script {{ &nbsp; --/|Based on Kurt's Burning Hands script. Updated arrays for 60' cone and other parameters. &nbsp; --&amp;spellName|Cone of Cold &nbsp;&nbsp; &nbsp; --/|Note: because the spell will be cast at a min level of 5, we use 3 here to get the total dice (3+5=8) &nbsp; --&amp;spellL0DamageDice|3 &nbsp;&nbsp; &nbsp; --/|Prompt for the spell level. Update this to account for the minimum level of the spell &nbsp; --=SpellLevel|?{Spell Slot Level?|5|6|7|8|9} &nbsp; --&amp;spellDamageDieType|8 &nbsp; --&amp;damageType|cold &nbsp; --&amp;saveType|constitution &nbsp; --&amp;tokenVFX|burn-frost &nbsp; --&amp;lineVFX|breath-frost &nbsp; --/|Set this to either "token-mod", "alterbars", or anything else to not apply damage &nbsp; --&amp;damageApplyScript|token-mod &nbsp; --/|Set this to the bar number you use to track hit points &nbsp; --&amp;hitPointsBar|1 &nbsp; --/|Set this to a list of layers to a semicolon separated check for tokens on. By default, objects and gmlayer are checked. &nbsp; --/|possible values are objects, gmlayer, and map, so to check all three, use "objects;gmlayer;map" &nbsp; --&amp;checkLayers|objects &nbsp;&nbsp; &nbsp; --/|Source Token is the caster, and target token is the "end of the line". Can be a non-creature (no represents) token. &nbsp; --#sourcetoken|@{selected|token_id} &nbsp; --/|Get all of the tokens on the page so we can cache their positions &nbsp; --~|array;pagetokens;alltokens;@{selected|token_id} &nbsp; --#leftsub|Save DC @{selected|spell_save_dc} &nbsp; --#rightsub|Spell Level: [$SpellLevel]&nbsp; &nbsp; --#title|[&amp;spellName] &nbsp; --#emoteBackground|#eeffee &nbsp; --#emoteText|*@{selected|token_name} casts [&amp;spellName].* &nbsp;--&gt;GetAndCheckSlotInformation| &nbsp;--&gt;DeductSpellSlot| &nbsp; --/|Calculate damage based on spell slot. &nbsp; --=DamageDice|[$SpellLevel.Total] + [&amp;spellL0DamageDice] &nbsp; --=Damage|[$DamageDice.Total]d[&amp;spellDamageDieType] &nbsp; --=HalfDamage|[$Damage.Total] \ 2 &nbsp; --=DoubleDamage|[$Damage.Total] * 2 &nbsp; --=ImmuneDamage|[$Damage.Total] * 0 &nbsp; --=QuarterDamage|[$Damage.Total] \ 4 &nbsp; --/|Determine damage subroutine. Start by assuming we aren't going to apply damage &nbsp; --&amp;damageRoutine|DontApplyDamage &nbsp; --?[&amp;damageApplyScript] -eq "token-mod"|&amp;damageRoutine;ApplyDamageTokenmod &nbsp; --?[&amp;damageApplyScript] -eq "alterbars"|&amp;damageRoutine;ApplyDamageAlterbars &nbsp; --/|Since we want to be able to hover over a roll and see the dice details, output the rolled damage at the &nbsp; --/|top of the card. If all critters make their save, the half damage roll won't contain the details. &nbsp; --+|[c][b]Damage Roll: [/b][$Damage][/c] &nbsp; --+|[c]60ft cone, [$Damage.RollText] [&amp;damageType] damage[/c]&nbsp; &nbsp;&nbsp; &nbsp; --/|Create an array to hold the tokens that are intersected by the line. &nbsp; --~|array;define;tokensHit; &nbsp;&nbsp; &nbsp; --&gt;createTokenLookup| &nbsp; --/|Prompt for a direction for the cast, and define arrays that indicate the relative spaces that will be hit. &nbsp; --&amp;direction|?{Direction|&amp;#x2B06; (UP),U|&amp;#x2197; (UP-RIGHT),UR|&amp;#x27A1; (RIGHT),R|&amp;#x2198; (DOWN-RIGHT),DR|&amp;#x2B07; (DOWN),D|&amp;#x2199; (DOWN-LEFT),DL|&amp;#x2B05; (LEFT),L|&amp;#x2196 (UP-LEFT);,UL|} &nbsp; --~|array;define;U;0,-1;-1,-2;0,-2;1,-2;-1,-3;0,-3;1,-3;-2,-4;-1,-4;0,-4;1,-4;2,-4;-2,-5;-1,-5;0,-5;1,-5;2,-5;-3,-6;-2,-6;-1,-6;0,-6;1,-6;2,-6;3,-6;-3,-7;-2,-7;-1,-7;0,-7;1,-7;2,-7;3,-7;-4,-8;-3,-8;-2,-8;-1,-8;0,-8;1,-8;2,-8;3,-8;4,-8;-4,-9;-3,-9;-2,-9;-1,-9;0,-9;1,-9;2,-9;3,-9;4,-9;-5,-10;-4,-10;-3,-10;-2,-10;-1,-10;0,-10;1,-10;2,-10;3,-10;4,-10;5,-10;-5,-11;-4,-11;-3,-11;-2,-11;-1,-11;0,-11;1,-11;2,-11;3,-11;4,-11;5,-11;-6,-12;-5,-12;-4,-12;-3,-12;-2,-12;-1,-12;0,-12;1,-12;2,-12;3,-12;4,-12;5,-12;6,-12 &nbsp; --~|array;define;D;0,1;-1,2;0,2;1,2;-1,3;0,3;1,3;-2,4;-1,4;0,4;1,4;2,4;-2,5;-1,5;0,5;1,5;2,5;-3,6;-2,6;-1,6;0,6;1,6;2,6;3,6;-3,7;-2,7;-1,7;0,7;1,7;2,7;3,7;-4,8;-3,8;-2,8;-1,8;0,8;1,8;2,8;3,8;4,8;-4,9;-3,9;-2,9;-1,9;0,9;1,9;2,9;3,9;4,9;-5,10;-4,10;-3,10;-2,10;-1,10;0,10;1,10;2,10;3,10;4,10;5,10;-5,11;-4,11;-3,11;-2,11;-1,11;0,11;1,11;2,11;3,11;4,11;5,11;-6,12;-5,12;-4,12;-3,12;-2,12;-1,12;0,12;1,12;2,12;3,12;4,12;5,12;6,12 &nbsp; --~|array;define;R;1,0;2,-1;2,0;2,1;3,-1;3,0;3,1;4,-2;4,-1;4,0;4,1;4,2;5,-2;5,-1;5,0;5,1;5,2;6,-3;6,-2;6,-1;6,0;6,1;6,2;6,3;7,-3;7,-2;7,-1;7,0;7,1;7,2;7,3;8,-4;8,-3;8,-2;8,-1;8,0;8,1;8,2;8,3;8,4;9,-4;9,-3;9,-2;9,-1;9,0;9,1;9,2;9,3;9,4;10,-5;10,-4;10,-3;10,-2;10,-1;10,0;10,1;10,2;10,3;10,4;10,5;11,-5;11,-4;11,-3;11,-2;11,-1;11,0;11,1;11,2;11,3;11,4;11,5;12,-6;12,-5;12,-4;12,-3;12,-2;12,-1;12,0;12,1;12,2;12,3;12,4;12,5;12,6 &nbsp; --~|array;define;L;-1,0;-2,-1;-2,0;-2,1;-3,-1;-3,0;-3,1;-4,-2;-4,-1;-4,0;-4,1;-4,2;-5,-2;-5,-1;-5,0;-5,1;-5,2;-6,-3;-6,-2;-6,-1;-6,0;-6,1;-6,2;-6,3;-7,-3;-7,-2;-7,-1;-7,0;-7,1;-7,2;-7,3;-8,-4;-8,-3;-8,-2;-8,-1;-8,0;-8,1;-8,2;-8,3;-8,4;-9,-4;-9,-3;-9,-2;-9,-1;-9,0;-9,1;-9,2;-9,3;-9,4;-10,-5;-10,-4;-10,-3;-10,-2;-10,-1;-10,0;-10,1;-10,2;-10,3;-10,4;-10,5;-11,-5;-11,-4;-11,-3;-11,-2;-11,-1;-11,0;-11,1;-11,2;-11,3;-11,4;-11,5;-12,-6;-12,-5;-12,-4;-12,-3;-12,-2;-12,-1;-12,0;-12,1;-12,2;-12,3;-12,4;-12,5;-12,6 &nbsp; --~|array;define;UR;1,-1;1,-2;1,-3;2,-1;2,-2;2,-3;2,-4;2,-5;2,-6;3,-1;3,-2;3,-3;3,-4;3,-5;3,-6;3,-7;3,-8;3,-9;4,-2;4,-3;4,-4;4,-5;4,-6;4,-7;4,-8;4,-9;4,-10;4,-11;4,-12;5,-2;5,-3;5,-4;5,-5;5,-6;5,-7;5,-8;5,-9;5,-10;5,-11;5,-12;5,-13;6,-2;6,-3;6,-4;6,-5;6,-6;6,-7;6,-8;6,-9;6,-10;6,-11;6,-12;7,-3;7,-4;7,-5;7,-6;7,-7;7,-8;7,-9;7,-10;7,-11;8,-3;8,-4;8,-5;8,-6;8,-7;8,-8;8,-9;8,-10;9,-3;9,-4;9,-5;9,-6;9,-7;9,-8;9,-9;10,-4;10,-5;10,-6;10,-7;10,-8;11,-4;11,-5;11,-6;11,-7;12,-4;12,-5;12,-6;13,-5 &nbsp; --~|array;define;DR;1,1;2,1;3,1;1,2;2,2;3,2;4,2;5,2;6,2;1,3;2,3;3,3;4,3;5,3;6,3;7,3;8,3;9,3;2,4;3,4;4,4;5,4;6,4;7,4;8,4;9,4;10,4;11,4;12,4;2,5;3,5;4,5;5,5;6,5;7,5;8,5;9,5;10,5;11,5;12,5;13,5;2,6;3,6;4,6;5,6;6,6;7,6;8,6;9,6;10,6;11,6;12,6;3,7;4,7;5,7;6,7;7,7;8,7;9,7;10,7;11,7;3,8;4,8;5,8;6,8;7,8;8,8;9,8;10,8;3,9;4,9;5,9;6,9;7,9;8,9;9,9;4,10;5,10;6,10;7,10;8,10;4,11;5,11;6,11;7,11;4,12;5,12;6,12;5,13 &nbsp; --~|array;define;UL;-1,-1;-1,-2;-1,-3;-2,-1;-2,-2;-2,-3;-2,-4;-2,-5;-2,-6;-3,-1;-3,-2;-3,-3;-3,-4;-3,-5;-3,-6;-3,-7;-3,-8;-3,-9;-4,-2;-4,-3;-4,-4;-4,-5;-4,-6;-4,-7;-4,-8;-4,-9;-4,-10;-4,-11;-4,-12;-5,-2;-5,-3;-5,-4;-5,-5;-5,-6;-5,-7;-5,-8;-5,-9;-5,-10;-5,-11;-5,-12;-5,-13;-6,-2;-6,-3;-6,-4;-6,-5;-6,-6;-6,-7;-6,-8;-6,-9;-6,-10;-6,-11;-6,-12;-7,-3;-7,-4;-7,-5;-7,-6;-7,-7;-7,-8;-7,-9;-7,-10;-7,-11;-8,-3;-8,-4;-8,-5;-8,-6;-8,-7;-8,-8;-8,-9;-8,-10;-9,-3;-9,-4;-9,-5;-9,-6;-9,-7;-9,-8;-9,-9;-10,-4;-10,-5;-10,-6;-10,-7;-10,-8;-11,-4;-11,-5;-11,-6;-11,-7;-12,-4;-12,-5;-12,-6;-13,-5 &nbsp; --~|array;define;DL;-1,1;-1,2;-1,3;-2,1;-2,2;-2,3;-2,4;-2,5;-2,6;-3,1;-3,2;-3,3;-3,4;-3,5;-3,6;-3,7;-3,8;-3,9;-4,2;-4,3;-4,4;-4,5;-4,6;-4,7;-4,8;-4,9;-4,10;-4,11;-4,12;-5,2;-5,3;-5,4;-5,5;-5,6;-5,7;-5,8;-5,9;-5,10;-5,11;-5,12;-5,13;-6,2;-6,3;-6,4;-6,5;-6,6;-6,7;-6,8;-6,9;-6,10;-6,11;-6,12;-7,3;-7,4;-7,5;-7,6;-7,7;-7,8;-7,9;-7,10;-7,11;-8,3;-8,4;-8,5;-8,6;-8,7;-8,8;-8,9;-8,10;-9,3;-9,4;-9,5;-9,6;-9,7;-9,8;-9,9;-10,4;-10,5;-10,6;-10,7;-10,8;-11,4;-11,5;-11,6;-11,7;-12,4;-12,5;-12,6;-13,5 &nbsp; --/|Call the "checkForTokenHits" subroutine. The passed parameter will be the per-space VFX. Leave blank for none. &nbsp; --&gt;checkForTokenHits|[&amp;tokenVFX] &nbsp; --/|The first item in the array will be a blank dummy item, so remove it. &nbsp; --~|array;removeat;tokensHit;0 &nbsp;&nbsp; &nbsp; --/|Loop through the tokensHit tokens and roll saves for each one and apply damage &nbsp; --~tokenid|array;getfirst;tokensHit &nbsp; --?[&amp;tokenid] -eq ArrayError|endOutput &nbsp; --:loopDisplay| &nbsp; --=SaveRoll|1d20 + [*[&amp;tokenid]:[&amp;saveType]_save_bonus] &nbsp;--/|Make the Saving Throw, checking whether creature is immune, resistant, or vulnerable. Output Result and Apply Damage.&nbsp; &nbsp; --/|Compare the save roll to the save DC and either apply full or half damage &nbsp; --?"[*[&amp;tokenid]:npc_immunities]" -inc "[&amp;damageType]"|Immune &nbsp; --?"[*[&amp;tokenid]:npc_resistances]" -inc "[&amp;damageType]"|Resistant &nbsp; --?"[*[&amp;tokenid]:npc_vulnerabilities]" -inc "[&amp;damageType]"|Vulnerable &nbsp; --?[$SaveRoll.Total] -lt @{selected|spell_save_dc}|&gt;FailedSave|&gt;madeSave &nbsp; --/|Here are various damage applications if the creature is immune, resistant, or vulnerable. In some cases, we will reuse output lines, &nbsp; --/|for example, a resistant creature that fails its save will jump to "madeSave", since that is the correct damage amount. (half), while &nbsp; --/|a vulnerable creature that makes its save will jump to "FailedSave" since that will be normal damage. &nbsp; --/|Output a line, apply damage and add status marker for a failed saving throw&nbsp; &nbsp; --:FailedSave| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$Damage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Fail [r][$Damage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp;&nbsp; &nbsp; --:Immune| &nbsp; --+[*[&amp;tokenid]:t-name]:|Immune [r][$ImmuneDamage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp; --:Resistant| &nbsp; --?[$SaveRoll.Total] -lt @{selected|spell_save_dc}|&gt;ResistantFail|&gt;ResistantSave &nbsp; --^afterSave| &nbsp; --/|Output a line and apply damage for a successful saving throw for Resistant &nbsp; --:ResistantSave| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$QuarterDamage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Save (Resistant) [r][$QuarterDamage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp; --/|Output a line, apply damage and add status marker for a failed saving throw for Resistant &nbsp; --:ResistantFail| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$HalfDamage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Fail (Resistant) [r][$HalfDamage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp; --:Vulnerable| &nbsp; --?[$SaveRoll.Total] -lt @{selected|spell_save_dc}|&gt;VulnerableFail|&gt;VulnerableSave &nbsp; --^afterSave| &nbsp; --/|Output a line for a successful saving throw for Vulnerable &nbsp; --:VulnerableSave| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$Damage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Save (Vulnerable) [r][$Damage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp; --/|Output a line, apply damage and status marker for a failed saving throw for Vulnerable &nbsp; --:VulnerableFail| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$DoubleDamage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Fail (Vulnerable) [r][$DoubleDamage] [&amp;damageType][/r] &nbsp; --^afterSave| &nbsp; --/|Output a line and apply damage for a successful saving throw &nbsp; --:madeSave| &nbsp; --&gt;[&amp;damageRoutine]|[&amp;tokenid];[&amp;hitPointsBar];[$HalfDamage.Total] &nbsp; --+[*[&amp;tokenid]:t-name]:|Save [r][$HalfDamage] [&amp;damageType][/r] &nbsp;&nbsp; &nbsp; --:afterSave| &nbsp; --~tokenid|array;getnext;tokensHit &nbsp; --?[&amp;tokenid] -ne ArrayError|loopDisplay &nbsp; --/|Put a visual effect on impacted tokens &nbsp; --vtoken|[&amp;tokenid] [&amp;tokenVFX] &nbsp; --~tokenid|array;getnext;inRange &nbsp; --?[&amp;tokenid] -ne ArrayError|loopDisplay &nbsp; --/|Add some extra visual effects - a nova-fire at the target, and a beam-fire from source to target &nbsp; --vbetweentokens|@{selected|token_id} @{target|token_id} [&amp;lineVFX] &nbsp; --:endOutput|&nbsp; &nbsp; --X| &nbsp;&nbsp; &nbsp; --:ApplyDamageTokenmod|Parameters are tokenid;bar#;amount &nbsp; --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|-[%3%]! &nbsp; --&lt;|&nbsp; &nbsp; --/|AlterBars supports relative values for the amount parameter, so we just pass it the value with a "-" in front of it. &nbsp; --:ApplyDamageAlterbars|Parameters are tokenid;bar#;amount &nbsp; --@alter|_target|[%1%] _bar|[%2%] _amount|-[%3%] _show|none &nbsp; --&lt;| &nbsp; --/|Just a dummy routine that doesn't do anything, but it is easier to do it this way than adding logic to see if we are &nbsp; --/|skipping applying damage in the main routine. &nbsp; --:DontApplyDamage| &nbsp; --&lt;| &nbsp; &nbsp; &nbsp; --:checkForTokenHits|parameter is vfx descriptor &nbsp; --=baseX|[*S:t-left] - 1 \ 70 &nbsp; --=baseY|[*S:t-top] - 1 \ 70 &nbsp; --~offset|array;getfirst;?{Direction} &nbsp; --:checkTokenLoop| &nbsp; --?"[&amp;offset]" -eq "ArrayError"|endCheckForTokenHits &nbsp; --~split|string;split;,;[&amp;offset] &nbsp; --=thisX|[$baseX] + [&amp;split1] &nbsp; --=thisY|[$baseY] + [&amp;split2] &nbsp; --/|IF we passed a visual effect specifier in %1%, create a point VFX in the square &nbsp; --?"X[%1%]X" -ne "XX" |[ &nbsp; &nbsp; --=VX|[$thisX] * 70 + 35&nbsp; &nbsp; &nbsp; &nbsp; --=VY|[$thisY] * 70 + 35&nbsp; &nbsp; &nbsp; &nbsp; --vpoint|[$VX] [$VY] [%1%] &nbsp; --]| &nbsp; --&gt;checkTokens|[$thisX];[$thisY] &nbsp; --~offset|array;getnext;?{Direction} &nbsp; --^checkTokenLoop| &nbsp; --:endCheckForTokenHits| &nbsp; --&lt;| &nbsp; &nbsp;&nbsp; &nbsp; --/|Reads the variables created by createTokenLookup to find any tokens that occupy a given space. &nbsp; --:checkTokens|x;y &nbsp; --?"X[&amp;tok[%1%]-[%2%]]X" -ne "XX"|[ &nbsp; --~split|string;split;!;[&amp;tok[%1%]-[%2%]] &nbsp; --%P|1;[$splitCount.Total];1 &nbsp; --=var|split[&amp;P] &nbsp; --?"X[&amp;[$var.RollText]]X" -eq "XX"|% &nbsp; --~exists|array;indexof;tokensHit;[&amp;[$var.RollText]] &nbsp; --?[&amp;exists] -ne ArrayError|skipAdd &nbsp; --?[&amp;[$var.RollText]] -eq ArrayError|skipAdd &nbsp; --~|array;add;tokensHit;[&amp;[$var.RollText]] &nbsp; --:skipAdd| &nbsp; --%| &nbsp; --&lt;| &nbsp;&nbsp; &nbsp; --/|Creates a series of string variables with names like 'tok12-15' which represent the various squares that are &nbsp; --/|occupied by tokens on the page. Handle 1x1, 2x2, and 3x3 tokens by simply adding extra squares in the appropriate &nbsp; --/|pattern around the center point location. The result is that if there are two tokens at 12,15, the tok12-15 string &nbsp; --/|will contain something like "-asln34njfn2nafd!-sdnfklaserfs" (IDs separated by exclamation points) that we can use to &nbsp; --/|quickly evaluate hits by essentially asking "what is in square 12x15" by just reading the variable. &nbsp; --:createTokenLookup| &nbsp; --~tokenid|array;getfirst;alltokens &nbsp; --:tokenSetupLoop| &nbsp; &nbsp; --?[&amp;tokenid] -eq ArrayError|endSetupLoop &nbsp; &nbsp; --?[&amp;checkLayers] -ninc [*[&amp;tokenid]:t-layer]|skipThisToken &nbsp; &nbsp; --?[*[&amp;tokenid]:t-bar[&amp;hitPointsBar]_value] -le 0|skipThisToken &nbsp; &nbsp; --=tLeft|[*[&amp;tokenid]:t-left] - 1 \ 70 &nbsp; --=tTop|[*[&amp;tokenid]:t-top] - 1 \ 70 &nbsp; --=tWidth|[*[&amp;tokenid]:t-width] &nbsp; --?[$tWidth] -eq 70|[&nbsp; &nbsp; &nbsp; --&amp;tok[$tLeft]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; --/+[*[&amp;tokenid]:character_name]|At [$tLeft],[$tTop] : [&amp;tok[$tLeft.Total]-[$tTop.Total]] &nbsp; --]| &nbsp; --?[$tWidth] -eq 140|[&nbsp; &nbsp; &nbsp; --=NX|[$tLeft] + 1 &nbsp; &nbsp; --=NY|[$tTop] + 1 &nbsp; &nbsp; --&amp;tok[$tLeft]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$tLeft]-[$NY]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$NX]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$NX]-[$NY]|+[&amp;tokenid]! &nbsp; --]| &nbsp; --?[$tWidth] -eq 210|[&nbsp; &nbsp; &nbsp; --=PX|[$tLeft] - 1 &nbsp; &nbsp; --=PY|[$tTop] - 1 &nbsp; &nbsp; --=NX|[$tLeft] + 1 &nbsp; &nbsp; --=NY|[$tTop] + 1 &nbsp; &nbsp; &nbsp; --&amp;tok[$tLeft]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; &nbsp; --&amp;tok[$PX]-[$PY]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$tLeft]-[$PY]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$NX]-[$PY]|+[&amp;tokenid]! &nbsp; &nbsp; &nbsp; --&amp;tok[$PX]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; --&amp;tok[$NX]-[$tTop]|+[&amp;tokenid]! &nbsp; &nbsp; &nbsp; --&amp;tok[$PX]-[$NY]|+[&amp;tokenid]! &nbsp; &nbsp; &nbsp; --&amp;tok[$tLeft]-[$NY]|+[&amp;tokenid]! &nbsp; &nbsp; &nbsp; --&amp;tok[$NX]-[$NY]|+[&amp;tokenid]! &nbsp; --]| &nbsp; --:skipThisToken| &nbsp; --~tokenid|array;getnext;alltokens &nbsp; --^tokenSetupLoop| &nbsp; --:endSetupLoop| &nbsp; --&lt;| &nbsp; --:GetAndCheckSlotInformation| &nbsp; &nbsp; --=SlotLevel|[$SpellLevel] &nbsp; &nbsp; --=SlotsTotal|[*S:lvl[$SlotLevel]_slots_total] &nbsp; &nbsp; --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] &nbsp; &nbsp; --?[$SlotsExpended.Total] -eq 0|NoSlotsLeft &nbsp; &nbsp; --?[$SlotsExpended.Total] -gt [$SlotsTotal.Total]|NoSlotsLeft &nbsp; --&lt;|&nbsp; &nbsp; --:DeductSpellSlot| &nbsp; &nbsp; --=SlotsExpended|[$SlotsExpended] -1&nbsp; &nbsp; &nbsp; --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent &nbsp; &nbsp; --=SlotsRemaining|[$SlotsTotal] - 1&nbsp; &nbsp; --&lt;| &nbsp; --:NoSlotsLeft| &nbsp; &nbsp; --+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] &nbsp; --X|NoSlotsLeftStop }}
1633371244

Edited 1633460488
Fortune Teller Script A fun and creative role playing random fortune generator script with over 940,000 different possible outcomes.&nbsp;&nbsp; I was watching an old episode of "Critical Role" and saw how they incorporated a fortune teller into the story.&nbsp; I absolutely suck at just making stuff up out of thin air like they can - I need prompts to help get the brain working.&nbsp; So I did some research and developed this fun tool to help me improve my creative role play.&nbsp; I give credit to the reddit article and author below that inspired this script if you want to research further.&nbsp;&nbsp; Use:&nbsp;&nbsp; Have player execute the script with their token selected. Script will then select 3 separate cards for the GM to weave a fortune around (See image below). An event A person An outcome It displays the 3 cards selected to the group chat, and whispers the extra detail/color text to the GM.&nbsp; For future reference, it will also append the detailed card info to the selected character's GM Notes field if you have The Aaron's gmnote script (See link below in requirements).&nbsp;&nbsp; The GM then uses the Detailed/Color text as inspiration to generate a custom fortune (scriptcards can't do all the work for you).&nbsp;&nbsp; Note: You can have the player execute this once for a simple fortune, or three times, one for past , one for present and one for future .&nbsp;&nbsp; Credits: &nbsp; This is based on an article and accompanying table I found on reddit by user Bellociraptor ( reddit Link ). Requirements: Scriptcards 1.4.0+ SelectManager The Aaron's GMNote scipt &nbsp; !script {{ --/|Script Name : FortuneTeller --/|Version : 1.0 --/|Requires SC : 1.4.0+ --/|Other APIs : SelectManager, gmnote (by The Aaron) "<a href="https://app.roll20.net/forum/post/5285545/can-token-mod-be-used-to-set-gm-notes/?pageforid=5297154#post-5297154" rel="nofollow">https://app.roll20.net/forum/post/5285545/can-token-mod-be-used-to-set-gm-notes/?pageforid=5297154#post-5297154</a>" --/|Author : Will M. --/|Description : Random Fortune Selector --/| --:TOP| --#reentrant|FortuneTeller --#title|Fortune Teller --#hideTitleCard|1 --#titleCardBackground|#03038a --#oddRowBackground|#111111 --#evenRowBackground|#111111 --#oddRowFontColor|#C9A807 --#evenRowFontColor|#EFC809 --#sourceToken|@{selected|token_id} --#hidecard|0 --#emoteState|visible --#emoteText|@{selected|character_name} is dealt three cards --#bodyFontFace|Shadows Into Light --#bodyFontSize|2.0em --/#whisper|self --#debug|0 --/|Event/Card --=SelCard1|1d98 --=SelCard2|1d98 --=SelCard3|1d98 --/|Event --&gt;R[$SelCard1.Raw]| --&amp;SelCardName1|[&amp;CardName] --&amp;SelEvent|[&amp;Event] --/|Person to be encountered --&gt;R[$SelCard2.Raw]| --&amp;SelCardName2|[&amp;CardName] --&amp;SelPerson|[&amp;Person] --/|Outcome - Near to mid Future --&gt;R[$SelCard3.Raw]| --&amp;SelCardName3|[&amp;CardName] --&amp;SelOutcome|[&amp;Outcome] --/| Output Fortune --+|[img]<a href="https://i.imgur.com/3kQPYrm.gif[/img]" rel="nofollow">https://i.imgur.com/3kQPYrm.gif[/img]</a> --+|[c][&amp;SelCardName1][/c][br] --+|[c][&amp;SelCardName2][/c][br] --+|[c][&amp;SelCardName3][/c] --/| Send details to GM --&amp;tStyle|style="width:100%;padding:1px;border-spacing:0px;border-collapse:collapse;text-shadow: 0px 0px 0px black;border:0px dashed black;" --&amp;trStyle1|style="border-top:1px dashed black;" --&amp;trStyle2|style="border:0px dashed black;" --&amp;tdStyle1|style="width:100%;text-align:center;background-color:#FFFFFF;font-family:Tahoma;font-size:12px;font-weight:bold;" --&amp;tdStyle2|style="width:100%;text-align:center;background-color:#FFFFFF;font-family:Tahoma;font-size:12px;" --*|[t [&amp;tStyle]] [tr [&amp;trStyle1]] [td [&amp;tdStyle1]]Event Card: [&amp;SelCardName1]([$SelCard1.Raw])[/td][/tr] [tr [&amp;trStyle2]] [td [&amp;tdStyle2]][&amp;SelEvent][/td][/tr] [tr [&amp;trStyle1]] [td [&amp;tdStyle1]]Person Card: [&amp;SelCardName2]([$SelCard2.Raw])[/td][/tr] [tr [&amp;trStyle2]] [td [&amp;tdStyle2]][&amp;SelPerson][/td][/tr] [tr [&amp;trStyle1]] [td [&amp;tdStyle1]]Outcome Card: [&amp;SelCardName3]([$SelCard3.Raw])[/td][/tr] [tr [&amp;trStyle2]] [td [&amp;tdStyle2]][&amp;SelOutcome][/td][/tr] [/t] --/| Log the fortune to the GM notes of the player --&amp;Log|Card #1(An Event) [&amp;SelCardName1]: [&amp;SelEvent] - Card #2(A Person) [&amp;SelCardName2]: [&amp;SelPerson] - Card #3 (An Outcome) [&amp;SelCardName3]: [&amp;SelOutcome] --@forselected+|add-cgmnote Fortune: [&amp;Log] --X| --:R1| --&amp;CardName|The Crimson King --&amp;Event|Uncovering dangerous secrets --&amp;Outcome|Knowledge at great cost --&amp;Person|Powerful and dangerous man --&lt;| --:R2| --&amp;CardName|The Scarlett Queen --&amp;Event|Dangerous bargains --&amp;Outcome|Victory only at great cost --&amp;Person|Powerful and dangerous woman --&lt;| --:R3| --&amp;CardName|The Cardinal Knight --&amp;Event|Violence or War --&amp;Outcome|End reached through bloody conflict --&amp;Person|Angry or violent young man --&lt;| --:R4| --&amp;CardName|The Azure King --&amp;Event|Time of learning --&amp;Outcome|Knowledge will prove invaluable --&amp;Person|Sage or scholar --&lt;| --:R5| --&amp;CardName|The Cobalt Queen --&amp;Event|Something forgotten will return --&amp;Outcome|Forgetting a wrong or slight will cause it to happen again --&amp;Person|You never thought youd see him again --&lt;| --:R6| --&amp;CardName|The Cyan Knight --&amp;Event|Facing the consequences of ignorance --&amp;Outcome|What you dont know will hurt you --&amp;Person|Unexpected enemy --&lt;| --:R7| --&amp;CardName|The Viridian King --&amp;Event|Consequences --&amp;Outcome|Someone you wronged will have their revenge --&amp;Person|With a personal grudge --&lt;| --:R8| --&amp;CardName|The Emerald Queen --&amp;Event|Conspiracies --&amp;Outcome|A plot against you will play out --&amp;Person|Jealous woman --&lt;| --:R9| --&amp;CardName|The Jade Knight --&amp;Event|Rivalries --&amp;Outcome|If you dont take them seriously enough, a rival will best you --&amp;Person|Rival --&lt;| --:R10| --&amp;CardName|The Obsidian King --&amp;Event|A warned event will come to pass --&amp;Outcome|Success or failure will depend on how warnings were heeded --&amp;Person|Male practitioner of dark magic --&lt;| --:R11| --&amp;CardName|The Onyx Queen --&amp;Event|A change of forture --&amp;Outcome|A reversal, either good or bad --&amp;Person|Woman whose first impression matters --&lt;| --:R12| --&amp;CardName|The Black Knight --&amp;Event|A grudge --&amp;Outcome|You will make an enduring enemy --&amp;Person|Soldier from a defeated army --&lt;| --:R13| --&amp;CardName|The Bone King --&amp;Event|News of a death --&amp;Outcome|Final endings --&amp;Person|Dying man --&lt;| --:R14| --&amp;CardName|The Frost Queen --&amp;Event|Loss of someone powerfuls favor --&amp;Outcome|Fall from grace --&amp;Person|Widow --&lt;| --:R15| --&amp;CardName|The Pale Knight --&amp;Event|Return of a trouble thought over --&amp;Outcome|Recurring trouble --&amp;Person|Thought to be dead --&lt;| --:R16| --&amp;CardName|The Herald of Sorrows --&amp;Event|Bad news --&amp;Outcome|Things will end poorly for someone close --&amp;Person|Tragic youth --&lt;| --:R17| --&amp;CardName|The Kings Assassin --&amp;Event|A betrayal by someone powerful --&amp;Outcome|Make a powerful enemy --&amp;Person|Traitor in a position of advantage --&lt;| --:R18| --&amp;CardName|The Queens Thief --&amp;Event|Underhanded dealings --&amp;Outcome|Loss of something valuable --&amp;Person|Charming rogue --&lt;| --:R19| --&amp;CardName|The Conqueror --&amp;Event|A shift in personal power --&amp;Outcome|Dramatic gain or loss of power --&amp;Person|Ambitious man --&lt;| --:R20| --&amp;CardName|The High Priest --&amp;Event|A test of faith (Religious or otherwise) --&amp;Outcome|Success or loss depends on the aid of others --&amp;Person|Of devout or religious order --&lt;| --:R21| --&amp;CardName|The Witch --&amp;Event|A string of bad luck --&amp;Outcome|Something will have to be set right before luck can turn --&amp;Person|Female practitioner of dark magic --&lt;| --:R22| --&amp;CardName|The Gypsy --&amp;Event|Scams and false flattery --&amp;Outcome|Trust the wrong people, and they will take you for a ride --&amp;Person|Young and charming --&lt;| --:R23| --&amp;CardName|The Jester --&amp;Event|Loss or respect or jokes at your expense --&amp;Outcome|You will be made a laughingstock --&amp;Person|Whose reputation has suffered --&lt;| --:R24| --&amp;CardName|The Virgin --&amp;Event|Unfamiliar circumstances --&amp;Outcome|You will be forced to navigate a challenge unprepared --&amp;Person|Innocent --&lt;| --:R25| --&amp;CardName|The Whore --&amp;Event|A financial loss --&amp;Outcome|May fall prey to excessive spending --&amp;Person|Ambitious woman --&lt;| --:R26| --&amp;CardName|The Alchemist --&amp;Event|Physical or Spiritual transition --&amp;Outcome|Irreversible personal change --&amp;Person|Practitioner of strange sciences --&lt;| --:R27| --&amp;CardName|The Physician --&amp;Event|Aid from another --&amp;Outcome|Slow healing physical, mental, or spiritual wounds --&amp;Person|You already put faith in (Parent, teacher, etc.) --&lt;| --:R28| --&amp;CardName|The Occultist --&amp;Event|Painful Knowledge --&amp;Outcome|Something wicked comes --&amp;Person|Who should not be here --&lt;| --:R29| --&amp;CardName|The Hunter --&amp;Event|Gains through long pursuit --&amp;Outcome|The chase will yield its prizes --&amp;Person|On a quest or mission --&lt;| --:R30| --&amp;CardName|The Bleeding Man --&amp;Event|Pain --&amp;Outcome|No matter the outcome, the path will be suffering --&amp;Person|Victim or persecution or torture --&lt;| --:R31| --&amp;CardName|The Scarred Man --&amp;Event|Changed by suffering --&amp;Outcome|Painful events will have lasting ramifications --&amp;Person|Carries the physical or mental marks of a great wrong --&lt;| --:R32| --&amp;CardName|The Judge --&amp;Event|Decisions --&amp;Outcome|Positive outcomes only achieved if choices are made with reason, not passion --&amp;Person|Older man in a position of authority --&lt;| --:R33| --&amp;CardName|The Jury --&amp;Event|Judgement --&amp;Outcome|Outcome determined by others --&amp;Person|Group of strangers --&lt;| --:R34| --&amp;CardName|The Headsman --&amp;Event|The Rule of Law --&amp;Outcome|Law upheld --&amp;Person|Lawman --&lt;| --:R35| --&amp;CardName|The Traveler --&amp;Event|A journey --&amp;Outcome|A change of locations --&amp;Person|From far away --&lt;| --:R36| --&amp;CardName|The Twins --&amp;Event|A powerful bond --&amp;Outcome|Live or die for someone --&amp;Person|With a powerful spiritual bond to the drawer or two people bonded to each other (identical twins, soul mates, etc.) --&lt;| --:R37| --&amp;CardName|Sacrifice --&amp;Event|A willing loss --&amp;Outcome|Results for others worth personal cost --&amp;Person|Man willingly suffering --&lt;| --:R38| --&amp;CardName|Birth --&amp;Event|Gain that will change everything --&amp;Outcome|Someone or something will come into your life that will drastically alter it --&amp;Person|Pregnant woman --&lt;| --:R39| --&amp;CardName|Death --&amp;Event|Complete transition --&amp;Outcome|Irreversible change --&amp;Person|In mourning --&lt;| --:R40| --&amp;CardName|The Wedding --&amp;Event|Unification and bonds --&amp;Outcome|Formation of loves, friendships, or strong alliances --&amp;Person|New and close friend or ally --&lt;| --:R41| --&amp;CardName|The Funeral --&amp;Event|An ending or conclusion --&amp;Outcome|Bittersweet parting --&amp;Person|Who has come to you because of a mutual loss --&lt;| --:R42| --&amp;CardName|The Tournament --&amp;Event|An exciting challenge --&amp;Outcome|A shot at glory --&amp;Person|Friendly rival --&lt;| --:R43| --&amp;CardName|Feast --&amp;Event|Joy and festicity --&amp;Outcome|Impressive but temporary gains --&amp;Person|Wealthy and generous man --&lt;| --:R44| --&amp;CardName|Famine --&amp;Event|Times of need --&amp;Outcome|Crushing but temporary losses --&amp;Person|Miser --&lt;| --:R45| --&amp;CardName|Reincarnation --&amp;Event|New beginnings --&amp;Outcome|The start of a new life --&amp;Person|Who has undergone a recent transition --&lt;| --:R46| --&amp;CardName|The Ravens --&amp;Event|Aftermath of tragedy --&amp;Outcome|Profiting from loss --&amp;Person|Opportunist or Profiteer --&lt;| --:R47| --&amp;CardName|The White Wolf --&amp;Event|Spiritual awakening --&amp;Outcome|A personal epiphany --&amp;Person|Spiritualist --&lt;| --:R48| --&amp;CardName|The Black Dog --&amp;Event|Misfortune --&amp;Outcome|No way to get out unscathed --&amp;Person|Cursed --&lt;| --:R49| --&amp;CardName|The Red Stallion --&amp;Event|An adventure --&amp;Outcome|A new and exciting experience --&amp;Person|Bold adventurer --&lt;| --:R50| --&amp;CardName|The Silver Stag --&amp;Event|A chase or pursuit --&amp;Outcome|Chance at an elusive prize --&amp;Person|Enigmatic stranger --&lt;| --:R51| --&amp;CardName|The Bull --&amp;Event|Rapid progress --&amp;Outcome|Ends achieved through brute force and determination --&amp;Person|Laborer or someone of similar origins --&lt;| --:R52| --&amp;CardName|The Goat --&amp;Event|Overcoming obstacles --&amp;Outcome|Resilience and tenacity will win the day --&amp;Person|From harsh circumstances --&lt;| --:R53| --&amp;CardName|The Cat --&amp;Event|You will overhear something --&amp;Outcome|Solutions will come through subtlety and discretion --&amp;Person|Frequently disregarded or underestimated --&lt;| --:R54| --&amp;CardName|The Rat --&amp;Event|Subterfuge and underhanded dealings --&amp;Outcome|The most clever will win --&amp;Person|Spy or thief --&lt;| --:R55| --&amp;CardName|The Two-Headed Serpent --&amp;Event|Flattery and false promises --&amp;Outcome|Grave consequences if you trust the wrong person --&amp;Person|Charming liar --&lt;| --:R56| --&amp;CardName|The Spider --&amp;Event|Beware of traps and snares --&amp;Outcome|Failure unless you spot all the complications --&amp;Person|Of few words and complex machinations --&lt;| --:R57| --&amp;CardName|The Mermaid --&amp;Event|Seduction and risky affairs --&amp;Outcome|heartbreak and tragic endings --&amp;Person|Heartsick woman --&lt;| --:R58| --&amp;CardName|The Manticore --&amp;Event|Close alliances and co-conspirators --&amp;Outcome|your misdeeds will bind you to your partners in crime --&amp;Person|Gang or party --&lt;| --:R59| --&amp;CardName|The Viper --&amp;Event|Meddling in places you dont belong --&amp;Outcome|there week be a cost for getting involved in matters that are not your place --&amp;Person|Dangerous loner --&lt;| --:R60| --&amp;CardName|The Leviathan --&amp;Event|A natural or unavoidable disaster --&amp;Outcome|outcome determined by circumstances beyond your control --&amp;Person|Linked to the Void --&lt;| --:R61| --&amp;CardName|The Scorpion --&amp;Event|Someone will try and ruin you --&amp;Outcome|You will be struck at at every turn --&amp;Person|Has a petty grudge --&lt;| --:R62| --&amp;CardName|The Wasps --&amp;Event|Mass hysteria and mob rule --&amp;Outcome|outcome will be decided by the crowd --&amp;Person|Group or mob --&lt;| --:R63| --&amp;CardName|The Bear --&amp;Event|Guarding that which you love --&amp;Outcome|Someone or something you care about will rely on you to aid them --&amp;Person|Protective older person --&lt;| --:R64| --&amp;CardName|The Sword --&amp;Event|Strength --&amp;Outcome|Your strength will determine the outcome --&amp;Person|Knight or military officer --&lt;| --:R65| --&amp;CardName|The Spear --&amp;Event|Protection --&amp;Outcome|Your ability to protect someone or something will determine the outcome --&amp;Person|Guard or soldier --&lt;| --:R66| --&amp;CardName|The Axe --&amp;Event|You will be the agent of justice --&amp;Outcome|Your judgement or actions will determine if justice is served --&amp;Person|Vigilante --&lt;| --:R67| --&amp;CardName|The Hammer --&amp;Event|Force --&amp;Outcome|Outcome will be determined by martial prowess --&amp;Person|Ruffian or barbarian --&lt;| --:R68| --&amp;CardName|The Knife --&amp;Event|Guile --&amp;Outcome|Outcome will be determined by cunning --&amp;Person|Courtier or diplomat --&lt;| --:R69| --&amp;CardName|The Rose --&amp;Event|Winning fame or favor --&amp;Outcome|You success will earn you reputation and acclaim --&amp;Person|Young and beautiful woman --&lt;| --:R70| --&amp;CardName|The Broken Tower --&amp;Event|Calamity --&amp;Outcome|Failure of Endeavors --&amp;Person|Who has suffered a recent failure. --&lt;| --:R71| --&amp;CardName|The Bridge --&amp;Event|Joining together of two unlikely things --&amp;Outcome|Unexpected alliances --&amp;Person|Foe turned friend --&lt;| --:R72| --&amp;CardName|The Gallows Tree --&amp;Event|Punishment --&amp;Outcome|Making amends for your actions or words --&amp;Person|Criminal --&lt;| --:R73| --&amp;CardName|The Poisoned Cup --&amp;Event|A gift, reward, or treasure will bring misfortune --&amp;Outcome|Even an apparent success will reap sorrow --&amp;Person|Will try to ply you with false generosity --&lt;| --:R74| --&amp;CardName|The Chalice --&amp;Event|Joy and reward --&amp;Outcome|Your endeavors will yield success and great gains --&amp;Person|Famous --&lt;| --:R75| --&amp;CardName|The Sea --&amp;Event|Journey over water --&amp;Outcome|Cross a great physical distance --&amp;Person|Fickle woman --&lt;| --:R76| --&amp;CardName|The Lightning Struck Ship --&amp;Event|A difficult journey --&amp;Outcome|A life-or-death struggle --&amp;Person|Sudden adversary --&lt;| --:R77| --&amp;CardName|The Desert --&amp;Event|Loneliness and isolation --&amp;Outcome|A struggle that must be faced alone --&amp;Person|Wanderer or hermit --&lt;| --:R78| --&amp;CardName|The Mountain --&amp;Event|Test of physical or mental endurance --&amp;Outcome|Toughness will win the day --&amp;Person|Unusually large person --&lt;| --:R79| --&amp;CardName|The Forest --&amp;Event|Confounding factors and unclear paths --&amp;Outcome|A confusing journey, easy to lose sight of the purpose --&amp;Person|Woodsman or ranger --&lt;| --:R80| --&amp;CardName|The Path --&amp;Event|Clarity of purpose --&amp;Outcome|Intent and purpose will be clear or obnvious --&amp;Person|Tracker or guide --&lt;| --:R81| --&amp;CardName|The Stairway --&amp;Event|Opportunities --&amp;Outcome|Great things if you proceed carefully, a terrible slip and fall if you do not --&amp;Person|Architect or builder --&lt;| --:R82| --&amp;CardName|The Rising Sun --&amp;Event|New beginnings and limitless potential --&amp;Outcome|Your actions in the immediate future will have long-lasting benefits or consequences --&amp;Person|Young child --&lt;| --:R83| --&amp;CardName|The Sun at Zenith --&amp;Event|Hard work will yield great benefits --&amp;Outcome|You will sow and reap in equal measure --&amp;Person|Respected and established in their trade --&lt;| --:R84| --&amp;CardName|The Setting Sun --&amp;Event|Rest and peaceful conclusions --&amp;Outcome|The ending of a job or similar --&amp;Person|Retired person --&lt;| --:R85| --&amp;CardName|The New Moon --&amp;Event|The unknown --&amp;Outcome|Unexpected event will change everything --&amp;Person|Blind man --&lt;| --:R86| --&amp;CardName|The Crescent Moon --&amp;Event|Half-truths and incomplete predictions --&amp;Outcome|Unsatisfactory conclusions and unfinished business --&amp;Person|Restless youth --&lt;| --:R87| --&amp;CardName|The Full Moon --&amp;Event|True predictions --&amp;Outcome|An unfolding of prophecy or fortunes --&amp;Person|Seer --&lt;| --:R88| --&amp;CardName|Wind --&amp;Event|Constant changes and reversals --&amp;Outcome|No results, good or bad, will endure for long --&amp;Person|Moody or unstable person --&lt;| --:R89| --&amp;CardName|Snow --&amp;Event|Confusion and obfuscation --&amp;Outcome|You will remain in ignorance or confusion --&amp;Person|Mute --&lt;| --:R90| --&amp;CardName|The Star --&amp;Event|A quest or journey --&amp;Outcome|the start of a new mission --&amp;Person|Mentor or guide --&lt;| --:R91| --&amp;CardName|The Demon --&amp;Event|Punishment --&amp;Outcome|All sins punished --&amp;Person|Torturer --&lt;| --:R92| --&amp;CardName|The Devil --&amp;Event|Bargains and deals --&amp;Outcome|An arrangement twisted against you --&amp;Person|Drafter of contracts --&lt;| --:R93| --&amp;CardName|The Fey --&amp;Event|Mysteries --&amp;Outcome|Inconclusive or strange endings --&amp;Person|Mysterious or unknown person --&lt;| --:R94| --&amp;CardName|The Dragon --&amp;Event|A life-changing challenge --&amp;Outcome|Death or glory --&amp;Person|Powerful adversary --&lt;| --:R95| --&amp;CardName|Dreams --&amp;Event|Unlikely adventures or encounters with the uncanny --&amp;Outcome|The ending will be a far cry from where you began --&amp;Person|Fae-touched --&lt;| --:R96| --&amp;CardName|Nightmares --&amp;Event|Things long-feared will come to pass --&amp;Outcome|Things will appear far worse before they get better --&amp;Person|Madman --&lt;| --:R97| --&amp;CardName|Time --&amp;Event|Facing the inevitable --&amp;Outcome|Change that you are powerless to fight --&amp;Person|Important from your past --&lt;| --:R98| --&amp;CardName|The Treasure Hoard --&amp;Event|The prize at the end of the challenge --&amp;Outcome|Great reward after great challenge or suffering --&amp;Person|You will have to fight for --&lt;| --:R99| --&amp;CardName|The DMs Choice --&amp;Event|Choose something DM --&amp;Outcome|Choose something DM --&amp;Person|Choose something DM --&lt;| --:R100| --&amp;CardName|Something that should not be --&amp;Event|Make up a card that isnt in the deck. --&amp;Outcome|Make up a card that isnt in the deck. --&amp;Person|Make up a card that isnt in the deck. --&lt;| --X| }} Fortune Teller Script - Link
1633379007

Edited 1633440949
Set Monster HP (With a Twist) This is a GM utility to quickly establish HP for all selected NPCs on the page, with a Twist .&nbsp; That T wist being that it gives you the option to select from several methods (described below) to calculate HP.&nbsp; It ignores PC tokens and tokens not tied to a character sheet. This is handy when you want to either randomize monster HP, or even randomize with a greater chance of getting higher or lower HP values.&nbsp;&nbsp; Methods: Default - Standard static HP based on NPC_HPFormula (no randomness) Random - Uses the NPC_HPFormula to derive HP Random High (x Rolls) - Will take the highest value of x(2,5, or 10) random rolls. Random Low (x Rolls) - Will take the lowest value of x(2,5, or 10) random rolls.&nbsp; Adder - A value (+/-) to add to the final result.&nbsp; Can also be in roll syntax (e.g.; 2d6) Use: Select all tokens you wish to establish a new HP Execute Script Select a method (Default, Random, Random High 2, Random High 5, Random High 10, Random Low 2, Random Low 5, Random Low 10) Input an adder (example possible values: 0, 8, -3, 2d6) The script will then calculate HP for all selected tokens based on the desired method, setting the token's HP accordingly. The "Random High 5" will randomly execute the npc_hpformula 5 times and keep the highest result.&nbsp; This should normally producer higher HPs than the default and simple Random method.&nbsp;&nbsp; Requirements: Scriptcards 1.4.0+ TokenMod Configuration Item: Token&nbsp;HPField: &nbsp; Around Line 30 of the code there is a variable&nbsp; HPField , that needs to be set to the field you use for HP in your campaign.&nbsp; It's current value is bar1_value.&nbsp; Set to bar3_value if you use bar3 for tracking HP.&nbsp;&nbsp; !script {{ --/|Script Name : Set Monster HP --/|Version : 1.0 --/|Requires SC : 1.4.0+ --/|Author : Will M. --/|Description : Utility function that resets all selected NPC hps based on the HPFormula (with a twist) --/| Twist - It allows for the following HP calcs: --/| Default - Standard static HP based on HPFormula (no randomness) --/| Random - Uses the HPFormula to derive HP --/| Random High (x Rolls) - Will take the highest value of x(2,5, or 10) rolls. --/| Random Low (x Rolls) - Will take the lowest value of x(2,5, or 10) rolls. --/| --/| Adder - A value (+/-) to add to the final result --#title|Set Monster HP --#reentrant|SetMonsterHP --#titleCardBackground|#932729 --#whisper|self --#oddRowBackground|#FFFFFF --#evenRowBackground|#FFFFFF --#buttonbackground|#FFFFFF --#buttontextcolor|#0905f2 --#buttonbordercolor|#FFFFFF --#bodyFontSize|11px --#debug|1 --/| set to bar2_value or bar3_value if you use one of those two for tracking HP --&amp;HPField|bar1_value --/| Modes 0-Default,1-Random,2-Random (High), 3 Random (Low) --&amp;Mode|0 --&amp;Adder|0 --&amp;HP_ROLL_COUNT|0 --&amp;Mode|?{HP Set Mode?|Default,0|Random,1|Random High(2 Rolls),2.2|Random High(5 Rolls),2.5|Random High(10 Rolls),2.10|Random Low(2 Rolls),3.2|Random Low(5 Rolls),3.5|Random Low(10 Rolls),3.10} --&amp;Adder|?{Additional Adder|0} --+Adder|[&amp;Adder] --?[&amp;Mode] -eq 2.2|[ --&amp;Mode|2 --&amp;HP_ROLL_COUNT|2 --]| --?[&amp;Mode] -eq 2.5|[ --&amp;Mode|2 --&amp;HP_ROLL_COUNT|5 --]| --?[&amp;Mode] -eq 2.10| [ --&amp;Mode|2 --&amp;HP_ROLL_COUNT|10 --]| --?[&amp;Mode] -eq 3.2|[ --&amp;Mode|3 --&amp;HP_ROLL_COUNT|2 --]| --?[&amp;Mode] -eq 3.5|[ --&amp;Mode|3 --&amp;HP_ROLL_COUNT|5 --]| --?[&amp;Mode] -eq 3.10|[ --&amp;Mode|3 --&amp;HP_ROLL_COUNT|10 --]| --=i|0 --/| !token-mod --set bar1|[[@{selected|npc_hpformula}]] --/| For each selected Token --~Token|getselected --+TokenCount|[&amp;TokenCount] --+Mode|[&amp;Mode] --:MAIN_LOOP_TOP| --?[$i.Raw] -eq [&amp;TokenCount]|MAIN_LOOP_EXIT --=i|[$i] + 1 --/| If it is an NPC token associated with a monster sheet then proceed --?[*[&amp;Token[$i.Raw]]:npc] -ne 1|MAIN_LOOP_TOP --?"[*[&amp;Token[$i.Raw]]:t-represents]" -ninc "-"|MAIN_LOOP_TOP --/| Get the npc_hpformula --&amp;CharId|[*[&amp;Token[$i.Raw]]:t-represents] --&amp;HPFormula|[*[&amp;CharId]:npc_hpformula] --/| Based on Mode - determine HP --C[&amp;Mode]|0:MODE_DEFAULT|1:MODE_RANDOM|2:MODE_RAND_HIGH|3:MODE_RAND_LOW --/|Case 0 - Default --:MODE_DEFAULT| --=HP|[*[&amp;CharId]:hp^] + [&amp;Adder] --^END_CASE| --/|Case 1 - Random --:MODE_RANDOM| --=HP|[&amp;HPFormula] + [&amp;Adder] --^END_CASE| --/|Case 2 - Random - High --:MODE_RAND_HIGH| --&gt;HP_RAND_HIGH| --^END_CASE| --/|Case 3 - Random - Low --:MODE_RAND_LOW| --&gt;HP_RAND_LOW| --^END_CASE| --:END_CASE| --+[$i.Raw].|[*[&amp;Token[$i.Raw]]:t-name]: ([&amp;HPFormula]) + [&amp;Adder] [$HP] --@token-mod|_set [&amp;HPField]|[$HP.Raw] _ids [&amp;Token[$i.Raw]] _ignore-selected --/|Apply Calculated HP --/| Next token --^MAIN_LOOP_TOP| --:MAIN_LOOP_EXIT| --+Done!| --X| --:HP_RAND_HIGH| --=HP|-500 --=j|0 --:HPRH_LOOP_TOP| --?[$j.Raw] -eq [&amp;HP_ROLL_COUNT]|HPRH_LOOP_END --=x|[&amp;HPFormula] + [&amp;Adder] --+&amp;nbsp;&amp;nbsp;RHigh(x / HP)|[$x] / [$HP] --~HP|math;max;[$HP];[$x] --=j|[$j] + 1 --^HPRH_LOOP_TOP| --:HPRH_LOOP_END| --&lt;| --:HP_RAND_LOW| --=HP|500 --=j|0 --:HPRL_LOOP_TOP| --?[$j.Raw] -eq [&amp;HP_ROLL_COUNT]|HPRL_LOOP_END --=x|[&amp;HPFormula] + [&amp;Adder] --+&amp;nbsp;&amp;nbsp;RLow(x / HP)|[$x] / [$HP] --~HP|math;min;[$HP];[$x] --=j|[$j] + 1 --^HPRL_LOOP_TOP| --:HPRL_LOOP_END| --&lt;| }} Set Monster HP (With a Twist) - Link
1633548244

Edited 1633548297
Manage Token Tooltip (All selected) Simple GM utility to set, remove, show/hide token tooltips.&nbsp;&nbsp; Just recently Roll20 snuck in a new token feature called Tooltips.&nbsp; The Aaron added ability to update associated fields in version 0.8.72 of his amazing TokenMod utility.&nbsp; This script uses TokenMod's new functionality to manage tooltips across a group of selected tokens.&nbsp;&nbsp; Use: Select all the tokens you want to manage tooltips on. Execute the macro Requirements: Scriptcards 1.4.0+ TokenMod 0.8.72 (Currently in Dev and not available on 1-Click) !script {{ --/|Script Name : Set Token Tooltip --/|Version : 1.0 --/|Requires SC : 1.3.7+, TokenMod 0.8.72+ --/|Author : Will M. --/|Description : GM Utility for updating ToolTips on one or more tokens. Provides the ability to: --/| * Add Tooltip - Add text to multiple token tooltips in one action --/| * Clear Tooltip - Remove text from multiple tokens in one action --/| * Show/Hide Tooltip - Toggle the show tooltip flag on all selected tokens --#title|Set Token Tooltips --#reentrant|SetTokenTT --#leftsub| --#rightsub| --#titlecardbackground|LightGreen --#titlefontsize|1.5em --#titlefontlineheight|2.0em --#titlefontface|Contrail One --#bodyfontsize|11px --#bodyfontface|Tahoma --#oddrowbackground|#00000000 --#oddrowfontcolor|#000000 --#evenrowbackground|#00000000 --#evenrowfontcolor|#000000 --#buttonbackground|DarkGreen --#buttontextcolor|White --#buttonbordercolor|#999999 --#buttonfontsize|10px --#buttonfontface|Tahoma --#dicefontcolor|#1C6EA4 --#dicefontsize|3.0em --#usehollowdice|0 --#emotebackground|#f5f5ba --#emotestate|visible --#tableborderradius| 6px; --#tableshadow| 5px 3px 3px 0px #aaa; --#bodybackgroundimage| linear-gradient( to bottom, LightGreen, Green, DarkGreen) --#timezone|America/Chicago --#debug|1 --#whisper|self --#emotetext| --#hidecard|0 --+|[c][rbutton]Add::ADD_TT[/rbutton]&amp;nbsp;&amp;nbsp;[rbutton]Clear::DEL_TT[/rbutton][/c] --+|[br] --+|[c][rbutton]Show::SHOW_TT[/rbutton]&amp;nbsp;&amp;nbsp;[rbutton]Hide::HIDE_TT;[&amp;TokenId][/rbutton][/c] --X| --:ADD_TT| --#hidecard|1 --I;Enter Tool-Tip you want to add to selected tokens|q;TT;Add a Tool-tip? --&amp;CMD|_set tooltip|"[&amp;TT]" _on show_tooltip --^APPLY| --:DEL_TT| --#hidecard|1 --&amp;CMD|_set tooltip| --^APPLY| --:SHOW_TT| --#hidecard|1 --&amp;CMD|_on show_tooltip --^APPLY| --:HIDE_TT| --#hidecard|1 --&amp;CMD|_off show_tooltip --^APPLY| --:APPLY| --=i|0 --/| For each selected Token --~Token|getselected --:MAIN_LOOP_TOP| --?[$i.Raw] -eq [&amp;TokenCount]|MAIN_LOOP_EXIT --=i|[$i] + 1 --@token-mod|[&amp;CMD] _ids [&amp;Token[$i.Raw]] _ignore-selected --/*|token-mod [&amp;CMD] _ids [&amp;Token[$i.Raw]] _ignore-selected --^MAIN_LOOP_TOP| --:MAIN_LOOP_EXIT| --X| }} Manage Token Tooltips - Link
Replying to subscribe.
1634093356
GiGs
Pro
Sheet Author
API Scripter
Replying doesnt auto-subscribe you on these forums - you need to click the Follow link at the top right, and dont need to post to do that.
1634109592

Edited 1634109648
Hi all,&nbsp; Could we combine the management of the tool tip above with this&nbsp; <a href="https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754" rel="nofollow">https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754</a> Maybe making it an option in the buttons.&nbsp; And ideally, instead selecting the tokens, use the tokens present on turn tracker as the selection array?&nbsp; Thank you&nbsp;
1634165720

Edited 1634187143
I think I understand what you are getting at, but I believe the GM/DM would have to be the one to run the script every round or whenever someone is hit.&nbsp; I believe there is an event that could be leveraged in Javascript, but that would take a little more work for me as I'm still a hack at JS.&nbsp; I could easily write a ScriptCard macro that would: 1. Traverse the list of tokens in the current Turn Order List 2. Apply the math/logic to establish injury level 3. Place that injury level in the Tool Tip and make sure it's being shown I think a JS solution is more elegant, and I'll take a look at what it would take.&nbsp; I believe there is a health/aura script I can learn from.&nbsp;&nbsp; Lionel V. said: Hi all,&nbsp; Could we combine the management of the tool tip above with this&nbsp; <a href="https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754" rel="nofollow">https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754</a> Maybe making it an option in the buttons.&nbsp; And ideally, instead selecting the tokens, use the tokens present on turn tracker as the selection array?&nbsp; Thank you&nbsp;
Will M. said: I think I understand what you are getting at, but I believe the GM/DM would have to be the one to run the script every round or whenever someone is hit.&nbsp; I believe there is an event that could be leveraged in Javascript, but that would take a little more work for me as I'm still a hack at JS.&nbsp; I could easily write a ScriptCard macro that would: 1. Traverse the list of tokens in the current Turn Order List 2. Apply the math/logic to establish injury level 3. Place that injury level in the Tool Tip and make sure it's being shown I think a JS solution is more elegant, and I'll take a look at what it would take.&nbsp; I believe there is a health/aura script I can learn from.&nbsp;&nbsp; Lionel V. said: Hi all,&nbsp; Could we combine the management of the tool tip above with this&nbsp; <a href="https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754" rel="nofollow">https://app.roll20.net/forum/post/10421785/tooltips-can-now-be-added-to-tokens-slash-cards/?pageforid=10423754#post-10423754</a> Maybe making it an option in the buttons.&nbsp; And ideally, instead selecting the tokens, use the tokens present on turn tracker as the selection array?&nbsp; Thank you&nbsp; I would love to use that script Will
I should have something tomorrow.... I've written the logic to traverse the Turnorder List.&nbsp; Just need to add the logic to grab the HP, HPMax, Calc the PCT and populate the Tooltip.&nbsp;&nbsp;
1634267690

Edited 1634314720
Tooltip Health Indicator Update: Previous version traversed the Turn Order list which was a bit sluggish.&nbsp; This new version has an option to traverse NPCs, PCs or all Characters and runs much quicker.&nbsp;&nbsp; How it works: This script when run will do the following:&nbsp; Advance the Turn Order (via the !eot command if you have installed Aaron's TurnMarker Script .) Traverse the list of tokens on the current page filtered by (pcs, npcs or all characters) Apply the math/logic to establish a textual injury level Place that injury level in the Tool Tip and make sure it's being shown (Using TokenMod script) Health Text Logic:&nbsp; Uninjured = 0% dmg taken Barely Injured = 0-25% dmg taken Injured = 25-50% dmg taken Badly Injured = 50-75% dmg taken Near Death = 75-100% dmg taken Death = 100% dmg taken There are a couple configuration items to be aware of (Around row 23): --#hidecard|1 --&amp;HealthBar|bar1 --&amp;TokenType|char Set #hidecard|0 value to 1 if you don't want the whispered debug text Set the &amp;HealthBar|bar1 to bar2 or bar3 if you use those for tracking HP. Set TokenType to char, npc or pc based on&nbsp; Tip: Add a " Next"&nbsp; macro button to your macro bar to run this script to execute this script.&nbsp;&nbsp; !eot !script {{ --/|Script Name : Set-TT-Health --/|Version : 0.3 --/|Requires SC : 1.4.4, Token-Mod and TurnMarker (By the Aarron) --/|Author : Will M. --/|Description : Advances the turn order and sets Token ToolTips to a health indicator --/| --#title|Set Token Tooltip Health --#bodyFontSize|10px --#whisper|self --#debug|0 --/| Parameters to configure how script operates --/| Set hidecard to 1 to hide debug messages --/| Set HealthBar to bar2 or bar3 if you use one of those for tracking HP --/| Set TokenType to pc, npc, or char. --/| pc: Will include all tokens controlled by a player --/| npc: Will include tokens represented by a sheet but not controlled by a player --/| char: Will include tokens being represented by a sheet --#hidecard|1 --&amp;HealthBar|bar1 --&amp;TokenType|char --&amp;TokenIdList| --/| Create array of tokens based on TokenType (pc, npc, char), and retrieve the first TokenId --~tokencnt|array;pagetokens;PgTokens;@{selected|token_id};[&amp;TokenType] --~TokenId|array;getfirst;PgTokens --/| For each token in the PgTokens array --:STARTLOOP| --?[&amp;TokenId] -eq ArrayError|ENDLOOP --/| Calculate Damage Pct --=HP|[*[&amp;TokenId]:t-[&amp;HealthBar]_value] --=HPMax|[*[&amp;TokenId]:t-[&amp;HealthBar]_max] --=HPPct|[$HP]/[$HPMax]*100 --/|Determine Damage Text --?[$HPPct.Raw] -ge 100|&amp;DmgText;Uninjured --?[$HPPct.Raw] -lt 100|&amp;DmgText;Barely Injured --?[$HPPct.Raw] -lt 75|&amp;DmgText;Injured --?[$HPPct.Raw] -lt 50|&amp;DmgText;Badly Injured --?[$HPPct.Raw] -lt 25|&amp;DmgText;Near Death --?[$HPPct.Raw] -le 0|&amp;DmgText;Death --+[*[&amp;TokenId]:t-name]:|[&amp;DmgText] [$HP]/[$HPMax] --/|Debug Text --+TT| [&amp;CurrTT] [&amp;DmgText] --/| Push Damage text into Token Tooltip --@token-mod|_on show_tooltip _set tooltip|"[&amp;DmgText]" _ids [&amp;TokenId] _ignore-selected --:SKIP| --/| Retrieve the next TokenID from the array PgTokens and repeat the loop --~TokenId|array;getnext;PgTokens --^STARTLOOP| --:ENDLOOP| --+DONE!!!| --x| }}
This is fantastic Will. Many thx
Mads said: This is fantastic Will. Many thx You might grab the new version I posted.&nbsp; It runs much quicker.&nbsp; However,&nbsp;it is no longer using the TurnOrder list, and instead processing all tokens based on the filter I describe in my post above (pc, npc, char).&nbsp;&nbsp;