Scriptname _00E_MQ11c_MinigameShootingButton extends ObjectReference  
{Controls the behaviour of the button}

import Utility

;-----------------------------AUTO STATE-------------------

Auto State WaitingForActivation 


Event OnCellAttach()
	objSelf = self as ObjectReference
	playAnimation("Open")
EndEvent

Event OnActivate(ObjectReference akActionRef)
	if akActionRef == (Ryneus.GetActorReference()) && (MQ11c.GetStage() == 150)
		GoToState("Waiting")
		;playAnimationAndWait("Trigger01","done")
		if QSTAstrolabeButtonPressX
			QSTAstrolabeButtonPressX.play(objSelf)
		endif
			SphereBoxDoor.Activate(Self)
			Wait(2)
			Sphere.Activate(Self)
	ElseIf akActionRef == (Ryneus.GetActorReference()) && (MQ11c.GetStage() == 170)
			Wait(2)
			Sphere.Activate(Self)
	Else
		;Debug.Notification(NothingHappens)
	EndIf
EndEvent


EndState


;------------------------WAITING STATE---------------------

state Waiting
endState

ObjectReference Property SphereBoxDoor Auto
ObjectReference Property Sphere Auto
;String Property NothingHappens Auto
Quest Property MQ11c Auto
sound property QSTAstrolabeButtonPressX auto
objectReference property objSelf auto hidden
ReferenceAlias Property Ryneus Auto