Junior Member
Join Date: Dec 2009
Posts: 13
|
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? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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" Code:
eachpick.field[BonEnhance].value = maximum(eachpick.field[BonEnhance].value, 1) 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 |
#2 |
Junior Member
Join Date: Dec 2009
Posts: 13
|
That worked perfectly.
|
#3 |
|
|