Ok, thank you everyone that has helped on this macro I believe I have figured everything out that I needed to.
Here is the following code I ended up with what do you guys think?
Code: Select all
[h: att1 = getProperty("Wpn 1 Att 1")]
[h: wpndmg1 = getProperty("Wpn 1 Dmg")]
[h: bns1 = getProperty("Wpn 1 Dmg Bns")]
[h: roll = 1d20]
[h: dmg1 = eval(wpndmg1)]
[h: att2 = getProperty("Wpn 1 Att 2")]
[h: dmg2 = eval(wpndmg1)]
[h: att3 = getProperty("Wpn 1 Att 3")]
[h: dmg3 = eval(wpndmg1)]
[h: att4 = getProperty("Wpn 1 Att 4")]
[h: dmg4 = eval(wpndmg1)]
[h: fum=0]
[h: err = getProperty("Wpn 1 Error")]
[h: thrt = getProperty("Wpn 1 Threat")]
[r, if(roll >= thrt),CODE:
{
<b>Attack:</b><b>CRIT!!!!!</b> [t: roll+att1]<br>
<b>Damage:</b> [t: dmg1+dmg1+bns1]<br>
};
{
};
]
[r, if(roll <= err),CODE:
{
<b>FUMBLE!!!!!</b><br>
[h: fum=1]
};
{
};
]
[r, if(roll > err && roll < thrt),CODE:
{
<b>Attack:</b> [t: roll+att1]<br>
<b>Damage:</b> [t: dmg1+bns1]<br>
};
{
};
]
[h: roll = 1d20]
[h: check=0]
[r, if(roll >= thrt),CODE:
{
[h: check=2]
};
{
};
]
[r, if(roll <= err),CODE:
{
[h: check=1]
};
{
};
]
[r, if(att2 > 0 && fum == 0),CODE:{
[switch(roll), code:
case 2: {
<b>Attack:</b><b>CRIT!!!!!</b> [t: roll+att2]<br>
<b>Damage:</b> [t: dmg2+dmg2+bns1]<br>
};
case 1: {
<b>FUMBLE!!!!!</b><br>
[h: fum=1]
};
default: {
<b>Attack:</b> [t: roll+att2]<br>
<b>Damage:</b> [t: dmg2+bns1]<br>
}]
};
{
};
]
[h: roll = 1d20]
[h: check=0]
[r, if(roll >= thrt),CODE:
{
[h: check=2]
};
{
};
]
[r, if(roll <= err),CODE:
{
[h: check=1]
};
{
};
]
[r, if(att3 > 0 && fum == 0),CODE:{
[switch(check), code:
case 2: {
<b>Attack:</b><b>CRIT!!!!!</b> [t: roll+att3]<br>
<b>Damage:</b> [t: dmg3+dmg3+bns1]<br>
};
case 1: {
<b>FUMBLE!!!!!</b><br>
[h: fum=1]
};
default: {
<b>Attack:</b> [t: roll+att3]<br>
<b>Damage:</b> [t: dmg3+bns1]<br>
}]
};
{
};
]
[h: roll = 1d20]
[h: check=0]
[r, if(roll >= thrt),CODE:
{
[h: check=2]
};
{
};
]
[r, if(roll <= err),CODE:
{
[h: check=1]
};
{
};
]
[r, if(att4 > 0 && fum == 0),CODE:{
[switch(check), code:
case 2: {
<b>Attack:</b><b>CRIT!!!!!</b> [t: roll+att4]<br>
<b>Damage:</b> [t: dmg4+dmg4+bns1]<br>
};
case 1: {
<b>FUMBLE!!!!!</b><br>
};
default: {
<b>Attack:</b> [t: roll+att4]<br>
<b>Damage:</b> [t: dmg4+bns1]<br>
}]
};
{
};
]
Any input would be greatly appreciated
ralstad