Code: Select all
begin TR_Nchaz_Aar_Scpt_Elev1
float cranktimer
float elevtimer
short crankmoving
short active
; Elevator Global Variable States:
; 0 = floor 0, stationary
; 1 = floor 1, stationary
; 2 = moving, floor 0 to floor 1
; 3 = moving, floor 1 to floor 0
if ( CellChanged == 1 )
set cranktimer to 0
set elevtimer to 0
set crankmoving to 0
set active to 0
setangle x 0
if ( TR_Nchaz_Aar_Var_Elev1 == 0 )
"TR_Nchaz_Aar_Lift1p01"->SetPos Z -388
"TR_Nchaz_Aar_Lift1p02"->SetPos Z -388
"TR_Nchaz_Aar_Lift1p03"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p04"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p05"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p06"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p07"->SetPos Z -592
"TR_Nchaz_Aar_Lift1p08"->SetPos Z -592
"TR_Nchaz_Aar_Lift1p09"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p10"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p11"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p12"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p13"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p14"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p15"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p16"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p17"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p18"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p19"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p20"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p21"->SetPos Z -688
"TR_Nchaz_Aar_Lift1p22"->SetPos Z -784
elseif ( TR_Nchaz_Aar_Var_Elev1 == 1 )
"TR_Nchaz_Aar_Lift1p01"->SetPos Z 1916
"TR_Nchaz_Aar_Lift1p02"->SetPos Z 1916
"TR_Nchaz_Aar_Lift1p03"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p04"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p05"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p06"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p07"->SetPos Z 1712
"TR_Nchaz_Aar_Lift1p08"->SetPos Z 1712
"TR_Nchaz_Aar_Lift1p09"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p10"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p11"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p12"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p13"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p14"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p15"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p16"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p17"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p18"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p19"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p20"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p21"->SetPos Z 1616
"TR_Nchaz_Aar_Lift1p22"->SetPos Z 1520
elseif ( TR_Nchaz_Aar_Var_Elev1 == 2 )
set TR_Nchaz_Aar_Var_Elev1 to 1
"TR_Nchaz_Aar_Lift1p01"->SetPos Z 1916
"TR_Nchaz_Aar_Lift1p02"->SetPos Z 1916
"TR_Nchaz_Aar_Lift1p03"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p04"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p05"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p06"->SetPos Z 1872
"TR_Nchaz_Aar_Lift1p07"->SetPos Z 1712
"TR_Nchaz_Aar_Lift1p08"->SetPos Z 1712
"TR_Nchaz_Aar_Lift1p09"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p10"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p11"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p12"->SetPos Z 1760
"TR_Nchaz_Aar_Lift1p13"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p14"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p15"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p16"->SetPos Z 1720
"TR_Nchaz_Aar_Lift1p17"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p18"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p19"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p20"->SetPos Z 1632
"TR_Nchaz_Aar_Lift1p21"->SetPos Z 1616
"TR_Nchaz_Aar_Lift1p22"->SetPos Z 1520
elseif ( TR_Nchaz_Aar_Var_Elev1 == 3 )
set TR_Nchaz_Aar_Var_Elev1 to 0
"TR_Nchaz_Aar_Lift1p01"->SetPos Z -388
"TR_Nchaz_Aar_Lift1p02"->SetPos Z -388
"TR_Nchaz_Aar_Lift1p03"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p04"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p05"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p06"->SetPos Z -432
"TR_Nchaz_Aar_Lift1p07"->SetPos Z -592
"TR_Nchaz_Aar_Lift1p08"->SetPos Z -592
"TR_Nchaz_Aar_Lift1p09"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p10"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p11"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p12"->SetPos Z -544
"TR_Nchaz_Aar_Lift1p13"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p14"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p15"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p16"->SetPos Z -584
"TR_Nchaz_Aar_Lift1p17"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p18"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p19"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p20"->SetPos Z -672
"TR_Nchaz_Aar_Lift1p21"->SetPos Z -688
"TR_Nchaz_Aar_Lift1p22"->SetPos Z -784
endif
endif
if ( Menumode == 1 )
return
endif
if ( OnActivate == 1 )
if ( crankmoving == 0 )
if ( TR_Nchaz_Aar_Var_Elev1 < 2 )
Playsound "Dwemer Door Open"
Set active to 1
Set crankmoving to 1
elseif ( TR_Nchaz_Aar_Var_Elev1 > 1 )
Messagebox "The elevator is in motion."
endif
elseif ( crankmoving == 1)
Messagebox "The elevator is in motion."
endif
endif
if ( active == 0 )
return
endif
if ( crankmoving == 1 )
if ( cranktimer < 1.5 )
Set cranktimer to cranktimer + GetSecondsPassed
Rotate x -100
elseif ( cranktimer > 1.5 )
if (cranktimer < 4 )
Set cranktimer to cranktimer + GetSecondsPassed
Rotate x 100
if ( TR_Nchaz_Aar_Var_Elev1 == 0 )
Set TR_Nchaz_Aar_Var_Elev1 to 2
elseif ( TR_Nchaz_Aar_Var_Elev1 == 1 )
Set TR_Nchaz_Aar_Var_Elev1 to 3
endif
endif
endif
endif
if ( cranktimer > 3 )
Set cranktimer to 0
Set crankmoving to 0
endif
if ( TR_Nchaz_Aar_Var_Elev1 > 1 )
if ( TR_Nchaz_Aar_Var_Elev1 == 3 )
if ( elevtimer < 19 )
Set elevtimer to elevtimer + GetSecondsPassed
"TR_Nchaz_Aar_Lift1p01"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p02"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p03"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p04"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p05"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p06"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p07"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p08"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p09"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p10"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p11"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p12"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p13"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p14"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p15"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p16"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p17"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p18"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p19"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p20"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p21"->MoveWorld Z -128
"TR_Nchaz_Aar_Lift1p22"->MoveWorld Z -128
endif
elseif ( TR_Nchaz_Aar_Var_Elev1 == 2 )
if ( elevtimer < 19 )
Set elevtimer to elevtimer + GetSecondsPassed
"TR_Nchaz_Aar_Lift1p01"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p02"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p03"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p04"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p05"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p06"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p07"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p08"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p09"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p10"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p11"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p12"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p13"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p14"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p15"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p16"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p17"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p18"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p19"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p20"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p21"->MoveWorld Z 128
"TR_Nchaz_Aar_Lift1p22"->MoveWorld Z 128
endif
endif
endif
if ( elevtimer > 18 )
Set elevtimer to 0
Set active to 0
if ( TR_Nchaz_Aar_Var_Elev1 == 2 )
Set TR_Nchaz_Aar_Var_Elev1 to 1
elseif ( TR_Nchaz_Aar_Var_Elev1 == 3 )
Set TR_Nchaz_Aar_Var_Elev1 to 0
endif
endif
end