• 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

Using Favored enemy list for situational bonus

Brolthemighty

Well-known member
Alright, so a while back I put in a bug report on the Golden Legionnaire's ability Defy Danger. One of the options is to choose a type based on the Ranger's FE list, and you get +2 vs. their Sp's and Su's. Here's the relevant text from the pfsrd

A Golden Legionnaire gains a +2 bonus on saving throws against one of the following dangers: charms and compulsions, curses, diseases, fear, poisons, traps, or the innate magical powers (spell-like abilities and supernatural abilities not gained from class levels) of one creature type (and subtype, if applicable) chosen from the ranger favored enemy list. At 5th level, and again at 9th level, a Golden Legionnaire gains an additional +2 bonus against a different danger; alternatively, she may increase the bonus against a previously selected danger by +2.

The innate magical powers option is missing. Instead of waiting around for a fix, since this came out so long ago, I figured I would work on the coding...and I think I have most of it, I just can't figure out how it all goes together. Here is what I have:

~First we pick from the Favored Enemy list
component.BaseCustUs & !Helper.Secondary

First Eval
Render: 10,000, Index: 2

if (field[abValue].value <> 0) then
field[livename].text = field[thingname].text & " +" & field[abValue].value
#situational[hero.child[svAll], "+" & field[abValue].value & " vs. innate magical powers (Sp and Su abilities)", field[thingname].text]
field[abSumm].text = "+" & field[abValue].value & " to save vs. innate magical powers (Sp and Su abilities)
Endif


Second Eval
Post-Level, 10,000, Index 1

~see if a quickfind has been created by another copy of this ability
perform quickfind.setfocus

~if we didn't find a redirection, we're the first copy of this ability to run this script, so we'll make ourselves the FirstCopy.
if (state.isfocus = 0) then
perform quickadd
perform assign[Helper.FirstCopy]
~add +2 to our value
field[abValue].value += 2

~otherwise, redirect hero.child[] to the FirstCopy, and make us an upgrade
else
perform focus.redirect
perform assign[Helper.SpecUp]
~add +10 to the focus's value
focus.field[abValue].value += 2
endif

The problem is that I'm not sure how to plug in the FE selection in order to complete the situationals. It's been a while since I've worked with the editor...and I admittedly was never very good. Anyone want to help?
 
Code:
~First we pick from the Favored Enemy list
component.BaseCustUs & !Helper.Secondary
"Where" is this? I am going to assume you have this setup as the "Custom Expression". If so what do you have "Restrict First List To..." set too? It needs to be set for "All Things".

Then you need to pull the "field" name from what was chosen and append it into the situational text:
Code:
  #situational[hero.child[svAll], signed(field[abValue].value) & " vs. innate magical powers (Sp and Su abilities) of " & field[usrChosen1].chosen.field[name].text, field[thingname].text]
 
You'll actually want to use the shortname or else it'll say "Favored Enemy (xxxx)" in there where the short name will just say what the creature type is. Also if you can find a post between me and Aaron a year or 2 ago I was working on something similar and for the custom expression you'll need to debug a favored enemy and there is a component that is only on favored enemies and favored terrains. so the expression will be something like "component.xxx & !Helper.Secondary" which will elimate the terrains. It had a description involving user added something (I can't remember rightr now)
 
You'll actually want to use the shortname or else it'll say "Favored Enemy (xxxx)" in there where the short name will just say what the creature type is.
Good point! That would be a nice change. I didn't have time to look to see if "shortname" was actually filled in or not. :)


Also if you can find a post between me and Aaron a year or 2 ago I was working on something similar and for the custom expression you'll need to debug a favored enemy and there is a component that is only on favored enemies and favored terrains. so the expression will be something like "component.xxx & !Helper.Secondary" which will elimate the terrains. It had a description involving user added something (I can't remember rightr now)
Ummm that is above already in the post and I did a test Custom Ability that seems to be working just fine. So I am not sure if he filled in the custom expression correctly or forgot to set it to list "Things" and not "Picks".

Code:
component.BaseCustUs & !Helper.Secondary
 
I actually didn't know where to put that part. I had found it on the boards but didn't follow where it was needing put or what it was doing exactly.
 
Alright, so it looks like all of that work, for the most part. It brought up the FE list and made it selectable...and with the Eval script it will also add them together if the same FE is taken multiple times. However, when it adds, it still lists it twice. Here's the script I'm using to check and then add together.

~see if a quickfind has been created by another copy of this ability
perform quickfind.setfocus

~if we didn't find a redirection, we're the first copy of this ability to run this script, so we'll make ourselves the FirstCopy.
if (state.isfocus = 0) then
perform quickadd
perform assign[Helper.FirstCopy]
~add +2 to our value
field[abValue].value += 2

~otherwise, redirect hero.child[] to the FirstCopy, and make us an upgrade
else
perform focus.redirect
perform assign[Helper.SpecUp]
~add +10 to the focus's value
focus.field[abValue].value += 2
endif

And then under Abilities tab, when I hover over saves to show all the situationals it lists both selections...one at +4 the other at +0. All other choices add it together and only list once. Any idea what's missing?
 
And then under Abilities tab, when I hover over saves to show all the situationals it lists both selections...one at +4 the other at +0. All other choices add it together and only list once. Any idea what's missing?
Can you post your full latest script? That last post with the script has NO #situational[] macros. So that can't be the the one that is actually running.
 
Alright, so here's all the scripts I'm running

Render, 10000, Index 2
#situational[hero.child[svAll], signed(field[abValue].value) & " vs. innate magical powers (Sp and Su abilities) of " & field[usrChosen1].chosen.field[shortname].text, field[thingname].text]

Post-Level, 10000, Index 1
~see if a quickfind has been created by another copy of this ability
perform quickfind.setfocus

~if we didn't find a redirection, we're the first copy of this ability to run this script, so we'll make ourselves the FirstCopy.
if (state.isfocus = 0) then
perform quickadd
perform assign[Helper.FirstCopy]
~add +2 to our value
field[abValue].value += 2

~otherwise, redirect hero.child[] to the FirstCopy, and make us an upgrade
else
perform focus.redirect
perform assign[Helper.SpecUp]
~add +10 to the focus's value
focus.field[abValue].value += 2
endif

It also still registers as Favored Enemy: XX on the User Chosen selectable drop down list of all the FE's. I wasn't sure if that could be changed. Small thing really.
 
Last edited:
So my Render Script I wrote is a little different:
Code:
      ~ only process if we have a bonus
      if (field[abValue].value <> 0) then
        field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
        #situational[hero.child[svAll], signed(field[abValue].value) & " vs. innate magical powers (Sp and Su abilities) of " & field[usrChosen1].chosen.field[shortname].text, field[thingname].text]
        field[abSumm].text = "+" & field[abValue].value & " to save vs. innate magical powers (Sp and Su abilities)"
      Endif
I have it only giving the situational text when abValue is not zero. So this way I only ever run on the Pick that actually has the total bonus.
 
Back
Top