• 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

AC Bonus Based on Attribute?

Nalerenn

New member
To cut a long story short, one of the classes I'm attempting to code in has a feature that uses its Con bonus to add to its Natural Armor, with a minimum of 1. I've tried bootstrapping it with the code below, but I can't seem to get it to change at all with the stats.

Code:
hero.child[mNatural].field[Bonus].value = hero.child[mNatural].field[Bonus].value + hero.child[aCON].field[aNormMod].value

Anyone got any insight into this? Or am I forgetting something simple ^^;;
 
Natural armor is:
hero.child[ArmorClass].field[tACNatural].value

Timing?

Since you want the Con mod, you'll need to be in the Post-Attributes phase or later (Post-Attributes/10000 seems about right).

I'd suggest using aModBonus instead of aNormMod - otherwise, your Amulet of Health's effects won't be added to your natural armor.

Since you want a minimum bonus (and I'm shortening the amount of typing as well):

Code:
hero.child[ArmorClass].field[tACNatural].value += maximum(hero.child[aCON].field[aModBonus].value, 1)
 
Ah, I was using it Post-Levels. My bad, forgot to whack that in there.

And that worked a charm, thanks! I'll have to remember that code.
 
Back
Top