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

!Ammo or CharAttSet Script Mod Assistance Needed

1601079552
Rogue
Pro
Marketplace Creator
So I have a token drop down menu setup which calls on all the spells from the character's spell list for Demon Gate characters. I would like for the spell drain of each spell to be automatically taken from the Mana Pool of the character when they roll to cast. Any ideas of how it may work? !ammo @{selected|token_id} @{ManaAdj} -@{Spell1Drain} The actual token macro looks like this but I'd like to use the script and input it in here for each of the 6 spells of the caster's primary attack magic. /em Casts a Spell &{template:default} {{name=@{name} Cast Result}} {{Total to Cast = ?{Spell List|@{Spell1Name},[[d20+@{selected|Spell1HitMod}+?{Modifier|0} [@{Spell1Name}_Cast] ]] **@{Spell1Name}**|@{Spell2Name},[[d20+@{selected|Spell2HitMod}+?{Modifier|0} [@{Spell2Name}_Cast] ]] **@{Spell2Name}**|@{Spell3Name},[[d20+@{selected|Spell3HitMod}+?{Modifier|0} [@{Spell3Name}_Cast] ]] **@{Spell3Name}**|@{Spell4Name},[[d20+@{selected|Spell4HitMod}+?{Modifier|0} [@{Spell4Name}_Cast] ]] **@{Spell4Name}**|@{Spell5Name},[[d20+@{selected|Spell5HitMod}+?{Modifier|0} [@{Spell5Name}_Cast] ]] **@{Spell5Name}**|@{Spell6Name},[[d20+@{selected|Spell6HitMod}+?{Modifier|0} [@{Spell6Name}_Cast] ]] **@{Spell6Name}** }  ?{Spell Task|    1 Magic Action, **Magic Action: 1**|2 Magic Actions, **Magic Actions: 2**|3 Magic Actions, **Magic Actions: 3**|4 Magic Actions, **Magic Actions: 4**|5 Magic Actions, **Magic Actions: 5**|6 Magic Actions, **Magic Actions: 6** }  }}
1601083221

Edited 1601083254
GiGs
Pro
Sheet Author
API Scripter
If you want that ammo macro to perform a calculation, it would be something like this: !ammo @{selected|token_id} [[@{selected|ManaAdj} -@{selected|Spell1Drain}]]
1601084789

Edited 1601084860
Rogue
Pro
Marketplace Creator
Thanks @GiGs for some reason getting a result like this and it is not taking the mana drain from the token. It is showing the remaining mana pool (33) there Total to Cast 16  !ammo -MHmg1PgxN5Dy0qFi3zc  33   Aether Bolt Magic Action: 1
1601089351
GiGs
Pro
Sheet Author
API Scripter
I looked at the ammo syntax and realised I'd misunderstood your original command !ammo <character_id> <attribute name> <amount> [resource name] So it should be !ammo @{selected|token_id} @{selected|ManaAdj} -@{selected|Spell1Drain} Give that a try.