void main()
{
   object oPC = GetLastUsedBy();
   effect eMagic = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
   location lMagic = GetLocation(GetWaypointByTag("FX_04"));
   object o04a = GetObjectByTag("Door04a");

   AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 0.3, 0.3));
   ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE, 0.5, 0.5);
   DelayCommand(0.5f, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE, 0.5, 0.5));
   DelayCommand(1.0f, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMagic, lMagic, 0.5));

   location lPort = GetLocation(GetWaypointByTag("PORTAL_04"));
   CreateObject(OBJECT_TYPE_PLACEABLE, "portal04", lPort, FALSE, "PORTAL04");

   DelayCommand(0.5f, SetLocked(o04a, FALSE));
   DelayCommand(3.5f, FloatingTextStringOnCreature("You hear the sound of a door being unlocked somewhere nearby.", oPC));
   DelayCommand(20.0f, DestroyObject(OBJECT_SELF));
}
