• 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

Trouble with Channel Energy

AndrewD2

Well-known member
I've got a class that gains channel energy, so I start by copying the clerics channel energy ability and changing the SpecSource tag listed to my classes helper cHelpDCh, and start by assigning it just that (there are other changes to come) so adding it at first level should give me channel energy like a cleric right? Well close, if I'm neutral or evil it still says "Channel Positive Energy"

I've got everything else working just fine, the alternate progression of dice, the change to d8s at level 20, but this is still baffling me.

My scripts are as follows

Post-Levels/1000
Code:
      ~only perform the calculations for the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

      ~ Set our name properly
      var v_turnname as string
      call cClrTurnNm
      field[livename].text = v_turnname

      ~ Add our cleric level to our turning level.

      ~ We need to add to our channeling only, since we no longer stack.
      var tagexpr as string
      tagexpr = "SpecSource.cHelpDCh"
      call ChanEnFind
      doneif (state.isfocus = 0)

      focus.field[abValue].value += field[xAllLev].value

      ~ We also need to add a Helper.ChannelPos or ChannelNeg depending on what
      ~ our alignment or the gods alignment. The cClrTurnNm assigned the
      ~ appropriate tag to this class special when it set the livename variable,
      ~ so forward that to the correct xChannel.
      perform focus.pushtags[Helper.Channel?]

Post-Attributes/10000
Code:
      ~only perform the calculations for the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

      ~we can turn undead 3 + CHA mod / day
      ~ We need to add to our channeling only, since we no longer stack.
      var tagexpr as string
      tagexpr = "SpecSource.cHelpDCh"
      call ChanEnFind
      doneif (state.isfocus = 0)

      focus.field[trkMax].value += 3 + hero.child[aCHA].field[aModBonus].value

Pre-Attribute/10000
Code:
   ~ We need to change the channeling dice to match the new progression
      var tagexpr as string
      tagexpr = "SpecSource.cHelpDCh"
      call ChanEnFind
      doneif (state.isfocus = 0)

    if (field[xAllLev].value >= 20) then
       focus.field[abValue2].value = 12
    elseif (field[xAllLev].value >= 18) then
       focus.field[abValue2].value = 11
    elseif (field[xAllLev].value >= 16) then
       focus.field[abValue2].value = 10	
    elseif (field[xAllLev].value >= 14) then
       focus.field[abValue2].value = 9
    elseif (field[xAllLev].value >= 12) then
       focus.field[abValue2].value = 8
    elseif (field[xAllLev].value >= 11) then
       focus.field[abValue2].value = 7
    elseif (field[xAllLev].value >= 10) then
       focus.field[abValue2].value = 6
    elseif (field[xAllLev].value >= 8) then
       focus.field[abValue2].value = 5
    elseif (field[xAllLev].value >= 6) then
       focus.field[abValue2].value = 4
    elseif (field[xAllLev].value >= 4) then
       focus.field[abValue2].value = 3
    elseif (field[xAllLev].value >= 2) then
       focus.field[abValue2].value = 2
    else
       focus.field[abValue2].value = 1
    endif


Render 10001
Code:
            ~ Set our name properly

      if (field[xAllLev].value >= 20) then
      var tagexpr as string
      tagexpr = "SpecSource.cHelpDCh"
      call ChanEnFind
      doneif (state.isfocus = 0)
      
      var v_turnname as string
      call cClrTurnNm
      focus.field[livename].text = v_turnname
      focus.field[sbName].text = focus.field[thingname].text

        ~append the damage to the name
        focus.field[livename].text &= " " & focus.field[abValue2].value & "d8"
        focus.field[sbName].text &= " " & focus.field[abValue2].value & "d8"
        if (focus.field[abValue3].value <> 0) then
           focus.field[livename].text &= signed(focus.field[abValue3].value)
           focus.field[sbName].text &= signed(focus.field[abValue3].value)
         endif
      endif

Thanks for any insight into this.

Andrew
 
Last edited:
I believe it has to do with the cClrTurnNm procedure. Instead of calling it, try setting the variables and tags as necessary. For reference, here is the contents of that procedure, so that you can adapt it to apply tags where necessary.

Code:
    ~ OUT: v_turnname, v_sbname
    var v_turnname as string
    var v_sbname as string

    v_turnname = 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] + tagis[Helper.ChannelPos] <> 0) then
      v_turnname &= "Channel Positive Energy"
      v_sbname = "channel positive energy"
      perform hero.assign[Hero.ChanPos]
      perform assign[Helper.ChannelPos]
    elseif (#levelcount[Antipal] + tagis[Helper.ChannelNeg] <> 0) then
      v_turnname &= "Channel Negative Energy"
      v_sbname = "channel negative energy"
      perform hero.assign[Hero.ChanNeg]
      perform assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpWaP].field[cClrTurn].value = -1) then
      v_turnname &= "Channel Negative Energy"
      v_sbname = "channel negative energy"
      perform hero.assign[Hero.ChanNeg]
      perform assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpWaP].field[cClrNeutGE].value = 1) then
      v_turnname &= "Channel Negative Energy"
      v_sbname = "channel negative energy"
      perform hero.assign[Hero.ChanNeg]
      perform assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpClr].field[cClrTurn].value = -1) then
      v_turnname &= "Channel Negative Energy"
      v_sbname = "channel negative energy"
      perform hero.assign[Hero.ChanNeg]
      perform assign[Helper.ChannelNeg]
    elseif (hero.childfound[cHelpClr].field[cClrNeutGE].value = 1) then
      v_turnname &= "Channel Negative Energy"
      v_sbname = "channel negative energy"
      perform hero.assign[Hero.ChanNeg]
      perform assign[Helper.ChannelNeg]
    else
      v_turnname &= "Channel Positive Energy"
      v_sbname = "channel positive energy"
      perform hero.Assign[Hero.ChanPos]
      perform 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 (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
 
Thanks Aaron, that helped a lot, took a little work but I think I've got it all figured out, just had to do it late enough so the call xChannel itself didn't overwrite anything (I think) but it appears to be working!
 
Back
Top