Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
huntercc
Senior Member
 
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213

Old November 5th, 2009, 07:46 AM
I have a custom feat that grants +1 Morale Bonus to Melee Attack & Damage rolls. What script could I use to implement this?
huntercc is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old November 5th, 2009, 08:19 AM
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.
Mathias is online now   #2 Reply With Quote
huntercc
Senior Member
 
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213

Old November 5th, 2009, 09:06 AM
Thanks, but doesn't that grant this bonus to all attacks & damage rolls? My custom feat applies only to melee attacks & damage rolls.
huntercc is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old November 5th, 2009, 09:32 AM
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 by Mathias; November 5th, 2009 at 04:04 PM. Reason: fixed a typo - thanks huntercc for pointing it out.
Mathias is online now   #4 Reply With Quote
huntercc
Senior Member
 
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213

Old November 5th, 2009, 04:02 PM
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"
huntercc is offline   #5 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:51 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.