scriptName _00E_SecretPressurePlates extends ObjectReference Conditional

Import Utility

;=====================================================================================
;              							EVENTS                  					 
;=====================================================================================

Event OnActivate(ObjectReference akActionRef)

int iCurrentValue = FlusshaimMitumialRiddle.GetValueInt()

if  bRiddleSolved == false
	if (iCurrentValue < 2	&& iPushed == 0)
		iPushed = 1
		QSTAstrolabeButtonPressX.Play(Self)
		FlusshaimMitumialRiddle.SetValue(iCurrentValue + 1)
		self.playAnimation("FullPush")
		Wait(6)
		FlusshaimMitumialRiddle.SetValue(0)
		QSTAstrolabeButtonOpenX.Play(PlayerREF)
		self.playAnimation("FullPull")
		iPushed = 0
	ElseIf (iCurrentValue == 2 && iPushed == 0)
		iPushed = 1
		self.playAnimation("FullPush")
		QSTAstrolabeButtonPressX.Play(Self)
		FlusshaimMitumialRiddle_SecretDoor.SetOpen()
		_00E_SecretWoodDoorSlideOpenLPM.Play(PlayerREF)
		FlusshaimMitumialRiddle.SetValue(3)
		bRiddleSolved = True
		Wait(6)
		self.playAnimation("FullPull")
	Else	
		;do nothing
	EndIf
EndIf
		
EndEvent

;=====================================================================================
;              							PROPERTIES                  					 
;=====================================================================================

bool bRiddleSolved 
int iPushed = 0

GlobalVariable Property FlusshaimMitumialRiddle Auto

Sound Property QSTAstrolabeButtonPressX Auto
Sound Property QSTAstrolabeButtonOpenX Auto
Sound Property _00E_SecretWoodDoorSlideOpenLPM Auto
ObjectReference Property FlusshaimMitumialRiddle_SecretDoor Auto

Actor Property PlayerREF Auto