How do I implement this: Use Intelligence or Charisma (the highest) for this power.
I tried basing it on this which was posted earlier
var bonus as number
var attidstr as string
~ Use Int as default - this might not be necessary
bonus = #attrbonus[attrInt]
attidstr = "attrInt"
~ Find highest bonus
foreach pick in hero from Attribute
if (eachpick.field[attrBonus].value > bonus) then
bonus = eachpick.field[attrBonus].value
attidstr = eachpick.idstring
endif
nexteach
~ Use that as the damage and attack attributes
perform assignstr["Attack." & attidstr]
My idea was to put into the foreach something like
if ((eachpick.idstring == "Charisma") || (eachpick.idstring == "Intelligence"))
but how is the correct syntax ???
Thanks in advance.
MagicSN
|