void main()
{
    object oPC = GetLastUsedBy();
    object oAnim = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
    object oDomin = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
    object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
    object oHench = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
    object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
    location lLeverA = GetLocation(GetWaypointByTag("WP_LEVER_A"));
    location lPC = GetLocation(GetLastUsedBy());
    effect eTeleportIN = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
    effect eTeleportOUT = EffectVisualEffect(VFX_FNF_PWSTUN);
          // If they haven't completed the quest...
    if (!GetLocalInt(oPC, "PC_FIXED_LEVER") == TRUE){
        PlaySound("as_dr_locked3");
        ActionSpeakString("This lever appears to be missing a few crucial parts in order to work.");
    }
          // If they have completed the quest & the lever works...
    if (GetLocalInt(oPC, "PC_FIXED_LEVER") == TRUE) {
       AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 0.5, 0.5));
       ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE, 0.5, 0.5);
       DelayCommand(1.5f, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE, 0.5, 0.5));
       DelayCommand(2.5f, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eTeleportOUT, lPC, 0.5));
       DelayCommand(4.5f, AssignCommand(oPC, ActionJumpToLocation(lLeverA)));
            if (oAnim != OBJECT_INVALID){
            DelayCommand(5.0f, AssignCommand(oAnim, ClearAllActions()));
            DelayCommand(5.0f, AssignCommand(oAnim, ActionJumpToLocation(lLeverA))); }
            if (oDomin != OBJECT_INVALID){
            DelayCommand(5.0f, AssignCommand(oDomin, ClearAllActions()));
            DelayCommand(5.0f, AssignCommand(oDomin, ActionJumpToLocation(lLeverA))); }
            if (oFamiliar != OBJECT_INVALID){
            DelayCommand(5.0f, AssignCommand(oFamiliar, ClearAllActions()));
            DelayCommand(5.0f, AssignCommand(oFamiliar, ActionJumpToLocation(lLeverA))); }
            if (oHench != OBJECT_INVALID){
            DelayCommand(5.0f, AssignCommand(oHench, ClearAllActions()));
            DelayCommand(5.0f, AssignCommand(oHench, ActionJumpToLocation(lLeverA))); }
            if (oSummon != OBJECT_INVALID){
            DelayCommand(5.0f, AssignCommand(oSummon, ClearAllActions()));
            DelayCommand(5.0f, AssignCommand(oSummon, ActionJumpToLocation(lLeverA))); }
    }
}
