
I'm trying to write a macro for a large number of identical enemies attacking a single target in D&D 5e (+4 to hit, 1d6+2 damage). I'd like to have a macro that queries for the number of attackers, rolls against their armor class, and then rolls damage for each attacker that managed to hit. The idea is: numHits = /roll {?{numAttackers|1}d20+4}>@{target|ac} damage=/roll #{numHits}d6+#{numHits}*2 But the problem is I don't see a way to create a temporary variable that I can reference later. Repeatedly rolling numHits is wrong, since it would be basically rolling one attack doing 1d6 damage and then a second attack dealing 2 damage. Or, equivalently, I could repeat the 1d6+2 roll numHits times: damage= /roll {1d6+2} {?{numAttackers|1}d20+4}>@{target|ac} times and then add them all up. But I don't know of die-rolling syntax that allows me to do, like "/roll 3{1d6+2}" which would expand into "/roll {1d6+2}+{1d6+2}+{1d6+2}" instead of "/roll 3*{1d6+2}" Any suggestions?