Not fixed in 4.2
For more info, I have two items:
1) An item grants +1 insight bonus to AC (which does add to CMD)
2) An item grants +2 insight bonus to CMD and CMD.
The +1 Insight AC doesn't stack with the +2 CMD (or shouldn't)
My current code is like this:
if (field[gIsEquip].value <> 0) then
~ Add +2 Insight bonus to CMB/CMD
if (hero.child[Maneuver].field[BonInsight].value < 2) then
hero.child[Maneuver].field[tCMB].value += 2 - hero.child[Maneuver].field[BonInsight].value
#applybonus[BonInsight, hero.child[Maneuver], 2]
endif
endif
With this code (the extra if to add to tCMB) is required to modify CMB.
But my CMD isn't correct. It adds the +1, but the item with the applybonus above doesn't add a second one to CMD?
Am I just doing it wrong?
All the AC bonuses that apply to CMD are being put into the tManAC field. Since a BonInsight added to the Maneuver pick in general is an insight bonus to both CMD and CMB, there's not currently a way to make the AC bonuses and CMD bonuses stack properly.
I think you might be able to do it by subtracting hero.child[ArmorClass].field[BonInsight].value from hero.child[Maneuver].field[tManAC].value and then applying the insight bonus to maneuvers.
Try Post-Attributes/16000 (or 14000 for that script)
I'll put the underlying problem on my to-do list.