You mention you are trying to use the Shadowcaster IDEA, but that is a class (that I am not familiar with) that has several abilities. Since I doubt you are trying to make one ability do EVERYTHING that the class does, I need to know which PIECE of the CLASS you are trying to work on. (Again, pasting the description text of the ability is your best bet to get ideas.)
For now, let's look at the code you provided.
field[abValue2].value = hero.child[cHelpWiz].field[cMaxSpLev].value
field[abValue3].value = field[abValue2].value
field[abValue4].value = 0
field[abValue4].value = field[abValue3].value + field[abValue4].value
field[abValue3].value = field[abValue3].value - 1
Doneif (field[abValue3].value =0)
Is this from 2 different Eval Scripts? I have no clue what you are trying to do with the code you posted since you didn't say what you are trying to figure out, and didn't use comments to describe what it is supposed to be doing.
For now, I am going to dissect what you have provided, without making any changes to the code. (~ denotes a Comment to explain what the code is doing)
Code:
~So we want our abValue2 to equal the highest level spell we can cast
field[abValue2].value = hero.child[cHelpWiz].field[cMaxSpLev].value
This is the first time that we know you are working on an ability for a wizard. Have not mentioned that before. This one seems to be ok.
Code:
field[abValue3].value = field[abValue2].value
We already defined that abValue2 should be the highest level spell we can cast. Why do we need abValue3 to be the same number?
Code:
field[abValue4].value = 0
abValue1-4 defaults to 0 unless you define something other than that number. Why do we need a code to do exactly what the default is?
Code:
field[abValue4].value = field[abValue3].value + field[abValue4].value
So we are trying to define a value for our field[abValue4] in this line. (Didn't we just redundantly set it to 0 on the line above it?) So we want to start defining it by looking at the value in field[abValue3] (same value as in abValue2), but doesn't the next line also re-define abValue3? Then, we want to add the value of field[abValue4]....the same value that we are trying define with this code....that has not be defined yet. See the problem with this line????
Code:
field[abValue3].value = field[abValue3].value - 1
So this value was defined 3 lines above, but we want to re-define it again? What are you trying to do by defining it twice?
So what is happening here is this.....
Line 1 - Set a value.....good.
Line 2 - redundantly set that value to another field.
Line 3 - Redundant unnecessary line.
Line 4 - Trying to use a value that does not exist. (or lets just say that we use line 3 to get a 0. So now, we have abValue4 = abValue3 + 0 = abValue3 = abValue2. So now you have abValue2 - 4 with the exact same value)
Line 5 - Take Line 3 and subtract from it.
Line 6 - Doesn't exist. We set 3 fields with the same value, and did nothing with that value.
Now....what would happen if line 1 was not there?
abValue3 = 3
Line 4 - Trying to use a value that does not exist. a = 3+a. For argument sake, let's say it becomes 3a.
Line 5 - 3-1 = 2
So the next time this script runs (Scripts run every time you click something on the character)
abValue3 = 2 (We subtracted 1 from it at the end f the last run)
Line 4 now becomes a = 2 + 3A......5A for arguments sake though not mathematically correct.
Line 5 - 2-1 = 1
and so on and so on. Each time you change something on the character, abValue4 would increase by value of abValue3. So every time you changed something, this value would change. It would not stay constant. (Adjusting hps, skill points, equiping/unequiping a weapon/armor/item/ability would cause the script to run again. It is an endless loop.
This is why I need the description of the ability to know what you are trying to do.