If GetUserFlag(6,29)>0
	Goto End
Endif

If GetUserFlag(0,29)=0
	SetUserFlag(5,29,100)
Endif

If #XPOS=9
	If #YPOS=9
		OpenDoor(712,8,9)
		ButtonSelect=1
		Goto ButtonPush
	Endif
Endif
If #XPOS=12
	If #YPOS=9
		OpenDoor(712,13,9)
		ButtonSelect=2
		Goto ButtonPush
	Endif
Endif
If #XPOS=9
	If #YPOS=12
		OpenDoor(712,8,12)
		ButtonSelect=3
		Goto ButtonPush
	Endif
Endif
If #XPOS=12
	If #YPOS=12
		OpenDoor(712,13,12)
		ButtonSelect=4
		Goto ButtonPush
	Endif
Endif

Label ButtonPush
If GetUserFlag(1,29)=ButtonSelect
	Goto End
Elseif GetUserFlag(2,29)=ButtonSelect
	Goto End
Elseif GetUserFlag(3,29)=ButtonSelect
	Goto End
Endif
SetUserFlag(0,29,GetUserFlag(0,29)+1)
SetUserFlag(GetUserFlag(0,29),29,ButtonSelect)
If GetUserFlag(0,29)>3
	Goto ButtonCheck
Endif
Timer(415,0,ButtonSelect,0,0)
Goto End

Label ButtonCheck
Choice1=GetUserFlag(1,29)
Choice2=GetUserFlag(2,29)
Choice3=GetUserFlag(3,29)
Choice4=GetUserFlag(4,29)
SetUserFlag(0,29,0)
SetUserFlag(1,29,0)
SetUserFlag(2,29,0)
SetUserFlag(3,29,0)
SetUserFlag(4,29,0)
SetUserFlag(6,29,3)

If Choice1=3
	If Choice2=2
		If Choice3=1
			If Choice4=4
				Goto ButtonSuccess
			Endif
		Endif
	Endif
Endif

CreateEffect(24,500,0,#DIR_UP,712,7,5,0,0,0)
SpawnMonster(712,151,7,5)
CreateEffect(24,500,0,#DIR_UP,712,9,5,0,0,0)
SpawnMonster(712,151,9,5)
CreateEffect(24,500,0,#DIR_UP,712,12,5,0,0,0)
SpawnMonster(712,151,12,5)
CreateEffect(24,500,0,#DIR_UP,712,14,5,0,0,0)
SpawnMonster(712,151,14,5)


Goto End

Label ButtonSuccess
Timer(413,0,2,50,0)
Goto End


Label End

Continue = 1