Member
Join Date: Jul 2014
Posts: 46
|
Sorry for a very basic question, but I want the below eval script for sneak attack bonus to cap out at +3d6 at 15th level rather than incrementing to +4d6 at 20th. How might I put in a 'max 3' limit please?
--snip-- ~ Add our level / 5 to our sneak attack damage. var sneak as number sneak = field[xTotalLev].value / 5 sneak = round(sneak, 0, -1) hero.child[xSneakAtt].field[Value].value = hero.child[xSneakAtt].field[Value].value + sneak field[livename].text = "Sneak Attack +" & sneak & "d6" field[CustDesc].text = "+" & sneak & "d6 to your Sneak Attack damage." |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
See the added code in red below:
Code:
~ Add our level / 5 to our sneak attack damage. var sneak as number sneak = field[xTotalLev].value / 5 sneak = round(sneak, 0, -1) sneak = minimum(sneak,3) hero.child[xSneakAtt].field[Value].value = hero.child[xSneakAtt].field[Value].value + sneak field[livename].text = "Sneak Attack +" & sneak & "d6" field[CustDesc].text = "+" & sneak & "d6 to your Sneak Attack damage." |
#2 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
BTW, you should check out this thread on the Pathfinder forum that Mathias wrote up. I reference it quite a bit even though it's meant for Pathfinder. Most of it also applies to d20:
http://forums.wolflair.com/showthread.php?t=21688 |
#3 |
Member
Join Date: Jul 2014
Posts: 46
|
Thank you!
|
#4 |
|
|