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
huntercc
Senior Member
 
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213

Old January 26th, 2008, 08:17 PM
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:

Quote:
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:

Quote:
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???
huntercc is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 27th, 2008, 07:57 AM
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
Mathias is offline   #2 Reply With Quote
huntercc
Senior Member
 
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213

Old January 27th, 2008, 10:54 AM
Thanks for the tip - looks to be working great now!
huntercc is offline   #3 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 10:23 PM.


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