• 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

Checking for Template in Eval Script

wolfbook22

New member
Due to a magic item and the difference in when dragons gain the ability to cast spells, my dragon wizard character gains an increase to an Arcane Caster level. So far, I have created a Racial Special that I am able to add, pick an arcane source, and increase the caster level once.

However, once I add a specific template to the hero, this should increase the caster level by another 1 (total 2). Is it possible to do this all in one Eval Script, or is there another place some of this should be done?

This is what I have so far in the Eval Script.

Code:
Phase: First
Priority: 100

~ This works for all normal classes, increase Caster lvl by 1
    field[usrChosen1].chosen.field[cCasterLev].value += 1

~If the template is added
~    if (tmSpTr04 = true) then
~    field[usrChosen1].chosen.field[cCasterLev].value += 1

Thanks in advance
 
You're going to want to use "if (hero.tagis[Template.tmTEMPLATEID] <> 0) then" to check for the presence of the template, though personally I'd use "doneif (hero.tagis[Template.tmTEMPLATEID] = 0)" since you don't have anything more after that. The timing might need to be a bit later, I don't recall for sure when Templates forward their tags to the hero, but maybe give First 1000 a try.

Alternatively you could use "doneif (hero.childlives[tmTEMPLATEID] = 0)", which would circumvent that tag forwarding, if timing becomes an issue.
 
Back
Top