• 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

Racial Channel Negative Energy

AndrewD2

Well-known member
I've got a template that gives channel negative energy. In fact it's figured just like the Nightshade subtype. The nightshade uses two scripts on a racial ability to generate this.

Code:
Post-Levels 1000
      var tagexpr as string
      tagexpr = "SpecSource.stNightsha"
      call ChanEnFind
      doneif (state.isfocus = 0)

      ~ Add our CR to our turning level.
      focus.field[abValue].value += hero.findchild[BaseRace].field[rCR].value

AND

Code:
Post-Attributes/10000
      var tagexpr as string
      tagexpr = "SpecSource.stNightsha"
      call ChanEnFind
      doneif (state.isfocus = 0)

      ~we can turn undead 3 + CHA mod / day
      focus.field[trkMax].value += 3 + #attrmod[aCHA]

I copied this and I'm sure my problem is the SpecSource but I'm not sure what to put there. The Nightshade uses the subtype so I used the template and I've used the racial ability id there, but neither is working.

Is there something I'm missing?

Thanks,
Andrew
 
Make sure that when bootstrapping the xChannel pick, you give it the same SpecSource tag you have in the tagexpr string variable.
 
Well it seems to be showing up in the Background tab, but it's not adding to the trkMax field so it's not showing up in the specials tab or in-play
 
I think I may have found a bug because if I had something with the Nightshade subtype it shows up twice then and still says the specSource is stNightshade even though I changed it.

EDIT: Well I tested again and it disappeared, but no matter what SpecSource I use that's on the hero it's not showing up.
 
Last edited:
If you have the nightshade subtype, that grants you a separate channel from whatever it is you are making, so it makes sense there would be two.

Why don't you send me the file and I'll take a look at it.
 
Alright, it looks to be working correctly to me when added to any monstrous race with a CR. I think the issue is probably one of testing, as this line:

Code:
focus.field[abValue].value += hero.findchild[BaseRace].field[rCR].value

means that if you add the template without a race, or to a race with no CR value, then the xChannel gets nothing added to the abValue field. In this case, abValue is the effective Cleric level of the channeling, and if there is nothing there then an eval script hides the special.

So in this case, I think you may want to set the value added to something else or else add some more eval scripts to manually re-set the values and un-hide the xChannel pick. (The script which hides it runs at Post-Attr 10001, so your scripts to unhide it would need to apply Helper.ShowSpec after that).

Hope that helps!
 
Well the actual code in the file I sent you has abValue set to herofield[tCR].value instead of base race because I need to account for the CR added by the template. I tried assigning Helper.ShowSpec and it still doesn't show up for me.
 
I just want to get this right, you're saying you added my template and everything showed up on a race that had a CR value?
 
I've manually set all the abValues on xChannel and it still doesn't show up. I guess I'll try bootstrapping it straight to the template.
 
tCR isn't set by the time that script is running, but it seems to be 1 when I add the template to a Ghoul (probably due to the template adding +2).

Move this script from Post-Level 1000 to Final 11000 (which is after tCR is calculated)
Code:
      var tagexpr as string
      tagexpr = "SpecSource.tmRPDarkse"
      call ChanEnFind
      doneif (state.isfocus = 0)

      ~ Add our CR to our turning level.
      focus.field[abValue].value += herofield[tCR].value

Then add a 3rd eval script that runs after that, at Final 12000

Code:
      var tagexpr as string
      tagexpr = "SpecSource.tmRPDarkse"
      call ChanEnFind
      doneif (state.isfocus = 0)

      ~First unhide us.
      perform focus.delete[Helper.SpecUp]
      perform focus.delete[Hide.Special]
      perform focus.assign[Helper.ShowSpec]
      perform focus.assign[User.Tracker]

      ~Now re-do the calculations normally done by xChannel, and overwrite those results

    ~ This mimics the CalcValue procedure
    ~our value could be set in three different ways - an abValue field value
    ~that was set by a script or bootstrap assignment, an abUserVal field value
    ~that was set by the user, or Value tags that were set by a script or in a
    ~bootstrap.
    
    ~we'll use the maximum among all of those possibilities
    focus.field[abValue].value = maximum(focus.field[abValue].value, focus.tagmax[Value.?])
    focus.field[abValue].value = maximum(focus.field[abValue].value, focus.field[abUserVal].value) + focus.field[abAdd].value
    
    if (focus.field[abValue].value > 0) then
      focus.field[abValue].value += focus.field[abImprove].value
      endif
    
    ~ This mimics the ValueShow procedure
    ~ If we have a value of 0, hide ourselves
    if (focus.field[abValue].value = 0) then
      perform focus.delete[Helper.ShowSpec]
      perform focus.delete[User.Tracker]
      perform focus.delete[User.Activation]
      perform focus.assign[Hide.Special]
      done
      endif
      
    ~ This mimics the cClrTurnNm procedure
    var v_turnname as string
    
    v_turnname = focus.tagnames[SpecSource.?,"/"] & " "
    
    ~ I'm also having the procedure assign the Helper.ChannelPos/ChannelNeg tags
    ~ to itself, so that for classes which do not bootstrap xChannel with this 
    ~ tag already (like Cleric, where it depends on the god), they can forward 
    ~ the assigned tag to the appropriate xChannel pick

    if (#levelcount[Paladin] + #hasability[cOraChan] + focus.tagis[Helper.ChannelPos] <> 0) then
      v_turnname &= "Channel Positive Energy"
      perform hero.assign[Hero.ChanPos]
      perform focus.assign[Helper.ChannelPos]
    elseif (#levelcount[Antipal] + focus.tagis[Helper.ChannelNeg] <> 0) then
      v_turnname &= "Channel Negative Energy"
      perform hero.assign[Hero.ChanNeg]
      perform focus.assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpClr].field[cClrTurn].value = -1) then
      v_turnname &= "Channel Negative Energy"
      perform hero.assign[Hero.ChanNeg]
      perform focus.assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpClr].field[cClrNeutGE].value = 1) then
      v_turnname &= "Channel Negative Energy"
      perform hero.assign[Hero.ChanNeg]
      perform focus.assign[Helper.ChannelNeg]
    else
      v_turnname &= "Channel Positive Energy"
      perform hero.Assign[Hero.ChanPos]
      perform focus.assign[Helper.ChannelPos]
      endif
    
    ~ if we have flexible channeling, assign whichever positive/negative tag we
    ~ didn't already have, so we count properly for prereqs.
    if (focus.tagis[Hero.ChanFlex] <> 0) then
      v_turnname = "Versatile " & v_turnname
      if (hero.tagis[Hero.ChanNeg] = 0) then
        perform hero.assign[Hero.ChanNeg]
        endif
      if (hero.tagis[Hero.ChanPos] = 0) then
        perform hero.assign[Hero.ChanPos]
        endif
      endif

   ~Now pick up the eval script after the procedure calls
      focus.field[livename].text = v_turnname

      ~we do 1d6 per 2 effective levels + 1
      focus.field[abValue2].value += round(focus.field[abValue].value / 2,0,1)

      ~append the damage to the name
      focus.field[livename].text &= " " & focus.field[abValue2].value & "d6"

      ~ And any bonuses to the damage, if we have any
      doneif (focus.field[abValue3].value = 0)

      focus.field[livename].text &= signed(focus.field[abValue3].value)
 
Wow, thanks Aaron. Also good to know the tCR is calculated before Final 11000, so that tells me some other scripts I probably need to change.

I had no idea it would be that complex to get this working.
 
Back
Top