I came across this topic on the Beamdog forum as I was looking for a way to engineer my own spell. A guy called FailGeek writes:
"Hey, I'm trying to make a kit that causes an additional effect if the target is under a unique status, but I can't seem to get it to work. What I've currently done using NearInfinity is:
1) Added a new line to SPLSTATE.ids (currently #1000)
2) Created a spell to use OpCode 328 to apply the State #1000 on the target for a 60 second duration.
3) Created another spell that uses OpCode 326 using Paramater 2 - 76 (SPLSTATE = specified value) and Paramater 1 - #1000 to cast yet another spell on the target if they have the custom state."
He solved the problem this was leading up to eventually, but what I don't understand about his method is how to apply several state checks. I mean, I can put a new state in SPLSTATE and then have Opcode 326 look for that state - okay; but what if I need other conditions? Suppose the state is called TAUNTED. I also want undead to be excluded as a target for further effects, even if they are TAUNTED. In the same Opcode 326 effect I can pick either !Undead from GENERAL.IDS or my TAUNTED state. How do I make both conditions apply? Do I make a further spell and put in the the "Resource" field so that this second spell will be cast only if the first check is passed, and then have that spell, too, do Opcode 326, and so on?
By the way, I'd like to know what positions in SPLSTATE.IDS have already been claimed by modders. From what I read, the last one that can be used with certainty is 255, others beyond it are finicky. There are many available under 255, though. I'm going for 248 with my TAUNTED state, if that's free.