View Single Post
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 357

Old February 13th, 2020, 12:43 PM
I'm trying to program in a custom special but I can't get the code to work itself out properly

Code:
foreach pick in hero from BaseSkill
  if (eachpick.islinkage[skillattr] <> 0) then
    if (eachpick.linkage[skillattr].tagis[thingid.aCHA] + eachpick.linkage[skillattr].tagis[thingid.aINT] + eachpick.linkage[skillattr].tagis[thingid.aWIS] <> 0) then
      field[usrCandid1].text = "hero.child.[thingid.each]"
    endif
  endif
nexteach

var bonus as number
var pen as number
bonus = chosen.field[kModValue].value/4
bonus = round(bonus,0,-1)
pen = chosen.field[kModValue].value/2
pen = round(pen,0,-1)

if (field[hIsOn1].value <> 0) then
  foreach pick in hero from BaseWep where "thingid.wSwordBast | thingid.wShortswd"
    eachpick.field[wAttBonus].value += bonus
    chosen.field[aFinalVal].value -= pen
  nexteach
endif
You choose a mental-based skill. While active, you gain a bonus to attack equal to 1/4 the bonus while using katana or wakizashi (bastard sword or shortsword) but you also lose half the final value from that skill.
Illyahr is offline   #1 Reply With Quote