Request
Use bit 17 (directly after 'Not in combat') in the spell header flags (at 0x0018) to determine custom spell casting conditions:
If bit 17 is set, when the caster attempts to cast the spell, the spell should only be cast if the caster has an appropriate LOCALS variable set (matching the spell RESREF). If the variable is not set, display a strref specified by another LOCALS variable (RESREF_UNSET). If this variable is not set, display a standard fall-back resref.
An expansion of opcodes 60 and 145 to allow the inclusion of custom resource types with custom strings (needs param3+) could do this. You'd then have to edit baldur.bcs, or arxxxx.bcs to apply another .spl that has this effect. If this is general so as to prevent spell x from being cast during the day or during rain, then a bunch of flags is more than good.
Your idea is still a really good one (and shouldn't require any scripting); I'll think about this some more.
2) Allow the invisibility state to inhibit graphics overlay (215th opcode), so that invisible creatures can't be spotted when they use Fireshield/various spell protections.
This one is a biggie (also for opcode 141); I'd exclude overlays based on param2 of opcode 215 [=0,1] and param1 of opcode 141 [=1], and create additional values which do not hide animations. I can think of instances where this is useful, like Resilient Sphere, which turns the .cre invisible but we want to see the animation play.
3) Add a subparam to the 'spell deflection' family of opcodes to disable the associated graphics effect. Mainly concerns Cloak of Mirroring (203th/205th) and Reflection Shield (197th).
3.5) Also, perhaps externalize the opcode-animation table. On practice, however, it probably is not as useful, since Spell Deflection can be distinguished from Spell Immunity via the hardcoded overlay negation as per 3). Demi, Galc?
I might've posted this earlier to: remove all the associated graphics from these opcodes, and have extended uses of resources 1, 2, and 3 (external effects).
Resource1 would contain the external .eff that the .cre carries while the given decrementing opcode is active - since many such spells use one instance of the same opcode for different levels, and the same level can be used over and over again (non-cumulatively), this could mean we can embed any number of effects.
Resource2 would contain the external .eff file that's applied by the protected .cre onto the target specified in param3 (which can also be the target that cast the turned/deflected spell) when the effect deflects/turns a spell.
Resource3 would contain the external .eff file that's applied by the protected .cre onto the target specified in param4 when the effect is purged by a deflected/turned spell. Becuse external .effs can use opcode 146, the possibilities are limitless.
For example, I can make a specialized Spell Deflection that heals the caster 2 hit points per absorbed spell level, or mimick the effects of spell trap (through opcode 261) without using the spell trap opcode.
-Galactygon