![]() |
Junior Member
Join Date: Feb 2012
Posts: 20
|
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! |
![]() |
![]() |
Junior Member
Join Date: Feb 2012
Posts: 20
|
No one?
|
![]() |
![]() |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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. |
![]() |
![]() |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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 by Aaron; October 15th, 2012 at 08:57 PM. |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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 also added protection encase the character does not have the Power Attack feat. Otherwise it would throw an error. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
![]() |
![]() |
Junior Member
Join Date: Feb 2012
Posts: 20
|
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!
|
![]() |
![]() |
![]() |
|
|