Member
Join Date: Aug 2011
Posts: 73
|
Using the code below does anyone know how to access the enhancement bonus of each weapon? For example, if the pick is a +3 longsword I want to pull the "+3" from the data.
var EnhBonus as number foreach pick in hero from WeapMelee EnhBonus = eachpick.field[??????].value nexteach |
#1 |
Senior Member
Join Date: Nov 2012
Posts: 208
|
Quote:
Alternatively (if you know what type of weapon this is) you might check for relevant thingid's (admitted, this would be an extremely clunky and badly maintenancable way of handling this) Best regards, MagicSN |
|
#2 |
Member
Join Date: Aug 2011
Posts: 73
|
I know it's been a while but I'm back to working on the inherent attack bonus script. Here is what I have:
~Inherent Attack Bonus var AttBonus as number var BonusDif as number if (#level[] < 2) then AttBonus = 0 elseif (#level[] < 7) then AttBonus = 1 elseif (#level[] < 12) then AttBonus = 2 elseif (#level[] < 17) then AttBonus = 3 elseif (#level[] < 22) then AttBonus = 4 elseif (#level[] < 27) then AttBonus = 5 else AttBonus = 6 endif ~doneif (tagis[Equipped.Equipped] = 0) foreach pick in hero from WeapMelee perform eachpick.field[wpDamage].modify[+,AttBonus,""] perform eachpick.field[wpBonus].modify[+,AttBonus,""] nexteach foreach pick in hero from WeapRange perform eachpick.field[wpDamage].modify[+,AttBonus,""] perform eachpick.field[wpBonus].modify[+,AttBonus,""] nexteach This works fine as long as you don't add an actual magic weapon. I need a way to get the wpBonus of the current pick and then compare it to the AttBonus do determine wich bonus to use in the modify section. I have tried the following: CurrentValue = eachpick.field(wpBonus) CurrentValue = eachpick.field(wpBonus).value Neither worked. Does anyone know how to get or reference that value inside the foreach loop? Thanks |
#3 |
|
|