View Single Post
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old July 13th, 2015, 10:33 AM
Quote:
Originally Posted by DwarvenWiz View Post
Trying to code this feat and running into issues around how to reduce the AC penalty for shields by 1. Could anyone help this novice? I appreciate it!

+1 Dodge bonus to AC while carrying a shield.

AC penalty for the shield is reduced by 1 to no less than zero.
When a shield is equipped, the hero is given the tag "Hero.EquipShld". The feat can have a script on it that searches for this tag, and if present grants a +1 dodge bonus to AC:

Code:
if (hero.tagis[Hero.EquipShld] <> 0) then
 #applybonus[Dodge,hero.child[ArmorClass],1]
endif
I'm not sure at what point the tag is applied, so I'd set the timing to something like Post-Levels/10000 to start with and see if it works.

For the second part, I'm assuming you mean armor check penalty. For that, you'll need a foreach loop to look at all shields on the hero and reduce the penalty by 1. For this script, I'll assume the ability stacks with the reduction from the item being masterwork:

Code:
foreach pick in hero from BaseArmor where "EquipType.Shield"
 eachpick.field[mArmorChk].value = maximum(0,eachpick.field[mArmorChk].value-1)
nexteach
Not sure on the timing. Could try same as above. I haven't tested these scripts, but they should work for you. Let me know if you have any trouble.
Sendric is offline   #2 Reply With Quote