so this will not work:
so this will not work:
Try this, it at least compiles for me but I don't know if it works:
Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect) ActiveMagicEffect TheMagicEffectif TheMagicEffect.GetBaseObject() == akEffectTheMagicEffect.Dispel()endif endevent
Basic idea I guess is it checks if the ActiveMagicEffect is equivalent to the MagicEffect in question, and dispels it if it is.
Ah, I see. That is quite an annoyance...
Is this only meant to dispel a single, specified, custom magic effect?
I've looked around, and it sounds like this might be a viable work-around (of course, adjusted to your script): http://forums.nexusmods.com/index.php?/topic/1779985-what-am-i-doing-wrong-with-this-script/?p=15360055
But, that will only work if the magic effect you're trying to dispel has a unique keyword, unless you wanted to dispel a variety of magic effects. It certainly isn't as simple if Beth had just made a way to get ActiveMagicEffects, or made Dispel() work on MagicEffects.