• 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

Need to check if class special ability is disabled...

mahan006

Member
I've looked everywhere and can't seem to find reference to figure out if a class special ability is disabled. I am adding some user data through the editor and need to write a script to check if it is disabled.

any help would be appreciated.
 
The only thing that comes to mind is to look for the tag 'Helper.SpcDisable' on the special.If the tag exists, its disabled.
 
I believe he wants to know if a class ability is available to the class, which I believe is determined by a conditional check against the level. This level is on the Class Special, which you should be able to compare to the hero's class level to determine if it is active. Does that help?
 
Sendric had the correct idea. I will try that again but I believe the class special abilities have a different naming convention from the generic special abilities. Thanks for the ideas and feel free to keep them coming. Anything helps.
 
*UPDATE*
I was trying to add a class special that would add my charisma modifier to my saving throws from level two and on. Here is the code that ended up working for me.

var level as number
level = herofield[tTotLevel].value
if (level >= 2) then

~ Add charisma bonus to saves

hero.child[vFort].field[Bonus].value = hero.child[vFort].field[Bonus].value + hero.child[aCHA].field[aBonus].value

hero.child[vRef].field[Bonus].value = hero.child[vRef].field[Bonus].value + hero.child[aCHA].field[aBonus].value

hero.child[vWill].field[Bonus].value = hero.child[vWill].field[Bonus].value + hero.child[aCHA].field[aBonus].value
endif
 
*UPDATE*
I was trying to add a class special that would add my charisma modifier to my saving throws from level two and on. Here is the code that ended up working for me.

var level as number
level = herofield[tTotLevel].value
if (level >= 2) then

~ Add charisma bonus to saves

hero.child[vFort].field[Bonus].value = hero.child[vFort].field[Bonus].value + hero.child[aCHA].field[aBonus].value

hero.child[vRef].field[Bonus].value = hero.child[vRef].field[Bonus].value + hero.child[aCHA].field[aBonus].value

hero.child[vWill].field[Bonus].value = hero.child[vWill].field[Bonus].value + hero.child[aCHA].field[aBonus].value
endif


For reference, you don't need the variable for your initial if statement. You could easily truncate that to:

Code:
if (herofield[tTotLevel].value >= 2) then
[code]

As for the rest, I can't remember if there is a way to add to all saves at once in one line. I'm not at a computer with HL installed, but you could look at the adjustments. I believe there is one that does all, and that might show you a way to do all at once.

EDIT: Ok, I guess there isn't an adjustment that does all three. My bad. Looking at the cloak of resistance, it appears your method is about as efficient is it will get.
 
Last edited:
Sendric had the correct idea. I will try that again but I believe the class special abilities have a different naming convention from the generic special abilities. Thanks for the ideas and feel free to keep them coming. Anything helps.

I guess you could look for the Helper.ShowSpec tag. I don't think this is foolproof, though as some class specials won't have this tag even if the appropriate level has been obtained. Some abilities, though, put tags on the hero. For example, if you wanted to see if a character has wild shape, you could use the code:

Code:
hero.tagis[Hero.WildShape] <> 0

There are examples of these kinds of things throughout the feats.
 
Last edited:
Back
Top