void main()
{

object oPC = GetLastOpenedBy();

if (!GetIsPC(oPC)) return;

object oDoorN = GetObjectByTag("DoorShinyN");
object oDoorS = GetObjectByTag("DoorShinyS");
object oDoorE = GetObjectByTag("DoorShinyE");
object oDoorW = GetObjectByTag("DoorShinyW");

object oObjN = GetObjectByTag("DoorShinyNobj");
object oObjS = GetObjectByTag("DoorShinySobj");
object oObjE = GetObjectByTag("DoorShinyEobj");
object oObjW = GetObjectByTag("DoorShinyWobj");

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocked(oDoorN, FALSE);
SetLocked(oDoorS, FALSE);
SetLocked(oDoorE, FALSE);
SetLocked(oDoorW, FALSE);

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), oObjN);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), oObjS);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), oObjE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), oObjW);

AssignCommand(oDoorN, ActionOpenDoor(oDoorN));
AssignCommand(oDoorS, ActionOpenDoor(oDoorS));
AssignCommand(oDoorE, ActionOpenDoor(oDoorE));
AssignCommand(oDoorW, ActionOpenDoor(oDoorW));

PlaySound("gui_quest_done");
AddJournalQuestEntry("jt_keys", 6, oPC, TRUE, FALSE);

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

}

