• 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

Either or Pre-req not wanting to work for me, HELP!

KTFish7

Active member
What I am trying to do is write a pre-req that states

Poison special attack and Ability Focus (poison), OR Ability to Cast Poison and Bestow Curse and Spell Focus (necromancy)

Writing scripts for either or is simple enough, I got that figured out, but to get it to do one group or the other, there's where I am having issues. I've looked through what I have available for feats and see no other examples of this type of pre-req that I can look to for an example, so I'm back again, hat in hand, hoping you guru's will take pity on me again, lol. I've got the parts, I just need to know how to string them together so that it works.

validif (herofield[tMaxCaster].value >= 7 + #hasfeat[fSpellFoc] <> 0)
validif (#hasfeat[fAbilFoc] + #hasability[cPfDInPois] <> 0)


I know this code is all syntax error and garbage, but these are the groupings I'm trying to have as the two options for pre-req, either one set or the other kinda thing, so I left them together so someone could see where I was trying to go with this.

So far all I've managed to get to work is the caster level (to have access to the spell), but the minute that worked, the entire pre-req was satisfied.

Now, I could do a work around of entering the feat twice, one for the magic, one without, but I really want to keep it together if possible.

Thanks again for all the help, you guru's really are amazing, and do a wonderful service here helping the community.
 
The below is what I think your looking for:
Code:
~ define a work variable of Valid Count
var ValidCnt as number

~ Set to initially a value of zero
ValidCnt = 0

~ If caster level 7+ and Spell Focus then we are valid
If (herofield[tMaxCaster].value >= 7) Then
   ~ we also need spell focus to be valid
   If (#hasfeat[fSpellFoc] <> 0) Then
      ValidCnt += 1
   Endif
Endif

~ If ability focus and Poison then we are also valid
If (#hasfeat[fAbilFoc] + #hasability[cPfDInPois] <> 0) Then
   ValidCnt += 1
Endif

~ If either test conditions above are VALID then we are valid
validif (ValidCnt > 0)

Note: Nowhere near HL so I did this off the top of my head and can't be 100% sure as I can't test it. But it should be right. Unless I mixed some other language into the script. :p :)
 
ShadowChemosh, you've got the second part saying "ability focus feat OR poison ability" (although fixing that's a simple matter of using nested "if" tests, like the first part).
 
You guys are awesome, Thank You so much, that solved the issue, there's a reason I refer to you guys as the Guru's. Thanks again, truly.
 
ShadowChemosh, you've got the second part saying "ability focus feat OR poison ability" (although fixing that's a simple matter of using nested "if" tests, like the first part).
Your right! Copy and paste is not always one's friend. :p :)

To make sure it is really AND and not OR do the following:
Code:
~ define a work variable of Valid Count
var ValidCnt as number

~ Set to initially a value of zero
ValidCnt = 0

~ If caster level 7+ and Spell Focus then we are valid
If (herofield[tMaxCaster].value >= 7) Then
   ~ we also need spell focus to be valid
   If (#hasfeat[fSpellFoc] <> 0) Then
      ValidCnt += 1
   Endif
Endif

~ If ability focus AND Poison then we are also valid
If (#hasfeat[fAbilFoc] <> 0) Then 
   If (#hasability[cPfDInPois] <> 0) Then
      ValidCnt += 1
   Endif
Endif

~ If either test conditions above are VALID then we are valid
validif (ValidCnt > 0)
 
Back
Top