I'm working on a 3.5 spell adjustment for wild shape. I've figured out how to handle natural armor and weapons, but I'm struggling with adjusting the ability scores.
3.5 wild shape specifies that magic items (such as a Belt of Giant's Strength) stop functioning when you're in wild shape, and that the STR/DEX score gets replaced with that of the animal. So I thought I could just do something like this as an eval script:
This compiles fine. I set up a suitable test hero with a STR of 8, and ran it. I figured 11 - 8 = 3, so it would apply a bonus of 3 to the score, bringing it up to 11.
What actually happened is that it applied a bonus of 11 to the score, raising it to 19. My theory is that I'm not getting the current STR correctly. The "hero.child[aSTR].field[aFinalVal].value" bit appears to be evaluating to zero.
Also, I have no idea if the #applybonus macro will work with a negative number, as might happen if I were shifting form to something tiny.
3.5 wild shape specifies that magic items (such as a Belt of Giant's Strength) stop functioning when you're in wild shape, and that the STR/DEX score gets replaced with that of the animal. So I thought I could just do something like this as an eval script:
Code:
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)
var adjustment as number
~ The first number is the target ability score.
adjustment = 11 - hero.child[aSTR].field[aFinalVal].value
~ Apply the adjustment.
#applybonus[Bonus, hero.child[aSTR], adjustment]
This compiles fine. I set up a suitable test hero with a STR of 8, and ran it. I figured 11 - 8 = 3, so it would apply a bonus of 3 to the score, bringing it up to 11.
What actually happened is that it applied a bonus of 11 to the score, raising it to 19. My theory is that I'm not getting the current STR correctly. The "hero.child[aSTR].field[aFinalVal].value" bit appears to be evaluating to zero.
Also, I have no idea if the #applybonus macro will work with a negative number, as might happen if I were shifting form to something tiny.