Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
I am trying to make a racial special that gives a +1 to both to Hit and damage that only work on a Shortspear and also if that character gets a magic shortspear, that it will automatically apply to it as well. Any help would be appreciated. Thanks JBear
|
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Assuming the bonus is untyped, you'll want to foreach through all weapons on the hero with the IsWeapon.wShortspr tag, and then add +1 to the Bonus field on each pick.
|
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Just to build on that with some examples see THIS thread with the only difference is you won't care if the weapon is equipped or not. And see THIS thread where I show how to change a Rapier to use Dex for damage. Both are examples of using the "foreach" that Aaron is talking about.
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. |
#3 |
Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
This is what I came up with and it worked - Thanks again
Pre-Levels 10000 ~ If we're disabled, do nothing doneif (tagis[Helper.FtDisable] <> 0) foreach pick in hero from BaseWep where "thingid.wShortspr" if (eachpick.tagis[IsWeapon.wShortspr] <> 0) then eachpick.field[Bonus].value += 1 endif nexteach |
#4 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
The if statement is more than you need, you should put the IsWeapon.wShortspr where you have "thingid.wShortspr" then it'll cover weapons that count as short spears too, but the "where" part of the foreach statement is like saying "if (tagis[xxx] <> 0) for each thing in the script listed there.
|
#5 |
Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
Gotcha, Thanks AndrewD2. LOL - I was playing around with it way to long and when I got it to work, I was so damn happy. I didn't think to clean it up.
|
#6 |
|
|