Thread: Arcane Thesis
View Single Post
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old July 9th, 2013, 05:30 AM
I did a quick search for that error message, and fortunately found another thread that covers it. I have updated the code to reflect the necessary change (change in bold)

Code:
~Set up variables
var id as string
var nlvl as number
var spell as string
var normLvl as number
var LvlRed as number
var strcom as string

~Exit if nothing chosen
doneif (field[fChosen].ischosen = 0)
doneif (isgizmo = 0)

~Set some things
id = field[fChosen].chosen.idstring
~the spell we're looking for, because it was chosen
spell = "thingid." & id
~the minimum level of the spell
normLvl=field[fChosen].chosen.field[sLevel].value
~we do not count Heighten in the entire calculation
strcom="Height"

~look through each spell memorized that matches chosen
foreach pick in hero where spell
LvlRed=0

~Goto the gizmos and look at the metamagics on them
foreach pick in eachpick.gizmo from BaseMetamg

~If it is not heighten (compare works like a child made it)
if (compare(eachpick.field[mmAbbr].text,strcom) <> 0) then
~Increase potential level reduction by 1
LvlRed += 1
endif
nexteach

~Once all metamagics have been looked at the new level is either the
~base level or newly adjusted level
nlvl=maximum(normLvl,eachpick.field[sLevel].value-LvlRed)

~Delete the tag (Important because the metamagic spell shows the
~field value while the tag is what the spell list uses).
perform eachpick.delete[sLevel.?]

~Set the field.
eachpick.field[sLevel].value=nlvl

~Set the correct tag
if (eachpick.field[sLevel].value = 0) then
 perform eachpick.assign[sLevel.0]
elseif (eachpick.field[sLevel].value = 1) then
 perform eachpick.assign[sLevel.1]
elseif (eachpick.field[sLevel].value = 2) then
 perform eachpick.assign[sLevel.2]
elseif (eachpick.field[sLevel].value = 3) then
 perform eachpick.assign[sLevel.3]
elseif (eachpick.field[sLevel].value = 4) then
 perform eachpick.assign[sLevel.4]
elseif (eachpick.field[sLevel].value = 5) then
 perform eachpick.assign[sLevel.5]
elseif (eachpick.field[sLevel].value = 6) then
 perform eachpick.assign[sLevel.6]
elseif (eachpick.field[sLevel].value = 7) then
 perform eachpick.assign[sLevel.7]
elseif (eachpick.field[sLevel].value = 8) then
 perform eachpick.assign[sLevel.8]
else
 perform eachpick.assign[sLevel.9]
endif
nexteach
You may also notice one other change. The function "result =" is obsolete and has been replaced with "perform". So, you can remove the "result as number" and replace all "result = " items in your script. Ultimately, this changes nothing, but its been pointed out to me so I am carrying that forward.

Incidentally, I tested this out on a CLR 2 WIZ 1. When I added the above doneif line, the cleric spells disappeared from the dropdown menu. This seems like a positive thing, but may be something to keep an eye on in case you use something other than a wizard.
Sendric is offline   #9 Reply With Quote