Applying different modifier to attack rolls
I'm trying to swap the Dex mod for the Wis mod on all ranged attack rolls but
I can't find any code examples that show how to implement this. The modifier will be applied by a feat and not a class. The weapon finesse feat seems to be similar but that only applies to light weapons and doesn't actually alter the attack bonus, I think it relies on the player to remember it. Any ideas? |
I am doind a similar feat called Brutal Throw. The only problem is I don't know how to say "not" in the Foreach statement.
foreach pick in hero where "wCategory.RangeThrow and not wCategory.Melee" "&" is and, "|" is or, what is not? |
Here is my example code, for reference
~ If our dexterity bonus is higher than our strength bonus, do nothing and get out now. var dexterity as number var strength as number dexterity = hero.child[aDEX].field[aModBonus].value strength = hero.child[aSTR].field[aModBonus].value if (dexterity >= strength) then done endif ~ Since our Strength is higher than our dexterity and we passed, iterate through all weapons which are thrown, and subtract dexterity and add strength instead to our attack rolls. foreach pick in hero where "wCategory.RangeThrow Missing stuff here" each.field[wAttBonus].value = each.field[wAttBonus].value - dexterity + strength nexteach |
Zen archery is the feat i'm looking at complete warrior page 106.
I think your on the right track with this though. If you look at this thread http://forums.wolflair.com/showthrea...=graceful+edge it contains a custom expression that ignores specific weapons and kind of explains the usage of the & tags. I think [wCategory.Range?] ignores anything that doesn't have a specific range increment. I don't know if that will give you any pointers for your code Lawful_g. |
Quote:
foreach pick in hero where "wCategory.RangeThrow & !wCategory.Melee" just a note - that expression's not going to find javelins and daggers. |
Quote:
Code:
var bonus as number Your code was fine, except that you should be using eachpick. instead of each. within your foreach loop (the other will still work, but only because the program still supports legacy code). |
Quote:
Range increment is wRangeInc. |
Because of the way the tags work now, any weapon that has both the melee and throwing tag (like javelins and daggers) already uses Strength to determine it's attack roll (assuming by default that they are wielded in melee and ignoring the possibility of using them as ranged weapons, especially incorrect for javelins because they should be taking a penalty for melee use but are not). I think I have mentioned this error before.
Anyway, I have worked around this by creating custom Throwing versions (IE Dagger, Throwing) of those weapons with the projectile and throwing tags so that they correctly use Dex for attack rolls and Str for damage rolls. |
Thanks for the "!" trick mghel, that should be helpful in the future.
|
I can't get this code to apply the Wisdom Modifier to ranged attacks i've tried altering the timing but to no avail.
Timing final phase 10000 Code:
var bonus as number |
All times are GMT -8. The time now is 12:09 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.