

OBJECT "YOURMOMS"
BEGIN
	ALWAYS
	BEGIN
		WAIT 24

		IF YHAGORO.STAT HEALTH < 1
		BEGIN
			IF ENDSTATE = 0
			BEGIN
				CONTROL OFF
				PLAYER.STOP
				PLAYER.COMBAT OFF
				WAIT 240
				FADESCREENOUT
				WAIT SCREENFADE
				WAIT 24
				PLAYMOVIE "Mix_Fmv3English.smk"
				FADESCREENIN
				PLAYMOVIE "Mix_Credits.smk"
				ENDGAME
				SET ENDSTATE = 1
			END
		END
	END
END

OBJECT "MarkerR"
BEGIN
	CUBE player 11241,8945,240 11474,9154,320
	BEGIN
		IF player.getitemamount "red crystal" = 1		
		BEGIN
			control off
			player.stop
			player.combat off
			player.goto 11351 9032
			player.stop
			player.try wpickup
			WAIT 40
			addat 11348 9026 296 irisflare
			wait 60
			player.delinv "red crystal"
			FADESCREENOUT
			player.toggle invisible=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 11248 9488 144 57
		END
		IF WARPRSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERR"
BEGIN
	CUBE player 11247,9487,100 11249,9489,200
	BEGIN
		control off
		WAIT 120
		WarpR.DELETE
		SET WARPRSTATE = 1
		BarrierR.TOGGLE NOWALK
		WAIT 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 11351 9032 292 51
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerW"
BEGIN
	CUBE player 11031,8433,700 11246,8660,750
	BEGIN
		IF player.getitemamount "white crystal" = 1		
		BEGIN
			control off
			player.stop
			player.combat off
			player.goto 11152 8560
			player.stop
			player.try wpickup
			WAIT 40
			addat 11156 8562 719 irisflare
			wait 60
			player.delinv "white crystal"
			FADESCREENOUT
			player.toggle invisible=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 11253 9335 154 57
		END
		IF WARPWSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERW"
BEGIN
	CUBE player 11252,9334,100 11254,9336,200
	BEGIN
		control off
		wait 120
		WarpW.DELETE
		SET WARPWSTATE = 1
		BarrierW.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN		
		player.pos 11152 8560 720 52
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerG"
BEGIN
	CUBE player 10237,8927,250 10012,8698,310
	BEGIN
		IF player.getitemamount "green crystal" = 1
		BEGIN	
			control off
			player.stop
			player.combat off
			player.goto 10114 8808
			player.stop
			player.try wpickup
			WAIT 40
			addat 10118 8810 285 irisflare
			wait 60
			player.delinv "green crystal"
			FADESCREENOUT
			PLAYER.TOGGLE INVISIBLE = 1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 11257 8951 154 57

		END
		IF WARPGSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERG"
BEGIN
	CUBE player 11256,8950,140 11258,8952,200
	BEGIN
		control off
		wait 120
		WarpG.DELETE
		SET WARPGSTATE = 1
		BarrierG.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 10114 8808 290 53
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerB"
BEGIN
	CUBE player 10350,10114,710 10587,9865,750
	BEGIN
		IF player.getitemamount "blue crystal" = 1
		BEGIN	
			control off
			player.stop
			player.combat off
			player.goto 10486 10004
			player.stop
			player.try wpickup
			WAIT 40 
			addat 10486 10004 722 irisflare
			wait 60
			player.delinv "blue crystal"
			FADESCREENOUT
			PLAYER.TOGGLE INVISIBLE=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 10972 8856 160 57
			
		END
		IF WARPBSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERB"
BEGIN
	CUBE player 10971,8855,144 10973,8857,200
	BEGIN
		control off
		wait 120
		WARPB.delete
		SET WARPBSTATE = 1
		BARRIERB.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 10486 10004 722 54
		toggle pause = 1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerO"
BEGIN
	CUBE player 10354,10120,550 10594,9870,600
	BEGIN
		IF player.getitemamount "orange crystal" = 1
		BEGIN		
			control off
			player.stop
			player.combat off
			player.goto 10468 9990
			player.stop
			player.try wpickup
			WAIT 40
			addat 10473 9993 583 irisflare
			wait 60
			player.delinv "orange crystal"
			FADESCREENOUT
			PLAYER.TOGGLE INVISIBLE=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 10689 8863 159 57
		END
		IF WARPOSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERO"
BEGIN
	CUBE player 10688,8862,144 10690,8864,200
	BEGIN
		control off
		wait 120
		WarpO.DELETE
		SET WARPOSTATE = 1
		BarrierO.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 10483 10007 576 55
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerY"
BEGIN
	CUBE player 10832,9442,710 11079,9207,750
	BEGIN
		IF player.getitemamount "yellow crystal" = 1		
		BEGIN
			control off
			player.stop
			player.combat off
			player.goto 10946 9330
			player.stop
			player.try wpickup
			WAIT 40
			addat 10944 9324 728 irisflare
			wait 60
			player.delinv "yellow crystal"
			FADESCREENOUT
			PLAYER.TOGGLE INVISIBLE=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 10589 8857 154 57
		END
		IF WARPYSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERY"
BEGIN
	CUBE player 10588,8856,144 10590,8858,200
	BEGIN
		control off
		wait 120
		WarpY.DELETE
		SET WARPYSTATE = 1
		BarrierY.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 10947 9331 725 56
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "MarkerP"
BEGIN
	CUBE player 10358,10124,100 10607,9883,180
	BEGIN
		IF player.getitemamount "purple crystal" = 1		
		BEGIN
			control off
			player.stop
			player.combat off
			player.goto 10472 10006
			player.stop
			player.try wpickup
			WAIT 40
			addat 10472 10004 145 irisflare
			wait 60
			player.delinv "purple crystal"
			FADESCREENOUT
			PLAYER.TOGGLE INVISIBLE=1
			WAIT SCREENFADE
			FADESCREENIN
			player.pos 10482 8670 160
			
		END
		IF WARPPSTATE = 1
		BEGIN
			TOGGLE PAUSE = 1
		END		
	END
END

OBJECT "BARRIERP"
BEGIN
	CUBE player 10481,8669,144 10483,8671,200
	BEGIN
		control off
		wait 120
		WarpP.DELETE
		SET WARPPSTATE = 1
		BarrierP.TOGGLE NOWALK
		wait 120
		FADESCREENOUT
		WAIT SCREENFADE
		FADESCREENIN
		player.pos 10485 10023 163 57
		toggle pause=1
		NOWAIT player.toggle invisible = 0
		CONTROL ON
	END
END

OBJECT "Yhagoro"
BEGIN
	CUBE player 9952,8518,250 10284,8634,300
	BEGIN
		SETCDVOLUME HALF
		WAIT 1
		control off
		player.stop
		player.try walk
		player.goto 10144 8432
		player.pivotobject Yhagoro
		player.say IX1LOC00
		say IX1YHA00
		say IX1YHA01
		say IX1YHA02
		player.say IX1LOC01
		say IX1YHA03
		player.say IX1LOC02
		say IX1YHA04
		say IX1YHA05
		player.say IX1LOC03
		player.try combat
		say IX1YHA06
		say IX1YHA07
		wait 24
		TRY WALK
		WAIT 24
		Yhagoro.stat aggressive=1
		control on
		SETCDVOLUME FULL

		toggle pause=1
	END
END
		

