Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Greylin
Member
 
Join Date: Jul 2014
Posts: 46

Old June 29th, 2016, 01:43 PM
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."
Greylin is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,146

Old June 30th, 2016, 04:08 AM
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."
Sendric is offline   #2 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,146

Old June 30th, 2016, 04:10 AM
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
Sendric is offline   #3 Reply With Quote
Greylin
Member
 
Join Date: Jul 2014
Posts: 46

Old June 30th, 2016, 07:46 AM
Thank you!
Greylin is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:30 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.