Okay, new script... It seems not to be unlocking and opening the door, though.
#include "nw_i0_spells"
void main()
{
GetLastSpellCaster();
GetLastSpell();
object oPC = OBJECT_SELF;
if ( GetLocalInt(oPC, "Arcane_Lock") == 5 )
{
}
else if(GetLastSpell() == SPELL_GREATER_DISPELLING)
{
DeleteLocalInt(OBJECT_SELF,"Arcane_Lock");
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
SetLockKeyRequired(OBJECT_SELF, FALSE);
RemoveSpecificEffect(EFFECT_TYPE_VISUALEFFECT, OBJECT_SELF);
return;
}
else if(GetLastSpell() == SPELL_MORDENKAINENS_DISJUNCTION)
{
DeleteLocalInt(OBJECT_SELF,"Arcane_Lock");
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
SetLockKeyRequired(OBJECT_SELF, FALSE);
RemoveSpecificEffect(EFFECT_TYPE_VISUALEFFECT, OBJECT_SELF);
return;
}
}