/////////////////////////////////////////////////////////////////////
// GTHOR.S		-	Ashatar's Palace in Galdon Thor
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_DONE_GALDON_THOR

		RemoveC P
		PlaceC P pP
		camcut P

		PlaceC LAEN pLAEN
		PlaceC ASHATAR pASHATAR
		PlaceC CANDICE5 pCANDICE
		PlaceC GARGOMON pGARGOMON

		Add gt_CUE_NEXT_VIGNETTE
		Add gt_DONE_GALDON_THOR

	ELSE

		RemoveC LAEN
		KillC  ASHATAR
		RemoveC CANDICE5
		KillC  GARGOMON
		RemoveC LILITH
		RemoveC HAMMER

	ENDIF

END

VIG TempSetup FALSE

	DisableTeleport GT_LI
	DisableTeleport GT_HEXSTONE
	SetWeather 0 0 0 0 0 0 0 0
	SwapModel HAMMER Hammer5

	AddBigFire 12513 27750
	AddBigFire 12005 24585
	AddBigFire 13016 24594
	AddBigFire 10305 23269
	AddBigFire 14730 23263
	AddBigFire 7905 19728
	AddBigFire 17123 19729

	FX_Torch 12160 27008 1296
	FX_Torch 12928 27008 1296
	FX_Torch 14976 21888 1168
	FX_Torch 14976 20096 1168
	FX_Torch 10112 20096 1168
	FX_Torch 10112 21632 1168
	FX_Torch 8832  20608 1168
	FX_Torch 8832  21376 1168
	FX_Torch 16256 20608 1168
	FX_Torch 16256 21376 1168

	CachePortrait LAENCHNT.BIN
	CachePortrait CANDICE5.BIN
	CachePortrait ASHATAR.BIN
	CachePortrait GARGOMON.BIN

	IF gg_PLAYING_GARGOMON_MUSIC
		PlayLoopedMusic rpg15.wav
	ENDIF
END

/////////////////////////////////////////////////////////////////////

VIG HorribleDemoBodge DEMO_GTHOR

	Remove DEMO_GTHOR

	Set hp_GARGOMON 500
	SetHP P 501

	Message "Let Gargomon hit you to trigger the second vignette." 5

END

/////////////////////////////////////////////////////////////////////

VIG NextVignette gt_CUE_NEXT_VIGNETTE
	freecam

	// *** START FIGHT WITH GARGOMON ***

	Widescreen TRUE
	Remove gt_CUE_NEXT_VIGNETTE
	MoveCDir LAEN pGCHANT run
	LookAtTurnFollow ASHATAR LAEN
	Capture CANDICE5 cF_MEL_KNEEL1
	camcut cam10
	UUComplete CANDICE5
	MoveCDir P pP2 run
	Wait 1000
	Say da4006

	
	UUComplete LAEN

	DoAction 330 ASHATAR LAEN
	//Capture ASHATAR cF_RIGHT_ARM_SWEEP
	QuickSay nd4001 candice5.bin
	Wait 2500

	camcut pos05
	PlaySFXPerson Noise012.WAV LAEN
	Capture LAEN cM_CLUTCH_NECK_TOPPLE
	UUComplete P
	LookAtTurn ASHATAR P
	UUSay
	UUComplete ASHATAR
	Capture ASHATAR cF_POINTING_INFORMAL


	Say at0001
	campan cam12
	LookAtTurn GARGOMON P
	QuickSay go0001
	wait 1000
	LookAtTurn P GARGOMON 
	UUSay
	AttackDemo2 GARGOMON
	Say go0002

	PlayLoopedMusic rpg15.wav
	Add gg_PLAYING_GARGOMON_MUSIC

	camcut p
	setcammovenormal
	NormalCam
	SetWalkType P walk
	Widescreen FALSE
	CannotBeHit ASHATAR

	//horrible bodge time:-
	WHILE HPLESSTHAN-P-hp_GARGOMON
		AddTo hp_GARGOMON -10
	ENDWHILE

END

/////////////////////////////////////////////////////////////////////

VIG DuringTheFight TENSEC && !mj_DEFEAT_ASHATAR

	GiveSightOfPlayerTo GARGOMON
	SetHP ASHATAR 10000

END

/////////////////////////////////////////////////////////////////////

