Hi Josh We have a weapon effect that targets a variable number of targets and use this script for it. If you look you can see it is based heavily on Kurt J's Magic Missile and also another piece of his that produces an array of targets. Perhaps you could adapt this? It wouldn't take much to add a query for whether healing or harm and thus make the final amount of damage used by Token-Mod a positive or negative. If saves don't factor, that part could easily be chopped out or DC set ridiculously high? !script
{{
--/|
Let’s set up some basics, starting with the card layout
--#bodyfontface|Helvetica
--#bodyfontcolor|#220000
--#buttonfontsize|9px
--#buttonbackground|#2c0f70
--#buttonfontface|Tahoma
--#titlecardbackground|#f6efd6
--#titlefontcolor|#ffffff
--#titlefontsize|1.5em
--#titlefontshadow|0
--#titlecardBackgroundImage|url(' <a href="https://s3.amazonaws.com/files.d20.io/images/248538196/c9xft1A2jWNqOkBsxQwyLQ/max.jpg?1633278017" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/248538196/c9xft1A2jWNqOkBsxQwyLQ/max.jpg?1633278017</a> ');
background-size: 100% 100%; background-repeat: no-repeat;
--#oddrowbackground|#f6efd6
--#evenrowbackground|#f6efd6
--#subtitlefontcolor|#58180d
--#sourceToken|@{selected|token_id}
--#emoteText|@{selected|character_name}
uses SPELLNAME HERE to blast enemies with lightning!
--=SaveDC|DC
[[8 + @{selected|PB} + @{selected|constitution_mod}]] Dex save
--+|
[c]DC [$SaveDC] Dex Save[/c]
--/|Now
the script. Set this to either "scriptcards" or anything
else to not apply damage
--&damageApplyScript|scriptcards
--/|Set
this to the bar number you use to track hit points
--&hitPointsBar|1
--/|If
damageMode is 1, a separate die will be rolled for each missile. Set
this variable to 0 to,
--/|only
have a single damage die roll applied to each missile.
--&damageMode|0
--&damageType|lightning
--#reentrant|targetPicker_[&SendingPlayerID]
--#title|SPELLNAMEHERE --#whisper|self --/|Helper variable build
up to allow us to include a target prompt in an rbutton --&TB|&
--&TB|+# --&TB|+64 --&TB|+; --&TB|+{
--&TargetBase|[&TB]Target|Target_##|token_id}
--&ButtonEnd|[/rbutton]
--&BaseButton|[rbutton]##::AddTarget;[&TargetBase]
--&ButtonArray(0)|[&BaseButton(replaceall,##,1)] --%loop|1;9
--&ButtonArray([&loop])|[@ButtonArray([=[&loop] -
1])]|[&TargetBase(replaceall,##,[=[&loop]+1])]
--&temp|[@ButtonArray([&loop])] --&rep|[=[&loop] +
1]:: --&find|[&loop]::
--&ButtonArray([&loop])|[&temp(replaceall,[&find],[&rep])]
--%| --%loop|0;[@ButtonArray(maxindex)]
--&ButtonArray([&loop])|[@ButtonArray([&loop])][&ButtonEnd]
--%| --+|[c]Choose number of targets[/c][br] --&output|[c]
--%loop|foreach;ButtonArray --&output|+[&loop] --%|
--&output|+[/c] --+|[&output] --X| --:ShowTargetList|Y or N
for including removeal buttons --?"[@targetList()]" -eq
""|< --?"[@targetList()]" -eq "undefined
array"|< --=Index|0 --%loop|foreach;targetList
--&append|[r][rbutton]X::RemoveTarget;[$Index.Raw][/rbutton][/r]
--?"[%1%]" -ne "Y"|&append; --+Target|[&loop]
([*[&loop]:t-name]) [&append] --=Index|[$Index] + 1 --%| --<|
--/|Reentrant point for the "Add Target" button
--:AddTarget| --~|array;define;inRange;[&reentryval(replaceall,|,;)]
--=TargetNum|[@inRange(length)]
--/|Calculate
damage
--=DamageDice|3
--=Damage|[$DamageDice.Total]d8
--=HalfDamage|[$Damage.Total]
\ 2
--/|Since
we want to be able to hover over a roll and see the dice details,
output the rolled damage at the
--/|top
of the card. If all critters make their save, the half damage roll
won't contain the details.
--+|[c][b]Damage
Roll: [/b][$Damage][/c]
--+|&nbsp;
--/|Loop
through the inRange tokens and roll saves for each one and apply
damage
--~tokenid|array;getfirst;inRange
--?[&tokenid]
-eq ArrayError|endOutput
--:loopDisplay|
-->MakeSavingThrow|[&tokenid];dexterity;[[8
+ @{selected|PB} + @{selected|constitution_mod}]]
;[$Damage.Total];lightning;thisTokenDamage;saveResult;dex
--+[*[&tokenid]:character_name]:|Rolled
[$savingThrow] [r][$thisTokenDamage] lightning damage[/r]
-->ApplyDamageTokenmod|[&tokenid];1;[$thisTokenDamage]
--/|Put
a burn-fire visual effect on impacted tokens
--vtoken|[&tokenid]
burn-frost
--/|Get
the next token and continue the loop until we run out.
--~tokenid|array;getnext;inRange
--?[&tokenid]
-ne ArrayError|loopDisplay
--/|Add
some extra visual effects - a nova-fire at the target, and a
beam-fire from source to target
--vtoken|[&tokenid]
nova-frost
--vbetweentokens|@{selected|token_id}
[tokenid] beam-magic
--:endOutput|
--X|
--/|Subroutine
to make saving throws and calculate damage amounts
--:MakeSavingThrow|tokenid;savetype;dc;damage;damagetype;damagevariable;saveresultvariable;shortabilityname
-->GetSaveBonus|[&tokenid];dexterity;dex
--=savingThrow|1d20
+ [$saveBonus] [BONUS]
--&dmgmult|
--?[$savingThrow]
-ge [%3%]|>set_string;dmgmult; \ 2
--?[$savingThrow]
-lt [%3%]|>set_string;[%7%];fail
--?[$savingThrow]
-ge [%3%]|>set_string;[%7%];success
--?"[*[%1%]:npc_resistances]"
-inc "[%5%]" -and [$savingThrow] -lt
[%3%]|>set_string;dmgmult; \ 2
--?"[*[%1%]:npc_resistances]"
-inc "[%5%]" -and [$savingThrow] -ge
[%3%]|>set_string;dmgmult; * 0
--?"[*[%1%]:npc_vulnerabilities]"
-inc "[%5%]" -and [$savingThrow] -ge
[%3%]|>set_string;dmgmult;
--?"[*[%1%]:npc_vulnerabilities]"
-inc "[%5%]" -and [$savingThrow] -lt
[%3%]|>set_string;dmgmult; * 2
--?"[*[%1%]:npc_immunities]"
-inc "[%5%]"|>set_string;dmgmult; * 0
--=[%6%]|[%4%]
[&dmgmult]
--<|
--:set_string|mod_variable;value
--&[%1%]|[%2%]
--<|
--:GetSaveBonus|
accepts tokenid, full attribute name, short attribute name as
parameters
--:TAKE
THE GREATER OF "attribute_save_bonus" OR
"npc_attr_save_base"|
--=bonus1|[*[%1%]:[%2%]_save_bonus]
--&bonus2|[*[%1%]:npc_[%3%]_save_base]
--:SOMETIMES
"npc_attr_save_base" IS BLANK, SO SET TO -99. OTHERWISE USE
ATTR VALUE|
--?X[&bonus2]
-eq
"X"|>Set_npc_attr_save_bonus;-99|>Set_npc_attr_save_bonus;[&bonus2]
--:FINALLY
SET THE SAVE BONUS|
--?[$bonus2]
-gt [$bonus1]|>SetSaveBonus;[$bonus2]|>SetSaveBonus;[$bonus1]
--<|
--:Set_npc_attr_save_bonus|
blank value is set to -99, otherwise use value stored in attribute
--=bonus2|[%1%]
--<|
--:SetSaveBonus|
--=saveBonus|[%1%]
--<|
--/|Subroutine
to apply damage with TokenMod. Could be replcaed with alterbars or
chatsetattr
--:ApplyDamageTokenmod|Parameters
are tokenid;bar#;amount
--@token-mod|_ids
[%1%] _set bar[%2%]_value|-[%3%]
--<|
}}
--%loop|1;9 sets the number of targets, currently 10 Hope that helps? EDIT - the saving rolls bit comes from David M (I think) and their Turn Undead script. I realise the script could be polished up so references to magic missile etc are taken out, but I needed to get up and running swiftly for the final session of Descent and so as long as it worked I was happy.