• 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

Level based attack bonus problem

huntercc

Well-known member
I'm trying to add a class feature that calculates an attack bonus based on level in a specific class. The calculation works just fine, but I can't get the bonus to apply when I need it to. The documentation on the Attack pick says the following:

For modifications to have any effect on other fields (e.g., changes to the base attack bonus affecting the melee and ranged attack bonuses), any priority before the "PostAttr" phase should be used. The final values are available in the "UserPostAt" or later phases.

I try to use the following script in UserPreAt/10000:

if (field[hIsOn1].value <> 0) then
#applybonus[BonMorale, hero.child[Attack], field[Value].value]
endif

Not very complicated, but it doesn't work. The latest phase I can get a bonus to apply to the attack is Level. Problem is, I need to be able to calculate the value based on level - so the Level phase is too soon.

Help???
 
You can calculate a level using Classes.? during the level phase. Here's a piece of the script for the Transformation spell - it replaces BAC with your class level.

Level, 10500

Code:
~Count the number of classes
var levels as number
levels = hero.tagcount[Classes.?] - hero.tagcount[Classes.Race] - hero.tagcount[Classes.Template]

hero.child[Attack].field[tAtkBase].value = levels
 
Back
Top