begin bxMushroomLifScript
DontSaveObject; will force backset to CS values after reload
short ismoving
float ZPos
float Timer
if ( menumode )
return
EndIF
IF ( MushroomLift01.ismoving > 0 ) ;indirekt drauf zugreifen, das hat seinen Grund
IF ( OnActivate == 1 ) ;kein Rumfingern während der Fahrt
Return
EndIF
Else
IF ( OnActivate == 0 ) ;Pilz nicht angerührt? ok, dann nix machen...
return
EndIF
set MushroomLift01.ismoving to 1 ;einen Pilz aktiviert? ok, dann los.
EndIF
IF ( MushroomLift01.ismoving == 1 ) ;erstmal feststellen, welcher Pilz wo ist.
set Timer to 0 ;reset the Timer
IF ( ( MushroomLift01->GetPos Z ) == 100 )
set MushroomLift01.ismoving to 2 ;der is unten, dann muß er rauf
Else
set MushroomLift01.ismoving to 3 ;der is oben, also runter mit ihm
EndIF
;maybe do something else her, play sound, cast spell, say something, etc.
EndIF
IF ( Timer < 1 ) ;wait a second so player can hop on the Plattform.
set Timer to Timer + GetSecondsPassed
return
EndIF
set ZPos to ( MushroomLift01->GetPos Z ) ;aktuelle Position holen
IF ( MushroomLift01.ismoving == 2 )
IF ( ZPos <= 110 )
MushroomLift01->MoveWorld Z, 50
MushroomLift02->MoveWorld Z, -50
ElseIF ( ZPos <= 130 )
MushroomLift01->MoveWorld Z, 75
MushroomLift02->MoveWorld Z, -75
ElseIF ( ZPos <= 160 )
MushroomLift01->MoveWorld Z, 125
MushroomLift02->MoveWorld Z, -125
ElseIF ( ZPos <= 640 )
MushroomLift01->MoveWorld Z, 200
MushroomLift02->MoveWorld Z, -200
ElseIF ( ZPos <= 670 )
MushroomLift01->MoveWorld Z, 125
MushroomLift02->MoveWorld Z, -125
ElseIF ( ZPos <= 690 )
MushroomLift01->MoveWorld Z, 75
MushroomLift02->MoveWorld Z, -75
ElseIF ( ZPos <= 700 )
MushroomLift01->MoveWorld Z, 50
MushroomLift02->MoveWorld Z, -50
Else
MushroomLift01->SetPos Z 700
MushroomLift02->SetPos Z 100
set MushroomLift01.ismoving to 0
EndIF
return
EndIF
IF ( ZPos >= 690 )
MushroomLift01->MoveWorld Z, -50
MushroomLift02->MoveWorld Z, 50
ElseIF ( ZPos >= 670 )
MushroomLift01->MoveWorld Z, -75
MushroomLift02->MoveWorld Z, 75
ElseIF ( ZPos >= 640 )
MushroomLift01->MoveWorld Z, -125
MushroomLift02->MoveWorld Z, 125
ElseIF ( ZPos >= 160 )
MushroomLift01->MoveWorld Z, -200
MushroomLift02->MoveWorld Z, 200
ElseIF ( ZPos >= 130 )
MushroomLift01->MoveWorld Z, -125
MushroomLift02->MoveWorld Z, 125
ElseIF ( ZPos >= 110 )
MushroomLift01->MoveWorld Z, -75
MushroomLift02->MoveWorld Z, 75
ElseIF ( ZPos >= 100 )
MushroomLift01->MoveWorld Z, -50
MushroomLift02->MoveWorld Z, 50
Else
MushroomLift01->SetPos Z 100
MushroomLift02->SetPos Z 700
set MushroomLift01.ismoving to 0
EndIF
end