Senior Member
Join Date: Oct 2011
Posts: 865
|
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)" Code:
total = 2 + (level * 2) + hero.child[aCON].field[Bonus].value Thoughts and help would be useful. Thanks! |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Code:
total = (level * 2) total += 2 + hero.child[aCON].field[Bonus].value 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 Code:
if (hero.tagis[Alignment.Lawful] <> 0) then perform assign[Helper.SpcDisable] endif |
|
#2 |
Senior Member
Join Date: Oct 2011
Posts: 865
|
I had it previously as two lines. No difference. I'll check the timing tonight when I get home.
|
#3 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
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)" |
#4 |
Senior Member
Join Date: Oct 2011
Posts: 865
|
Thanks. Especially for the Show the Debug fields hint. I always forget about that.
|
#5 |
|
|