new Script Trigger: detect effect
[Deleted User]
Posts: 0
The user and all related content has been deleted.
0
Comments
Create a new Spellstate in SPELLSTATE.IDS, unique to the girl.
Opcode(328): SetState, Param2= (her unique spellstate), Special = IWD2 mode. Add to any spell that needs to be considered.
Replace SpellCastOnMe() trigger with Trigger(0x40e2):CheckSpellState(O:Object*,I:State*splstate). Check if the spellstate has been activated.
If you need to remove it for any reason:
Opcode(337): Remove Effects by Opcode, Param1= (her unique spellstate), param2 = 328.
Or you can reverse the whole process: give her a permanent effect setting the Spell state, and have the spells to be considered remove it, and check if it has been removed.
Triggers such as SpellCastOnMe only check for actions occurring in the last script round, so applying the SpellState for one second(or round) would provide a similar window for it to be checked. Specific cases will require slightly different approaches depending on the dynamics of the spell and use, and you may need to remove the SpellState in the response to prevent multiple triggers. You would need to put the Set:Spellstate effect in a subspell to prevent the base spell from being removed in the case of non-instant effects.
The upper bound of SPELLSTATE.IDS appears to be 1023, which is an odd limit, but should be plenty of room to work with, only 60 currently used in IWDEE.
Edit:
I'm don't want to discourage the request though. I do agree that an OpcodeCastOnMe trigger would make this far simpler and easier, and support the request. And would like to ask that, similar to Opcode 328, it would offer the option to specify Param2 settings when checking, as many opcodes can be used for vastly different purposes depending on their parameters.