I've finally stepped up and started using CODE as a roll option for my macros and I think I have done decently to get this far without much P2P help. But, right now, I'm just stuck on a small issue that irks me.
The code I have (below) outputs everything fine roll wise, but there are two sets of random quotation marks that get inserted either before or after the attack and hit rolls. It is somehow linked to if the player is using a ranged or melee attack, but I just can't figure out where they come from.
Code: Select all
[h:WeaponState=Melee_0_Or_Ranged_1]
[h:IsMelee= if(WeaponState==0, 1, 0)]
[h:IsRanged= if(WeaponState==1, 1, 0)]
[h:roll1=1d20]
[h:roll2=1d20]
<table border='1' cellpadding='5' cellspacing='0' width='500'>
<tr style="background-color: green">
<td><span style='color: white; font-weight: bold'>Twin Strike - Ranger Attack 1</span></td>
</tr>
<tr style="background-color: #DAD9C6">
<td style="font-style: italic">If the first attack doesn't kill it, the second one might.</td>
</tr>
<tr>
<td><b>At-will • Martial, Weapon</b><br>
<b>Standard Action • Melee weapon</b></td>
</tr>
<tr style="background-color: #DAD9C6">
<td><b>Target:</b> One creature<br></td>
</tr>
<tr>
<td><b>Attack Roll:</b> [t,IF(IsMelee==1),CODE: {[t:totalroll1=Roll1+7] (Longsword) & [t:totalroll2=Roll2+7] (Shortsword) vs. AC}] [t,if(IsRanged==1),CODE: {[t:totalroll1=Roll1+6] & [t:totalroll2=Roll2+6] (Longbow) vs. AC}] <span style='color:00E31A'>[r:if(Roll1==20,'Your first roll was a Critical Success!','')]</span><span style='color:C90000'>[r:if(Roll1==1,'Your first roll was a Critical Failure!','')]</span> <span style='color:00E31A'>[r:if(Roll2==20,'Your second roll was a Critical Success!','')]</span><span style='color:C90000'>[r:if(Roll2==1,'Your second roll was a Critical Failure!','')]</span></td>
</tr>
<tr style="background-color: #DAD9C6">
<td><b>Hit:</b> [t,IF(IsMelee==1),CODE: {[t:if(Roll1==20, 8, 1d8)] (Longsword) & [t:if(Roll2==20, 6, 1d6)] (Shortsword) damage}] [t,if(IsRanged==1),CODE: {[t:if(Roll1==20, 10, 1d10)] & [t:if(Roll2==20, 10, 1d10)] (Longbow) damage}]</td>
</tr>