PDA

View Full Version : Dervish Dance


Tsujigiri
March 16th, 2010, 09:04 AM
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?

Mathias
March 17th, 2010, 09:12 AM
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:


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:

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:


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


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


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.

Tsujigiri
March 20th, 2010, 07:53 AM
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)