MapTool macros for DnD 5e: Melee HitfoxshotRank: #672 dnd, dungeons-n-dragsBlocksBlocks prevnext Prev Next So here is a bit more of MapTool macros from me. I'll post these as I keep going along with the campaign. I was going to save this for later after properly testing it out but had a bit of a snag last time as only the GM could use the macros. But I'm confident enough that the macro works for what it supposed to be.And this is the dialog that pops up when one does a melee attack. It has a drop down menu of all the tokens (that are not dead and are within 5 ft reach) to choose from with icons too. [h: allTokens = getTokens("json",'{ range: {upto:5, distancePerCell:1}, unsetStates:["Dead"]}')] [h: tokenIDs = json.toList(allTokens)] [h: num = listCount(tokenIDs)] [h: imgList = tokenIDs] [h, COUNT(num,""),CODE: { [id = listGet(tokenIDs, roll.count)] [name = getName(id)] [image = getTokenImage("", id)] [imgList=listReplace(imgList, roll.count,name+" "+image)] }] [h:status=input( "Target|"+imgList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=50", "strOrDex|Strength,Dexterity|Which ability is the character using?|RADIO|SELECT=0", "advantage|Advantage,Normal,Disadvantage|Is there an advantage?|RADIO|SELECT=1", "proficient|1|Proficient|CHECK" )] [h:abort(status)] Then you determine the bonuses [if(!strOrDex), CODE: { [h: abilityBonus = floor(getProperty("Strength")/2-5)] };{ [h: abilityBonus = floor(getProperty("Dexterity")/2-5)] }] [h, if(proficient): profiencyBonus = 2+floor(getProperty("Level")/4-0.25);profiencyBonus = 0] Then get the AC of the target, roll (determining the advantage) and sort if it was a hit (with all the output of the action) [h: targetID = listGet(tokenIDs, Target)] [h: targetAC = getProperty("AC",targetID)] [h,switch(advantage), CODE: case 0: { [hitRoll = keep(2,20,1)] [advIndicator = " with advantage"] }; case 1: { [hitRoll = roll(1,20)] [advIndicator = ""] }; case 2: { [hitRoll = keepLowest(2,20,1)] [advIndicator = " with disadvantage"] }] [switch(hitRoll), CODE: case 1: { <font color=red> [r:"Rolls critical miss on " + getName(targetID) + advIndicator] <br> </font> }; case 20: { <font color=red> [r:"Rolls critical hit on " + getName(targetID) + advIndicator] <br> </font> }; default: { Rolls [r:hitRoll] + [r:abilityBonus] + [r:profiencyBonus] = [r: totalRoll = hitRoll+abilityBonus+profiencyBonus] [r:advIndicator] [r,if(totalRoll >= targetAC), CODE:{ and hits [r:getName(targetID)] <br> };{ missing [r:getName(targetID)] <br> }] }]And after all that you'll get a little message on the chat. prevnext +12 -Favorite +Favorite Unblock User's Content Block User's Content Sub/Block Channels dnd:UploadUnblockBlockSubUnsubsubs: 165 dungeons-n-drags:UploadUnblockBlockSubUnsubsubs: 3345