void main()
{
    object oPC = GetClickingObject();
    effect eRoomgear = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE, FALSE);

    if(GetLocalInt(GetObjectByTag("room11counter"), "exitcounter") == 3)
        {
            AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r11_to_a4"))));
            SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 0);
            DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
            DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
            DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11npit_snd")));
            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11spit_snd")));
            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11epit_snd")));
            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11wpit_snd")));
        }
      else
        {
            if(GetLocalInt(GetObjectByTag("room11counter"), "exitcounter") == 0)
                {
                    AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r11_to_rspike"))));
                    SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 1);
                    DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                    DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                    DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11epit_snd")));
                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11wpit_snd")));
                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11npit_snd")));
                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11spit_snd")));
                }
              else
                {
                    if(GetLocalInt(GetObjectByTag("room11counter"), "exitcounter") == 1)
                        {
                            if(GetLocalInt(GetObjectByTag("room2counter"), "exitcounter") == 0)
                                {
                                    AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r11_to_r2"))));
                                    SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 2);
                                    DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                                    DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                                    DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11npit_snd")));
                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11spit_snd")));
                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11epit_snd")));
                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11wpit_snd")));
                                }
                              else
                                {
                                    if(GetLocalInt(GetObjectByTag("room2counter"), "exitcounter") == 1)
                                        {
                                            AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r7_to_r2"))));
                                            SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 2);
                                            DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                                            DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                                            DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                                            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11npit_snd")));
                                            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11spit_snd")));
                                            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11epit_snd")));
                                            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11wpit_snd")));
                                        }
                                      else
                                        {
                                            if(GetLocalInt(GetObjectByTag("room2counter"), "exitcounter") == 2)
                                                {
                                                    AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r1_to_r2"))));
                                                    SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 2);
                                                    DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                                                    DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                                                    DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11npit_snd")));
                                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11spit_snd")));
                                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11epit_snd")));
                                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11wpit_snd")));
                                                }
                                              else
                                                {
                                                    if(GetLocalInt(GetObjectByTag("room2counter"), "exitcounter") == 3)
                                                        {
                                                            AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r6_to_r2"))));
                                                            SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 2);
                                                            DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                                                            DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                                                            DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                                                            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11npit_snd")));
                                                            DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11spit_snd")));
                                                            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11epit_snd")));
                                                            DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11wpit_snd")));
                                                        }
                                                }
                                        }
                                 }
                        }
                      else
                        {
                            if(GetLocalInt(GetObjectByTag("room11counter"), "exitcounter") == 2)
                                {
                                    AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("wp_r11_to_rspike"))));
                                    SetLocalInt(GetObjectByTag("room11counter"), "exitcounter", 3);
                                    DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eRoomgear, GetLocation(GetObjectByTag("room11counter")), 6.0));
                                    DelayCommand(1.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_crank1")));
                                    DelayCommand(5.0, AssignCommand(GetObjectByTag("room11counter"), PlaySound("as_cv_boomdist2")));
                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11epit_snd")));
                                    DelayCommand(3.0, SoundObjectPlay(GetObjectByTag("ty_r11wpit_snd")));
                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11npit_snd")));
                                    DelayCommand(3.0, SoundObjectStop(GetObjectByTag("ty_r11spit_snd")));
                                }
                        }
                }
         }
}