• 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

Shield Focus from Mercenaries book

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.
 
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.
 
One point, I believe dodge bonuses do stack with themselves, so you wouldn't want to use the #applybonus macro here (that is for non stacking, use the highest type bonuses).
 
One point, I believe dodge bonuses do stack with themselves, so you wouldn't want to use the #applybonus macro here (that is for non stacking, use the highest type bonuses).

That's a good point. I always forget about that. Thanks. In that case, you could change the code to this:

Code:
if (hero.tagis[Hero.EquipShld] <> 0) then
 hero.child[ArmorClass].field[tACDodge].value += 1
endif
 
Back
Top