• 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

Custom feat

huntercc

Well-known member
I have a custom feat that grants +1 Morale Bonus to Melee Attack & Damage rolls. What script could I use to implement this?
 
In the editor, press the help button. You'll be taken to the editor help page. Scroll down there to the "Reference Information" page. Scroll down until you come to the #applybonus[] macro - you'll be using that.

Now, scroll down some more to the "General Modifiers" section - you'll see that morale bonuses are "BonMorale"

Scroll down some more to the "Attack Bonus" section - it tells you that Attack is hero.child[Attack].

So, putting those three things together,

#applybonus[BonMorale,hero.child[Attack],3] will give you a +3 morale bonus to attack.

Scroll down to the D's to find "Damage Bonus" - note that unlike attack, damage doesn't allow the generic modifiers - this is a bug that just hasn't been worth the trouble to fix yet.

Since you can't set a morale bonus to damage, you'll set a generic bonus, using the damage pick's wDamBonus field.

hero.child[Damage].field[tDamBonus].value += 3 will add a +3 generic bonus to damage.
 
Thanks, but doesn't that grant this bonus to all attacks & damage rolls? My custom feat applies only to melee attacks & damage rolls.
 
Oops, missed seeing the melee part.

In that case, the best way to handle it is probably to search through all the weapons, looking for those that are melee weapons and apply the bonus to weapon-specific fields on the weapons. Unfortunately, it's not a morale bonus, but hopefully you won't have to worry about the bonus stacking.

foreach pick in hero from BaseWep where "wCategory.Melee"
eachpick.field[wAttBonus].value += 3
eachpick.field[wDamBonus].value += 3
nexteach
 
Last edited:
Thanks - it was the melee part that was giving me trouble!

Just one thing to point out - in your script, you end the "foreach" with "endif" instead of "nexteach"
 
Back
Top