Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
mirtos
Senior Member
 
Join Date: Oct 2011
Posts: 865

Old July 7th, 2014, 03:55 PM
Im trying to create a "rage-like" ability that follows pathfinders basis of rounds/day vs the times/day, and base it on con modifier. thats the problem im having.

Code:
~ Available when not lawful - otherwise we don't meet requirements
      var result as number
      if (hero.tagis[Alignment.Lawful] <> 0) then
        result = assign[Helper.SpcDisable]
      	endif

      ~ If we're enraged, apply the stat modifiers for that
      var level as number
      level = field[xTotalLev].value
      

      var attrbonus as number
      var savebonus as number
      if (level >= 20) then
        attrbonus = 8
        savebonus = 4
      elseif (level >= 11) then
        attrbonus = 6
        savebonus = 3
      else
        attrbonus = 4
        savebonus = 2
        endif
      if (field[hIsOn1].value <> 0) then
        hero.child[aSTR].field[Bonus].value += attrbonus
        hero.child[aCON].field[Bonus].value += attrbonus
        hero.child[aDEX].field[Bonus].value += attrbonus
        #applybonus[BonMorale, hero.child[vWill], savebonus]
        endif

      ~ Set up our text fields
      field[CustDesc].text = "Focus your aggression, giving you +" & attrbonus & " Str, Dex +" & attrbonus & " Con, +" & savebonus & " to Will saves and -2 to Armor Class. Many skills and abilities cannot be used while the character is enraged.{br}{br}Rage lasts for 3 rounds + Con bonus."
      if (level < 17) then
        field[CustDesc].text = field[CustDesc].text & " At the end of the fury, the Viking becomes fatigued (-2 Str, -2 Dex, can't charge or run) for the rest of the encounter."
        endif
      field[xSumm].text = "+" & attrbonus & " Str, Dex, +" & attrbonus & " Con, +" & savebonus & " to Will saves, -2 to AC when enraged."

      ~ If we're exhausted, apply the stat modifiers for that (we don't get
      ~ exhausted after level 17)
      if (level < 17) then
        field[hName2].text = "Exhausted"
        if (field[hIsOn2].value <> 0) then
          hero.child[aSTR].field[Penalty].value = hero.child[aSTR].field[Penalty].value - 2
          hero.child[aDEX].field[Penalty].value = hero.child[aDEX].field[Penalty].value - 2
          endif
        endif

      ~ We can Fury based on our constitution + level rounds per day
      ~ times per day.
      var total as number
      total = 2 + (level * 2) + hero.child[aCON].field[Bonus].value
      
      field[hTotal].value += total
      field[livename].text = "Fury (" & total & "rounds/day)"
The section thats not working right:
Code:
      total = 2 + (level * 2) + hero.child[aCON].field[Bonus].value
Its ignoring the con bonus. Also, id like it to to be based on "real con bonus" vs "temporary con bonus".

Thoughts and help would be useful.

Thanks!
mirtos is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old July 7th, 2014, 07:45 PM
Quote:
Originally Posted by mirtos View Post
Im trying to create a "rage-like" ability that follows pathfinders basis of rounds/day vs the times/day, and base it on con modifier. thats the problem im having.
.
.
.
The section thats not working right:
Code:
      total = 2 + (level * 2) + hero.child[aCON].field[Bonus].value
Its ignoring the con bonus. Also, id like it to to be based on "real con bonus" vs "temporary con bonus".

Thoughts and help would be useful.

Thanks!
If you haven't gotten an answer by tomorrow morning, I'll take a look at this when I get in front of HL. First though, when are running this script? If it's ignoring the CON bonus, it could simply be running too early. If the timing is ok, you could try breaking that line up into two parts. For example:

Code:
      total = (level * 2)
      total += 2 + hero.child[aCON].field[Bonus].value
If that works then its something to do with the structure of the equation.

PS. "perform" has replaced the need for a variable. For example:

Code:
      var result as number
      if (hero.tagis[Alignment.Lawful] <> 0) then
        result = assign[Helper.SpcDisable]
      	endif
can instead be done as:

Code:
      if (hero.tagis[Alignment.Lawful] <> 0) then
        perform assign[Helper.SpcDisable]
      endif
Sendric is offline   #2 Reply With Quote
mirtos
Senior Member
 
Join Date: Oct 2011
Posts: 865

Old July 8th, 2014, 04:37 AM
I had it previously as two lines. No difference. I'll check the timing tonight when I get home.
mirtos is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old July 8th, 2014, 06:14 AM
Alright. I took a look at this. First off, looks like you took the script from the Barbarian Rage which runs post-levels/10000. That's too early to determine your CON bonus. However, if you move the whole script to post-attributes then nothing else works. So, I recommend you move that last piece to a new script.

Second, you want to use the field "aBonus" instead of "Bonus". The former is your CON bonus before modifiers, while the latter is used for untyped bonuses to your CON score.

Post-Attributes/15000
Code:
      ~ We can Fury based on our constitution + level rounds per day
      ~ times per day.
      var total as number
      total = 2 + (field[xTotalLev].value * 2) + hero.child[aCON].field[aBonus].value
      
      field[hTotal].value += total
      field[livename].text = "Fury (" & total & " rounds/day)"
PS. If you right-click on your CON score and select "Show Debug Fields" you can see how the fields change when you are enraged. This tells you which field you want to use for this purpose.
Sendric is offline   #4 Reply With Quote
mirtos
Senior Member
 
Join Date: Oct 2011
Posts: 865

Old July 8th, 2014, 06:18 AM
Thanks. Especially for the Show the Debug fields hint. I always forget about that.
mirtos is offline   #5 Reply With Quote
Reply


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:14 AM.


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