~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~ If no sorcerer class get out now
doneif (hero.childlives[cHelpSor] <> 1)
var n1 as number
var n2 as number
var n3 as number
var n4 as number
var n5 as number
var n6 as number
var n7 as number
var n8 as number
var n9 as number
~ Calculate spell bonus based on our Cha modifier
~ 1 + 0.25 * (ability modifier - spell level)
n1 = 1 + (0.25 * (#attrmod[aCHA] - 1))
n1 = round(n1,0,-1)
n2 = 1 + (0.25 * (#attrmod[aCHA] - 2))
n2 = round(n2,0,-1)
n3 = 1 + (0.25 * (#attrmod[aCHA] - 3))
n3 = round(n3,0,-1)
n4 = 1 + (0.25 * (#attrmod[aCHA] - 4))
n4 = round(n4,0,-1)
n5 = 1 + (0.25 * (#attrmod[aCHA] - 5))
n5 = round(n5,0,-1)
n6 = 1 + (0.25 * (#attrmod[aCHA] - 6))
n6 = round(n6,0,-1)
n7 = 1 + (0.25 * (#attrmod[aCHA] - 7))
n7 = round(n7,0,-1)
n8 = 1 + (0.25 * (#attrmod[aCHA] - 8))
n8 = round(n8,0,-1)
n9 = 1 + (0.25 * (#attrmod[aCHA] - 9))
n9 = round(n9,0,-1)
~ Known Spells is stored on an array on the Sorcerer Class
~ thing. So we need to modify the array values for each
~ spell level 1 through 9. We don't want to give bonus known for
~ levels we can't cast so first check to see if we can cast the
~ specific level first.
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[1] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[1] += n1
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[2] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[2] += n2
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[3] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[3] += n3
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[4] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[4] += n4
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[5] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[5] += n5
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[6] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[6] += n6
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[7] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[7] += n7
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[8] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[8] += n8
Endif
If (hero.child[cHelpSor].field[cCastMax].arrayvalue[9] <> 0) Then
hero.child[cHelpSor].field[cKnowMax].arrayvalue[9] += n9
Endif