I am adding a feat that adds the AC bonus from a shield to the wielder's touch AC. I am using this script, which is a modified version of a script I found on this site:
When I equip a shield, my debug statements show me that the AC bonus is indeed being added to the hero's touch AC, but the change is not reflected in the display. I am sure this is a timing thing, but after trying all of them, I can't for the life of me figure out which phase/priority to use.
Help?
Code:
var bonus as number
~find all our shields
foreach pick in hero from BaseArmor where "EquipType.Shield"
~if it's equipped
if (eachpick.field[gIsEquip].value <> 0) then
bonus = eachpick.field[mAC].value
debug "Shield bonus = " & bonus
debug "Touch AC before = " & hero.child[ArmorClass].field[tACTouch].value
hero.child[ArmorClass].field[tACTouch].value += bonus
debug "Touch AC after = " & hero.child[ArmorClass].field[tACTouch].value
endif
nexteach
When I equip a shield, my debug statements show me that the AC bonus is indeed being added to the hero's touch AC, but the change is not reflected in the display. I am sure this is a timing thing, but after trying all of them, I can't for the life of me figure out which phase/priority to use.
Help?