• 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

Dervish Dance

Tsujigiri

New member
I am attempting to create the Dervish Dance feat which allows your Dexterity to be applied to a scimitar instead of Strength for both attack and damage. With the way Weapon Finesse is structured I'm not sure how to go about doing this. Any ideas?
 
Weapons have the fields wAttBonus and wDam Bonus.

(In the editor, select the help menu, go to the "Reference Information" page, and then go to the weapons section to find things like this.)

So, what you want to do in your feat is to search for all Scimitars on the character:

Code:
foreach pick in hero from BaseWep where "IsWeapon.wScimitar"

For each of those fields, you want to subtract the strength modifier, and add the dex modifier, but only if dex is better than strength.

So, let's calculate that difference:
Code:
var bonus as number
bonus = maximum(#attrmod[aDEX] - #attrmod[aSTR], 0)

That will give you your DEX mod - your STR mod, but not let it go negative (so if STR > DEX, it will be 0).

Now, add that modifier to the attack and damage:

Code:
eachpick.field[wAttBonus].value += bonus
eachpick.field[wDamBonus].value += bonus

Here's all that assembled, with the foreach properly closed:

Code:
var bonus as number
bonus = maximum(#attrmod[aDEX] - #attrmod[aSTR], 0)
 
foreach pick in hero from BaseWep where "IsWeapon.wScimitar" 
  eachpick.field[wAttBonus].value += bonus
  eachpick.field[wDamBonus].value += bonus
  nexteach

Now, for the timing - we're working with the attribute modifiers, which means we can't put it earlier than the Post-Attributes phase. The priority within the Post-Attributes phase shouldn't matter, so you can leave that at 100.
 
Thank you so much for your response, worked like a charm (and thank you for explaining it piece by piece, it goes a long way towards my understanding the scripting mechanisms in Hero Lab)
 
Back
Top