VIG FurtherBit ONESEC && !gt_CUE_NEXT_VIGNETTE && (HPLESSTHAN-P-hp_GARGOMON || ISDEAD-GARGOMON) && !ISDEAD-ASHATAR

	// *** CONCLUSION OF FIGHT WITH GARGOMON ***

	Widescreen TRUE

	IF !ISDEAD-GARGOMON
		SetHP GARGOMON 150

		PlaceC HAMMER pHAMMER
		camcut cam14
		SwapModel HAMMER Hammer5
		StopC GARGOMON
		LookAtTurn GARGOMON HAMMER
		MoveCDir HAMMER pHAM_FIGHT 
		LookAtTurnFollow ASHATAR P
		Wait 1000
		QuickSay ha4001
		UUComplete HAMMER
		MoveCDir GARGOMON pGARG_FIGHT run
		MoveCDir P pP_ASH
		UUSay

		camcut cam15
		DoAction 330 ASHATAR P
		Wait 1500
		PlaySFXPerson Noise064.WAV P
		Capture P cM_CLUTCH_NECK_TOPPLE
		wait 2000
		camcut cam14


		UUComplete GARGOMON
		UUComplete HAMMER
		MeleeAttack HAMMER
		MeleeAttack GARGOMON
		WHILE !ISDEAD-GARGOMON
			SetHP HAMMER 1000
			Wait 500
		ENDWHILE

		Remove gg_PLAYING_GARGOMON_MUSIC
		PlayMusic STOP!

		StopC HAMMER

		ChangeProfileToNotDestiny Mcitizen_Hammer
		Engage P HAMMER 500
		SetHP HAMMER 1
		wait 1500
		QuickSay ha4002
		wait 2000
		NormalDamageNA HAMMER 1
		UUSay
		UUComplete P 
		
		QuickSay Hx4007
		wait 2000
		LookAtTurn P ASHATAR
		UUSay
		
		camcut cam15
		LookAtTurn P ASHATAR
		QuickSay at0003
		Capture ASHATAR cF_LAUGHING5_FULLA
		UUComplete P
		MoveCDir P pP_NEAR_ASH
		UUSay

		Say nd4005 candice5.bin
		UUComplete P
		LookAtTurn P ASHATAR
		QuickSay at0009
		wait 1000
		Add f_HAMMER_DEAD
	ELSE
		Remove gg_PLAYING_GARGOMON_MUSIC
		PlayMusic STOP!

		StopC P
		MoveCDir P pP_NEAR_ASH
		UUComplete P
		LookAtTurn P ASHATAR
	ENDIF

	camcut cam15
	setcammoveconstant 4
	campan cam16
	PlaceC LILITH pLILITH
	LookAtTurnFollow ASHATAR LILITH
	Engage LILITH P 750
	Wait 500

	UUSay
	LookAtTurn P LILITH
	Say li0001

	Say at0004
	StopC ASHATAR
	LookAtTurnFollow LILITH ASHATAR
	Say li0002
	QuickSay at0005


	SetHP ASHATAR 100
	DoAction 331 LILITH ASHATAR
	LookAtTurn P ASHATAR
	Wait 1000
		
	IF !ISDEAD-ASHATAR
		WaterDamageNA ASHATAR 200
		Wait 1000
	ENDIF

	LookAtTurn P LILITH
	LookAtTurn LILITH P
	UUSay
	Say li0003
	Add mj_DEFEAT_ASHATAR
	AwardEP xp_DEFEAT_ASHATAR

	FX_Teleport P
	wait 3000
	RunS PalFadeBLACK
	PostMsg t_LI_GT
	setcammovenormal

END

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

VIG FlyBy FALSE

	Widescreen TRUE

	//prepare characters for flyby
	PlaceC P pHAMMER
	RemoveC LAEN
	RemoveC CANDICE
	RemoveC CANDICE5


	RemoveC			ASHATAR
	PlaceC			ASHATAR		pASHATAR
	LookAtTurn		ASHATAR		GARGOMON
	AddControl		ASHATAR		Capture			cM_TALK_GENERAL1
	SequenceLoops	ASHATAR

	RemoveC			GARGOMON
	PlaceC			GARGOMON	pGARGOMON
	LookAtTurn		GARGOMON	ASHATAR
	AddControl		GARGOMON	Capture			cM_TALK_GENERAL2
	SequenceLoops	GARGOMON


	// *** CAMERA FLY-BY CODE ***

	// I've set up Ashatar and Gargomon in their lair, with some
	// special controllers. Ideally, as the camera rounds the hex
	// stone and sees these two, they will turn to look at it.
	// Unlike the other flybys, this one ends when Ashatar finishes
	// his capture.
	// Sadly we weren't able to make it snow on this level due to
	// problems with "rooms" (just don't ask) so I guess there isn't
	// much point in taking the camera out onto the battlements.

	SetCamMoveConstant 25
	FreeCam

	PhotoOn

//pan through doorways then round the hex stone to near pWAYPOINT
//looking at Ashatar

	Camcut flyby01
	UUCameraComplete
	
	Campan flyby02
	UUCameraComplete
	
	SetCamMoveConstant 10

	Campan flyby07
	UUCameraComplete

	SetCamMoveConstant 3

	Campan flyby06


//Characters look at camera

	LookAtTurn		ASHATAR		pWAYPOINT
	AddControl		ASHATAR		Capture			cM_TALK_THREATEN1

	LookAtTurn		GARGOMON	pWAYPOINT
	AddControl		GARGOMON	Capture			cM_GUARD_STAND2

	UUComplete		ASHATAR

	PhotoOff

	// *** END OF FLY-BY ***

	Widescreen FALSE

END

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
