View Single Post
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 14th, 2018, 12:51 PM
Quote:
Originally Posted by dungeonguru View Post
hero.child[Initiative].field[Penalty].value -= maximum(round(#levelcount[Fighter]/4,0,-1),1)
Honestly for any Class Ability should never hard-code a specific class as it prevents the ability from being used by other classes.

Class Abilities have a field called xTotalLev that should be used to get total class level. In addition its easy to apply "effective class increases" by using the above field.

If it was me building a class ability I would always store the value that increases/decreases into abValue to allow outside scripts to affect the ability.

Meaning I end up with the following logic:
Code:
field[abValue].value += -1 * maximum(round(field[xTotalLev].value/4,0,-1),1) 

hero.child[Initiative].field[Penalty].value += field[abValue].value

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.

Last edited by ShadowChemosh; February 14th, 2018 at 12:53 PM.
ShadowChemosh is offline   #3 Reply With Quote