• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

coding query

Greylin

Well-known member
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."
 
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)
      [COLOR="Red"]sneak = minimum(sneak,3)[/COLOR]
      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."
 
Back
Top