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

!Scriptcard HELP REQUEST - Bite Attack Macro w/ Poison

Hello All, Joshua N helped me with this macro and I need a little more help to get it finished. I am wanting  [$CritDmg] to equal  [&WeaponDamageDieSize] on an attack roll of 20 (Critical Hit) such that on a natural 20, the damage output would be 1d8 + Dexterity + 8. If a roll other than a natural 20 is rolled,   [$CritDmg] would be equal to 0.  Would anyone be able to help me finish this macro?? Thank you! !scriptcard {{     --/|VARIABLES TO SET     --&TargetACAttribute|AC     --&DamageAbilityMod|AbilityModifier     --&WhateverTheHellDSISAttribute|DS     --&WeaponDamageDieSize|8     --&PoisonDamageDieSize|6     --/|ScriptCard settings use # and nominmaxhighlight is like the cf<0cs>20 flags used in the original and is coded as --#nominmaxhighlight|1     --#title|Monster Bite!     --#rightsub|5 ft Range          --/|Set the source and target tokens     --/|These are used by the [*S] and [*T] to reference attributes     --#sourceToken|@{selected|token_id}     --#targetToken|@{target|token_id}     --=Atk|1d20+@{selected|Dexterity_Mod}     --/|Output the static Atk roll variable with the target's AC value     --+Attack|[$Atk] vs AC [*T:[&TargetACAttribute]]     --/|If the Atk variable is less than the target's AC jump to the end of the script and exit     --?[$Atk] -lt [*T:[&TargetACAttribute]]|Done     --/|If the Atk variable is higher present a button to query for the crit rolls and damage type like the original asks for         --/If you wish to create a pulldown bar for damage type use |q;weapondmgtype;Damage type|bludgeoning|piercing|slashing     --=CritDmg|[&WeaponDamageDieSize] * [&critrolls]     --=WeaponDmg|1d[&WeaponDamageDieSize] [Weapon Damage] + [*S:[&DamageAbilityMod]] [MOD] + [$CritDmg] [CRIT]              --=PoisonDice|1     --=PoisonDmg|[$PoisonDice]d[&PoisonDamageDieSize]     --=TotalDmg|[$WeaponDmg] + [$PoisonDmg]     --:Display|     --+|[$WeaponDmg] [&weapondmgtype] [b]piercing[/b] damage plus [$PoisonDmg] [b]poison[/b] Damage for a [b]total of [$TotalDmg] total damage![/b]     --:Done| }}
So  ScriptCards Roll Variable Modifiers  has .Base to check for the base roll so you could do something like this --=WeaponDmg|1d[&WeaponDamageDieSize] [Weapon Damage] + [*S:[&DamageAbilityMod]] [MOD] --?[$Atk.Base] -eq 20|[ --=CritDmg|[&WeaponDamageDieSize] * [&critrolls] --=WeaponDmg|[$WeaponDmg] + [$CritDmg] [CRIT] --]| That would do what you currently have but only add the crit damage on a 20.
Works PERFECTLY!  Thank you Joshua N! If I wanted to then auto deduct the damage on a hit off of a target token's bar1, how would I do that?  I tried this:  --?[$Atk.Base] -eq  >= @{target|AC}|alterbar1|_target|@{target|token_id} _bar|1 _amount|-TotalDmg _show|all but the API said that it contained an "invalid clause joiner" as well as "lable_target" not being defined. The above is a modification of a !powercard line where the original line was:  --?? $Atk >= @{target|AC} ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all Thank you again Barry
So one option would be to have ScriptCards itself doing the hp adjustment. So the Atk roll is already compared to the target AC even before the damage rolls are made by: --?[$Atk] -lt [*T:[&TargetACAttribute]]|Done So I might add a couple Variables in the top VARIABLES TO SET section --&AutoApplyDamage|true --&HPBar|1 And then at the bottom of the ScriptCard add: --:Display| --+|[$WeaponDmg] [&weapondmgtype] [b]piercing[/b] damage plus [$PoisonDmg] [b]poison[/b] Damage for [b]total of [$TotalDmg] total damage![/b] --?"[&AutoApplyDamage]" -ne "true"|Done --!t:[*T:t-id]|bar[&HPBar]_value:-=[$TotalDmg] --:Done| So there would be a conditional to auto-apply the damage and then use  ScriptCards object modification to reduce the damage from the token's bar . There are other options. You could also call another mod  like AlterBars or TokenMod as well if you prefer that method instead of ScriptCards modifications.
Thank you Joshua N., This macro works perfectly! With minimal adjustments this can be made to be any attack made in the game now, displaying separate damage types and  totaling them in the chat window, and then subtracting them from the target token on a hit.   Thank you very much  For anyone who might be intersected, I am using !Scriptcards and Simple Sound.  Here is the complete macro:   !scriptcard {{     --/|VARIABLES TO SET     --&TargetACAttribute|AC     --&DamageAbilityMod|Dexterity_Mod     --&AutoApplyDamage|true     --&HPBar|1     --&WeaponDamageDieSize|8     --&PoisonDamageDieSize|6     --/|ScriptCard settings use # and nominmaxhighlight is like the cf<0cs>20 flags used in the original and is coded as --#nominmaxhighlight|1     --#title|Monster Bite!     --#rightsub|          --/|Set the source and target tokens     --/|These are used by the [*S] and [*T] to reference attributes     --#sourceToken|@{selected|token_id}     --#targetToken|@{target|token_id}     --=Atk|1d20 + @{selected|Dexterity_Mod} [Dexterity] + @{selected|pb} [PB]     --/|Output the static Atk roll variable with the target's AC value     --+Attack|[$Atk] vs AC [*T:[&TargetACAttribute]]     --/|If the Atk variable is less than the target's AC jump to the end of the script and exit     --?[$Atk] -lt [*T:[&TargetACAttribute]]|Done     --/|If the Atk variable is higher present a button to query for the crit rolls and damage type like the original asks for         --/If you wish to create a pulldown bar for damage type use |q;weapondmgtype;Damage type|bludgeoning|piercing|slashing --=WeaponDmg|1d[&WeaponDamageDieSize] [Weapon Damage] + [*S:[&DamageAbilityMod]] [MOD] --?[$Atk.Base] -eq 20|[   --=CritDmg|[&WeaponDamageDieSize] * [&critrolls]   --=WeaponDmg|[$WeaponDmg] + [$CritDmg] [CRIT] --]|              --=PoisonDice|1     --=PoisonDmg|[$PoisonDice]d[&PoisonDamageDieSize]     --=TotalDmg|[$WeaponDmg] + [$PoisonDmg] --:Display| --+|[$WeaponDmg] [&weapondmgtype] [b]piercing[/b] damage plus [$PoisonDmg] [b]poison[/b] Damage for [b]total of [$TotalDmg] total damage![/b] --?"[&AutoApplyDamage]" -ne "true"|Done --!t:[*T:t-id]|bar[&HPBar]_value:-=[$TotalDmg] --:Done| }} !splay Bite %{selected|Portrait} ***@{selected|token_name} attacks with its ``Bite``!***
Joshua N., How do I make the output visible to me but not the players? With !Powercards, I normally use: --whisper|GM but I am having trouble adjusting this to !Scriptcards... Thank you!!
--#whisper|gm That will set the output to whisper to you as the GM. Alternatively if you are the only one that has access to the macro, you could use --#whisper|self More info on ScriptCards parameters Alternatively, every --+ could be replaced with --*
Thank you