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
Aleslammer
Junior Member
 
Join Date: Dec 2009
Posts: 13

Old February 5th, 2010, 07:05 PM
Im working on a class that has a special ability to imbue any normal melee weapon with a magical enhancement. So at a certain level any melee weapon he/she picks up is treated as a +1 weapon. Now if the weapon already has a +1 the two values dont stack.

Im thinking that all I have to do is use the #enhancementbonus[pick, bonus] macro. however I dont know how to find the currently equipped weapon. Or am I complely way off base here?
Aleslammer is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 8th, 2010, 04:00 PM
A weapon equipped in the primary hand will have field[gIsEquip].value = 1, and one equipped in the off hand will have field[wIs2nd].value = 1.

For abilities that apply to equipped things, like the Fighter's armor training abilities, I've actually preferred to apply the effects to everything a character is carrying - that way, you can compare thing A to thing B without having to unequip both or having to mentally calculate the differences that would be sue to that ability. So, I would recommend having this ability apply itself to all weapons, regardless of whether they're equipped or not.

You're on the right track with the #enhancementbons[] macro - that would work if you could target a specific weapon. Here's how to apply a change to many things:

A little bit below the #enhancementbonus[] macro description in the reference information page is the list of General Modifers - there you'll see that enhancement is BonEnhance.

You can search through all the things added to a character with a foreach loop:

Code:
 
foreach pick in hero from BaseWep where "wCategory.Melee"
That will find all the melee weapons, now for the enhancement bonus:

Code:
 
eachpick.field[BonEnhance].value = maximum(eachpick.field[BonEnhance].value, 1)
which will set the enhancement bonus of that weapon to the maximum of the Enhancement bonus that's already there or 1. That way, you handle stacking properly - if a weapon already has an enhancement bonus, nothing will be changed, so you don't have to search specifically for non-magical weapons.

Putting that together (and closing the foreach loop):

Code:
 
foreach pick in hero from BaseWep where "wCategory.Melee"
  eachpick.field[BonEnhance].value = maximum(eachpick.field[BonEnhance].value, 1)
  nexteach
Timing: Post-Levels/10000, the default timing for a class ability, should work in this case. If it doesn't, please tell me - I haven't tested this.
Mathias is offline   #2 Reply With Quote
Aleslammer
Junior Member
 
Join Date: Dec 2009
Posts: 13

Old February 12th, 2010, 08:05 PM
That worked perfectly.
Aleslammer is offline   #3 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 07:04 PM.


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