• 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

Racial special to give +1 to Shortspear

jbearwillis

Well-known member
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 :D
 
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.
 
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.
 
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
 
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.
 
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.
 
Back
Top