Manalishi66
Well-known member
How do you add a bonus (attack and/or damage) to one singular weapon (not all weapons or groups). Such as a class gets a +1 damage bonus with his dagger (only) per 3 levels?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The concept is exactly the same use of a "foreach" loop regardless if its a "group" of weapons or a single weapon. So see THIS post which shows how to do it for a weapon group.How do you add a bonus (attack and/or damage) to one singular weapon (not all weapons or groups). Such as a class gets a +1 damage bonus with his dagger (only) per 3 levels?
So the above is still 99% of what you need. The only difference is you need to pull the "thingid.?" tag directly from what was chosen.Ok. Got how to add bonus as you described. But I want to allows the class to choose his weapon (any) and have this bonus only apply to the one weapon from the list.
~ If we have not chosen then get out now
doneif (field[usrChosen1].ischosen <> 1)
var search as string
~ Get the weapons thing id TAG
search = field[usrChosen1].chosen.tagids[thingid.?]
You seemed to have skipped this step. Its kind of important.In the above post replace the whole "ENTER YOUR SEARCH TAGS HERE" including the double quotes with the variable search. As instead of a hard-coded string we are using a variable.
You have to combine the two script examples together into a single one.Ok. I admit I'm green at this, what do I need to fix. i.e., what is the script that I need to make it work.
[COLOR="Green"][B]~ If we have not chosen then get out now[/B][/COLOR]
doneif (field[usrChosen1].ischosen <> 1)
var search as string
[COLOR="Green"][B]~ Get the weapons thing id TAG[/B][/COLOR]
search = field[usrChosen1].chosen.tagids[thingid.?]
[B][COLOR="Green"]~ Loop through all weapons of the chosen type[/COLOR][/B]
foreach pick in hero from BaseWep where search
[B][COLOR="Green"]~ Set the bonus on each weapon found[/COLOR][/B]
eachpick.field[Bonus].value += 1
nexteach