Recent Chat Activity (Main Lobby)
Join Chat

Loading Chat Log...

Prefer not to see ads? Become a Community Supporter.
View RSS Feed

Q-man

Generic D&D 4E Power macro

Rate this Entry
Not long ago I was asked for help writing MapTool macros for a D&D 4E character. I came up with the idea that writing a single generic macro that could fit most of the powers would be the way to go. This way you could just copy the macro over and over for each power rather than create a new power for each one.

Since the macro would be loaded by a player and not the GM of the game I couldn't rely on there being anything built into the campaign properties, so the macro needed to be entirely self contained. Normally I would use little dialog boxes to fill in the details, but those require values on the token to work properly. The easiest workaround I could think of was to have a block of values at the start of the macro that could be quickly edited to customize each power.

Its more or less done now. I suppose there's probably a few little things that could be added to it still, but it works pretty well as it is. If you're interested in seeing, or using, such a thing here it is:
Code:
[h: Name = "Melee Basic"]
[h: PowerType = "AtWill"]
[h: Action = "Standard"]
[h: KeyWords = "Weapon"]
[h: Desc =  "A basic melee attack"]
[h: AttackRoll = 1d20]
[h: AttackBonus = 0]
[h: CritOn = 20]
[h: CritBonus = "0"]
[h: Defense = "AC"]
[h: DamageDiceNumber = 1]
[h: DamageDiceSides = 6]
[h: DamageBonus = "0"]
[h: DamageType = "Physical"]

<!-- Set the color of the frame based on the PowerType -->
[h: FrameColor = "Gray"]
[h,if (PowerType == "AtWill"),code:
{
	[h: FrameColor = "Green"]
}]
[h,if (PowerType == "Encounter"),code:
{
	[h: FrameColor = "Red"]
}]
[h,if (PowerType == "Daily"),code:
{
	[h: FrameColor = "Black"]
}]

<!-- Calculate the damage differently if the attack scored a critical hit -->
[h,if(AttackRoll >= CritOn),Code:
{	
	[h: DamageRoll = DamageDiceNumber * DamageDiceSides]
	[h: CritBonus = eval(CritBonus + "")]
	[h: DamageRoll = DamageRoll + CritBonus]
};{
	[h: DamageRoll = eval(DamageDiceNumber + "d" + DamageDiceSides)]
}]

<!-- Calculate the damage bonus -->
[h: DamageBonus = eval(DamageBonus + "")]

<!-- Write the power's output in an html table -->
<table style="width:100%;">
	<!-- Display the frame with the power name -->
	<tr style="background-color:[r: FrameColor]">
		<td>
			<span style="color:white"><b>[r: Name]</b> <b>  [r: Action]</b> <b>  [r: KeyWords]</b>
		</td>
	</tr>
	
	<!-- Display the description -->
	<tr>
		<td>[r: Desc]</td>
	</tr>

	<!-- Display the attack roll -->
	<tr>
		<td>
			<b>Attack = [r: AttackRoll + AttackBonus] vs.  [r: Defense]</b> &nbsp; &nbsp; &nbsp;
			Rolled: [r: AttackRoll] &nbsp; &nbsp; Bonuses: [r: AttackBonus]
		</td>
	</tr>
	
	<!-- Display the damage roll -->
	<tr>
		<td>
			<b>Damage = [r: DamageRoll + DamageBonus] &nbsp; [r: DamageType] </b> &nbsp; &nbsp; &nbsp;
			Rolled: [r: DamageRoll] &nbsp; &nbsp; Bonuses: [r: DamageBonus]
		</td>
	</tr>
</table>
I may as well go through and explain all the values that need adjusted per power as well. Those are all in the first 14 lines of the macro.

Name = "Melee Basic"
This sets the name of the power. Change the text between the double quotes, just be sure to keep both double quotes.

PowerType = "AtWill"
This sets the type of power that you're using. Change the text between the double quotes to AtWill, Encounter, or Daily.

Action = "Standard"
This sets the type of action the power will use. Change the text between the double quotes to whatever is appropriate; Minor, Immediate Reaction, etc.

KeyWords = "Weapon"
This sets the keywords that are applied to the power. Just list them all inside the double quotes.

Desc = "A basic melee attack"
This sets a brief and generic description for the power. A short summary of what the power does goes in the double quotes.

AttackRoll = 1d20
This sets the attack roll thats made when the power is used. I can't think of any reason why this would need changed, but its here just in case.

AttackBonus = 0
This sets the bonus that is applied to the attack roll. All of your attack roll bonuses get listed here; ability modifier, half your level, weapon proficiency, all of that stuff. Just put the total bonus here.

CritOn = 20
This sets the minimum die roll needed to score a critical hit. In most cases this should be 20, but there are some magic weapons and powers that give crits on lower rolls. Just put the minimum number here.

CritBonus = "0"
This sets any damage bonuses that would apply to critical hits. Whatever expression is needed goes between the double quotes. For example a +2 weapon gives +2d6 on crit, so you'd use CritBonus = "2d6".

Defense = "AC"
This sets the target defense of the power. Put AC, Willpower, Fortitude, or Reflex inside the double quotes.

DamageDiceNumber = 1
This sets the number of dice that are rolled for the attack's damage. If the power does 2d10 damage, you would set this to DamageDiceNumber = 2.

DamageDiceSides = 6
This sets the size of the dice that are rolled for the attack's damage. If the power does 2d10 damage, you would set tis to DamageDiceSides = 10.

DamageBonus = "0"
This sets the bonus that is applied to the damage roll. Any bonuses from feats, magic weapons, ability modifiers, or anything else is set here. Just put the total value inside the double quotes. You can also use dice expressions in there, so DamageBonus = "2d8+10" would work as well.

DamageType = "Physical"
This sets the type of damage done by the attack. Put the type of damage inside the double quotes; necrotic, fire, force, whatever.

Submit "Generic D&D 4E Power macro" to Digg Submit "Generic D&D 4E Power macro" to del.icio.us Submit "Generic D&D 4E Power macro" to StumbleUpon Submit "Generic D&D 4E Power macro" to Google

Tags: None Add / Edit Tags
Categories
MapTools

Comments

  1. yukonhorror's Avatar
    that's great. I'll be sure to direct new players to this so they can copy/paste.