• 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

Help With New Exotic Weapon, Please

Maidhc O Casain

Well-known member
I'm making an exotic weapon that grants shield bonuses like the Two-Weapon Defense feat when it's equipped. Adding the bonuses was easy - I just grabbed the relevant portions of the eval-script from the feat. What I can't figure out is how to make those bonuses apply only when the weapon is equipped.

I first looked at the Masterwork Backpack for clues, and tried using

if (field[gIsEquip].value <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 1]
endif

That turned the benefit off, whether the weapon is equipped or not. I also tried

doneif (field[gIsEquip].value = 0)

with the same result.

I then tried using the "Activated.wXXXX" tag the same ways, with identical results. I used Phase: Pre-Attributes (Users) and Priority 10000.

I'm completely stymied. Am I on the right track with either of these? Is it a Phase/Priority problem?
 
I'd try approaching this from a different direction than the two-weapon defense feat - how about the Scizore weapon from AA? That grants a shield bonus to AC.
 
OK, I see how that's working - make a separate version of the item as a Shield under the Armor tab, and bootstrap it to the weapon. Then rather than the bonus being activated whenever the weapon is equipped, you just equip it as a shield as well.

So I made the shield version, added the script for the extra shield bonus when fighting defensively or using total defense and got it bootstrapped to the weapon version.

But I can't get the item to show up as a shield as well unless I add the 'Displace' tag to the bootstrap, which causes a validation error. This may be because the weapon I'm making is always used 2 handed, so HL thinks I'm trying to equip a shield and a 2 handed weapon at the same time.
 
Correct - the displace tab is essential for the shield to show up properly, but could you be more specific about how the Displace tag is causing a validation error?
 
Sorry, my sentence structure inaccurately expressed my thought. It's (probably) not the Displace tag that causes the error; it's the fact that my weapon is a two handed one, so when I equip it both as a weapon and as a shield I get the "Can't have off-hand weapon with this shield" error.

I classified the weapon as two handed. It's actually two separate weapons much like Kama, but that's just flavor; it's always used in pairs and only allows one attack/damage roll. So mechanically it works just like a two handed weapon. It's an exotic weapon because it grants the +1 shield bonus (+2 when fighting defensively or using total defense) just as though the wielder has the two-weapon defense feat. So unlike the Scizore or the Klar, you don't have to give up your attack to get the shield bonus.
 
Okay. The Scizore/Klar's use of a shield is so that they can implement their rule that you can either have the attack or the AC bonus, so we'll ditch the shield option.

Have you tested that original script without trying to add an if/then? Can you affect the AC at all?

One note for turning it into a two-handed weapon - by making them two-handed, you will get the STR * 1.5 benefit that other two-handed weapons get.
 
Taking the appropriate part of the eval script from the Two-Weapon Defense feat results in the correct boost in AC. The portion of the script that increases the bonus by one for fighting defensively/total defense also works.

But the bonuses are granted simply for having the weapon in the inventory - I don't have to actually equip it. To get the bonus I should have to have the weapon in hand.

I took care of the added STR bonus via the "Never Increase Strength Bonus" check box.
 
Yes, I knew it would be active once it got to your inventory, not just while equipped. From the original script, I couldn't tell if the problem was in the AC portion of the script or in the on/off portion of the script. Now that we know where the problem is, we can concentrate on the part where the problem is.

Just to double-check - you're testing this in a simple case - as a weapon on its own, and not trying to introduce the complexities of dealing with a Custom/Magic Weapon right?
 
Why don't you copy down your entire script exactly as it appears. I just tried copying the portion of your script that you've posted in your first post into a test weapon, and it worked fine.
 
Very strange - since you indicated that it was working, I went back and put that if/then that I posted first and it did work. It does not work with a masterwork version of the weapon, though.

I know I was using a normal weapon when I was making the scizore version; it's entirely possible I was jumping the gun and using a masterwork version to test my original tries. Apologies for that.

OK, so that first if/then works with the regular version of the weapon. Now how do I go about making it work with the masterwork/special material/bonded item versions?

Here's the script I'm using in its entirety (Phase: Post-Attributes (Users), Priority 10000):

~ If we're equipped, add a +1 Shield bonus to our AC
if (field[gIsEquip].value <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 1]
endif

~ If we're in output mode, don't do anything
doneif (state.isoutput <> 0)

~ If we're fighting defensively or total defense, the shield bonus increases to +2
if (#hascondition[pstFtDefen] + #hascondition[pstTotDef] <> 0) then
if (field[gIsEquip].value <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 2]
endif
endif

I wasn't sure what the 'output mode' portion of the script accomplished, but since it was in the original version of Two Weapon Defense I kept it.
 
Last edited:
Have you looked at other weapons with scripts? The lance, for example? There's a special way you have to reference things while a weapon is within a Custom/Magic weapon.

If you accidently left Total defense active at the end of a fight, and before the next fight you re-print your character sheet, do you want to see the effects of Total Defense? The printout is for the base version of the character, so all the things in the condtion tab turn off their effects when you're printing your character or a statblock.

Those feats like two-weapon defense that depend on conditions should also check the same thing - otherwise, you'd add the benefits of the feat while fighting defensively, without the AC bonus of fighting defensively itself.
 
OK, I think I've got it. I added the condition for the weapon being magic, and also cleaned up my original script a little to make it more elegant.

This seemed to work in my test - could you take a look and see if I covered everything?

~ If we're equipped, add a +1 Shield bonus to our AC
if (field[gIsEquip].value <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 1]

~ If we're in output mode, don't do anything
doneif (state.isoutput <> 0)

~ If we're fighting defensively or total defense, the shield bonus increases to +2
if (#hascondition[pstFtDefen] + #hascondition[pstTotDef] <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 2]
endif
endif

~ If we're a magic weapon, modify our parent instead
if (container.ishero = 0) then

if (container.parent.field[gIsEquip].value <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 1]

~ If we're in output mode, don't do anything
doneif (state.isoutput <> 0)

~ If we're fighting defensively or total defense, the shield bonus increases to +2
if (#hascondition[pstFtDefen] + #hascondition[pstTotDef] <> 0) then
#applybonus[tACShield, hero.child[ArmorClass], 2]
endif
endif
endif
 
You said this weapon was two-handed. If it weren't - if it could be wielded in the off-hand, you'd also need to check if it was equipped in that hand:

Code:
field[gIsEquip].value + field[wIs2nd].value <> 0
and

Code:
container.parent.field[gIsEquip].value + container.parent.field[wIs2nd].value <> 0

So, something to remember for next time.
 
Back
Top