• 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

Magic Item That Adds to Power Attack

CSDeeds

Member
Okay, so I'm trying to recreate an old magic item from 3.5 that added to damage when you used Power Attack. Playing with things I came up with this script:

if (field[gIsEquip].value <> 0) then

~Add two damage if Power Attack is active
if (hero.childfound[fPowerAtt].field[abilActive].value <> 0) then
hero.child[Damage].field[tDamPower].value += 2
endif
endif

It almost works...but when using a weapon two-handed the bonus increases to +3. Obviously this isn't what I intended even if Power Attack itself scales like that. Played with some tags and such but can't seem to get it to work right. Any help would be greatly appreciated!
 
Sorry! Slipped by me.

I would recommend doing a foreach through the weapons if the Power Attack feat is activated, and adding to each weapons damage bonus field.
 
Here is an example script, it's not tested, so you should make sure to test it and refine it.

Code:
doneif (field[gIsEquip].value = 0)

doneif (hero.childfound[fPowerAtt].field[abilActive].value = 0)

foreach pick in hero from BaseWep where "wCategory.Melee"
   eachpick.field[wDamBonus].value += 2
   nexteach
 
Last edited:
Code:
~ If not equipped just get out now
doneif (field[gIsEquip].value <> 1)
~ If we don't have Power Attack feat get out now
doneif (hero.childlives[fPowerAtt] <> 1)

~ Add +2 too damage if Power Attack is active
if (hero.childfound[fPowerAtt].field[abilActive].value <> 0) then
   hero.child[Damage].field[Bonus].value += 2
endif
I am thinking you just need to change it to use "Bonus" instead of the Power Attack damage "tDamPower" field. As the Power Attack damage will be increased when using 2H weapons where Bonus is just going to give a straight bonus.

I also added protection encase the character does not have the Power Attack feat. Otherwise it would throw an error.
 
Thanks so much to both of you! After some testing Aaron's script looks like it works fine. If I run into any trouble with it down the road I'll try ShadowChemosh's. Thanks again!
 
Back
Top