So I was wanting to try and duplicate the Oath Against Chaos Paladin's Smite Chaos in order to learn some things about how it works. Unfortunately, it seems like it just... doesn't work when replicated?
My current issue is the fact that, according to the Oath Against Chaos archetype, it grabs cSmiteCha multiple times at specific levels. When I replicated that, alongside a direct copy of the eval scripts for Smite Chaos, it works when one instance of Smite Chaos exists at all, but then breaks if there's more than 1. As far as I'm aware I'm duplicating the archetype as-is when it comes to Smite Chaos and how it implements it, but as soon as I put in a second instance on the chain, it breaks.
Can someone explain what's going wrong here? Below is the code, as taken from a "New (Copy)" of cPalSmiCha.
Code:
field[listname].text = "Smite Chaos (" & field[xIndex].value & "/day)"
~only run the rest for the first copy
doneif (tagis[Helper.FirstCopy] = 0)
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)
~ Generate our damage bonus
field[abValue].value += field[xAllLev].value
~ Generate our to-hit and AC bonuses
field[abValue2].value += maximum(hero.child[aCHA].field[aModBonus].value,0)
field[abValue3].value += maximum(hero.child[aCHA].field[aModBonus].value,0)
field[abSumm].text = signed(field[abValue2].value) & " to hit, " & signed(field[abValue].value) & " to damage, " & signed(field[abValue3].value) & " deflection bonus to AC when used."
if (field[abilActive].value + field[abilAct2].value <> 0) then
hero.child[Damage].field[Bonus].value += field[abValue].value
hero.child[Attack].field[Bonus].value += field[abValue2].value
#applybonus[tACDeflect, hero.child[ArmorClass], field[abValue3].value]
~ if the target is an evil dragon, evil outsider, or undead, add the
~ damage bonus again
if (field[abilAct2].value <> 0) then
hero.child[Damage].field[Bonus].value += field[abValue].value
endif
endif