/////////////////////////////////////////////////////////////////////
// HADESRIM.S		-	Dragor Nightsbane's Quest
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_PLACED_HRIM

		Add gt_PLACED_HRIM

		PlaceC				HR_SPIDER_1 pB_1
		AggressiveSpider	HR_SPIDER_1
		PlaceC				HR_SPIDER_2 pB_1
		AggressiveSpider	HR_SPIDER_2
		PlaceC				HR_SPIDER_3 pB_1
		AggressiveSpider	HR_SPIDER_3
		PlaceC				HR_SPIDER_4 pB_1
		AggressiveSpider	HR_SPIDER_4
		PlaceC				HR_SPIDER_5 pB_1
		AggressiveSpider	HR_SPIDER_5
		PlaceC				HR_SPIDER_6 pB_1
		AggressiveSpider	HR_SPIDER_6
		PlaceC				HR_SPIDER_7 pB_1
		AggressiveSpider	HR_SPIDER_7
		PlaceC				HR_SPIDER_8 pB_1
		AggressiveSpider	HR_SPIDER_8

		PlaceC DRAGOR pDRAGOR
		WanderNotFar DRAGOR 2 4

		PlaceC NECRONOM pNECRONOM
		WanderNotFar NECRONOM 2 4
		SwitchOnSightOfPlayer NECRONOM AttackDemo2

		PlaceC BKSTAT_1 pS_1
		PlaceC BKSTAT_2 pS_2
		PlaceC BKSTAT_3 pS_3
		PlaceC BKSTAT_4 pS_4
		PlaceC BKSTAT_5 pS_5
		PlaceC BKSTAT_6 pS_6
		PlaceC BKSTAT_7 pS_7
		PlaceC BKSTAT_8 pS_8
		PlaceC BK_BRO_1 pB_1
		PlaceC BK_BRO_2 pB_2
		PlaceC BK_BRO_3 pB_3
		PlaceC BK_BRO_4 pB_4
		PlaceC BK_BRO_5 pB_5
		PlaceC BK_BRO_6 pB_6
		PlaceC BK_BRO_7 pB_7
		PlaceC BK_BRO_8 pB_8

		PlaceC BK_SKEL_01 pK_01
		PlaceC BK_SKEL_02 pK_02
		PlaceC BK_SKEL_03 pK_03
		PlaceC BK_SKEL_04 pK_04
		PlaceC BK_SKEL_05 pK_05
		PlaceC BK_SKEL_06 pK_06
		PlaceC BK_SKEL_07 pK_07
		PlaceC BK_SKEL_08 pK_08
		PlaceC BK_SKEL_09 pK_09
		PlaceC BK_SKEL_10 pK_10
		PlaceC BK_SKEL_11 pK_11
		PlaceC BK_SKEL_12 pK_12
		PlaceC BK_SKEL_13 pK_13
		PlaceC BK_SKEL_14 pK_14
		PlaceC BK_SKEL_15 pK_15
		WanderNotFar			BK_SKEL_01 4 10
		SwitchOnSightOfPlayer	BK_SKEL_01 AttackDemo2
		WanderNotFar			BK_SKEL_02 4 10
		SwitchOnSightOfPlayer	BK_SKEL_02 AttackDemo2
		WanderNotFar			BK_SKEL_03 4 10
		SwitchOnSightOfPlayer	BK_SKEL_03 AttackDemo2
		WanderNotFar			BK_SKEL_04 4 10
		SwitchOnSightOfPlayer	BK_SKEL_04 AttackDemo2
		WanderNotFar			BK_SKEL_05 4 10
		SwitchOnSightOfPlayer	BK_SKEL_05 AttackDemo2
		WanderNotFar			BK_SKEL_06 4 10
		SwitchOnSightOfPlayer	BK_SKEL_06 AttackDemo2
		WanderNotFar			BK_SKEL_07 4 10
		SwitchOnSightOfPlayer	BK_SKEL_07 AttackDemo2
		WanderNotFar			BK_SKEL_08 4 10
		SwitchOnSightOfPlayer	BK_SKEL_08 AttackDemo2
		WanderNotFar			BK_SKEL_09 4 10
		SwitchOnSightOfPlayer	BK_SKEL_09 AttackDemo2
		WanderNotFar			BK_SKEL_10 4 10
		SwitchOnSightOfPlayer	BK_SKEL_10 AttackDemo2
		WanderNotFar			BK_SKEL_11 4 10
		SwitchOnSightOfPlayer	BK_SKEL_11 AttackDemo2
		WanderNotFar			BK_SKEL_12 4 10
		SwitchOnSightOfPlayer	BK_SKEL_12 AttackDemo2
		WanderNotFar			BK_SKEL_13 4 10
		SwitchOnSightOfPlayer	BK_SKEL_13 AttackDemo2
		WanderNotFar			BK_SKEL_14 4 10
		SwitchOnSightOfPlayer	BK_SKEL_14 AttackDemo2
		WanderNotFar			BK_SKEL_15 4 10
		SwitchOnSightOfPlayer	BK_SKEL_15 AttackDemo2

		MakeInvisible BKSTAT_1
		MakeInvisible BKSTAT_2
		MakeInvisible BKSTAT_3
		MakeInvisible BKSTAT_4
		MakeInvisible BKSTAT_5
		MakeInvisible BKSTAT_6
		MakeInvisible BKSTAT_7
		MakeInvisible BKSTAT_8
		Lock BKSTAT_1
		Lock BKSTAT_2
		Lock BKSTAT_3
		Lock BKSTAT_4
		Lock BKSTAT_5
		Lock BKSTAT_6
		Lock BKSTAT_7
		Lock BKSTAT_8
		WanderNotFar BK_BRO_1 2 6
		SwitchOnSightOfPlayer BK_BRO_1 AttackDemo2
		WanderNotFar BK_BRO_2 2 6
		SwitchOnSightOfPlayer BK_BRO_2 AttackDemo2
		WanderNotFar BK_BRO_3 2 6
		SwitchOnSightOfPlayer BK_BRO_3 AttackDemo2
		WanderNotFar BK_BRO_4 2 6
		SwitchOnSightOfPlayer BK_BRO_4 AttackDemo2
		WanderNotFar BK_BRO_5 2 6
		SwitchOnSightOfPlayer BK_BRO_5 AttackDemo2
		WanderNotFar BK_BRO_6 2 6
		SwitchOnSightOfPlayer BK_BRO_6 AttackDemo2
		WanderNotFar BK_BRO_7 2 6
		SwitchOnSightOfPlayer BK_BRO_7 AttackDemo2
		WanderNotFar BK_BRO_8 2 6
		SwitchOnSightOfPlayer BK_BRO_8 AttackDemo2

		Add gt_STAT_1_OK
		Add gt_STAT_2_OK
		Add gt_STAT_3_OK
		Add gt_STAT_4_OK
		Add gt_STAT_5_OK
		Add gt_STAT_6_OK
		Add gt_STAT_7_OK
		Add gt_STAT_8_OK
		Add gt_NECRONOM_OK
		Set gt_RISE_AGAIN 0
		Set gt_NECRO_TIMER 0

	ENDIF

END

VIG TempSetup FALSE

	DisableTeleport RH_HEXSTONE
	Set	gd_WEATHER_TYPE	2
	Set gd_WIND_TYPE	1
    RunS CueWeather

	FX_Torch 9078 33918 1174
	FX_Torch 10365 33943 1174

	// Statue Torches
	IF !gt_STAT_1_OK
		FX_Torch 8639 36118 1024
	ENDIF

	IF !gt_STAT_2_OK
		FX_Torch 8931 35321 1024
	ENDIF

	IF !gt_STAT_3_OK
		FX_Torch 9727 34996 1024
	ENDIF

	IF !gt_STAT_4_OK
		FX_Torch 10483 35302 1024
	ENDIF

	IF !gt_STAT_5_OK
		FX_Torch 10818 36086 1024
	ENDIF

	IF !gt_STAT_6_OK
		FX_Torch 10488 36857 1024
	ENDIF

	IF !gt_STAT_7_OK
		FX_Torch 9722 37147 1024
	ENDIF

	IF !gt_STAT_8_OK
		FX_Torch 8963 36862 1024
	ENDIF

	CachePortrait DARIUS.BIN
	CachePortrait NECRONOM.BIN

	PlayLoopedMusic rpg22.wav
END

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

VIG TalkToDragor MSG-iDRAGOR

	Widescreen TRUE

	FreezeC BK_BRO_1
	FreezeC BK_BRO_2
	FreezeC BK_BRO_3
	FreezeC BK_BRO_4
	FreezeC BK_BRO_5
	FreezeC BK_BRO_6
	FreezeC BK_BRO_7
	FreezeC BK_BRO_8
	FreezeC	HR_SPIDER_1
	FreezeC	HR_SPIDER_2
	FreezeC	HR_SPIDER_3
	FreezeC	HR_SPIDER_4
	FreezeC	HR_SPIDER_5
	FreezeC	HR_SPIDER_6
	FreezeC	HR_SPIDER_7
	FreezeC	HR_SPIDER_8
	FreezeC BK_SKEL_01
	FreezeC BK_SKEL_02
	FreezeC BK_SKEL_03
	FreezeC BK_SKEL_04
	FreezeC BK_SKEL_05
	FreezeC BK_SKEL_06
	FreezeC BK_SKEL_07
	FreezeC BK_SKEL_08
	FreezeC BK_SKEL_09
	FreezeC BK_SKEL_10
	FreezeC BK_SKEL_11
	FreezeC BK_SKEL_12
	FreezeC BK_SKEL_13
	FreezeC BK_SKEL_14
	FreezeC BK_SKEL_15

	UnDrawSwordRemember
	EngageAndFace P DRAGOR
	IF ISDEAD-NECRONOM
		Say dr0004

		Capture DRAGOR cM_TOSS_GENTLE
		Capture P cM_OBJ_ACCEPT_1H1
		UUComplete DRAGOR

		AwardOb P hades_key_gold_4 "quest-item"
		Wait 1000

		FX_YellowFire DRAGOR
		Wait 1500

		KillC  DRAGOR
		AwardEP xp_FREE_DRAGOR
		QLRemove ql510
		QLremove ql511
//		DrawSwordRemember
	ELSE
		IF ce_DRAGOR
			Say dr0002
		ELSE
			Say dr0001
			QLAdd ql511 qlt511 qlb511
			Add ce_DRAGOR
			ChangeProfileToIdentified Hrim_Dragor
		ENDIF
	ENDIF

	UnFreezeC BK_BRO_1
	UnFreezeC BK_BRO_2
	UnFreezeC BK_BRO_3
	UnFreezeC BK_BRO_4
	UnFreezeC BK_BRO_5
	UnFreezeC BK_BRO_6
	UnFreezeC BK_BRO_7
	UnFreezeC BK_BRO_8
	UnFreezeC HR_SPIDER_1
	UnFreezeC HR_SPIDER_2
	UnFreezeC HR_SPIDER_3
	UnFreezeC HR_SPIDER_4
	UnFreezeC HR_SPIDER_5
	UnFreezeC HR_SPIDER_6
	UnFreezeC HR_SPIDER_7
	UnFreezeC HR_SPIDER_8
	UnFreezeC BK_SKEL_01
	UnFreezeC BK_SKEL_02
	UnFreezeC BK_SKEL_03
	UnFreezeC BK_SKEL_04
	UnFreezeC BK_SKEL_05
	UnFreezeC BK_SKEL_06
	UnFreezeC BK_SKEL_07
	UnFreezeC BK_SKEL_08
	UnFreezeC BK_SKEL_09
	UnFreezeC BK_SKEL_10
	UnFreezeC BK_SKEL_11
	UnFreezeC BK_SKEL_12
	UnFreezeC BK_SKEL_13
	UnFreezeC BK_SKEL_14
	UnFreezeC BK_SKEL_15

	Widescreen FALSE

END

/////////////////////////////////////////////////////////////////////
VIG Brother_1_Dead TENSEC && ISDEAD-BK_BRO_1 && gt_STAT_1_OK
	RemoveC BK_BRO_1
	ResetStats BK_BRO_1
	PlaceC BK_BRO_1 pB_1
	FX_BurnPerson BK_BRO_1
	WanderNotFar BK_BRO_1 2 6
	SwitchOnSightOfPlayer BK_BRO_1 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_2_Dead TENSEC && ISDEAD-BK_BRO_2 && gt_STAT_2_OK
	RemoveC BK_BRO_2
	ResetStats BK_BRO_2
	PlaceC BK_BRO_2 pB_2
	FX_BurnPerson BK_BRO_2
	WanderNotFar BK_BRO_2 2 6
	SwitchOnSightOfPlayer BK_BRO_2 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_3_Dead TENSEC && ISDEAD-BK_BRO_3 && gt_STAT_3_OK
	RemoveC BK_BRO_3
	ResetStats BK_BRO_3
	PlaceC BK_BRO_3 pB_3
	FX_BurnPerson BK_BRO_3
	WanderNotFar BK_BRO_3 2 6
	SwitchOnSightOfPlayer BK_BRO_3 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_4_Dead TENSEC && ISDEAD-BK_BRO_4 && gt_STAT_4_OK
	RemoveC BK_BRO_4
	ResetStats BK_BRO_4
	PlaceC BK_BRO_4 pB_4
	FX_BurnPerson BK_BRO_4
	WanderNotFar BK_BRO_4 2 6
	SwitchOnSightOfPlayer BK_BRO_4 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_5_Dead TENSEC && ISDEAD-BK_BRO_5 && gt_STAT_5_OK
	RemoveC BK_BRO_5
	ResetStats BK_BRO_5
	PlaceC BK_BRO_5 pB_5
	FX_BurnPerson BK_BRO_5
	WanderNotFar BK_BRO_5 2 6
	SwitchOnSightOfPlayer BK_BRO_5 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_6_Dead TENSEC && ISDEAD-BK_BRO_6 && gt_STAT_6_OK
	RemoveC BK_BRO_6
	ResetStats BK_BRO_6
	PlaceC BK_BRO_6 pB_6
	FX_BurnPerson BK_BRO_6
	WanderNotFar BK_BRO_6 2 6
	SwitchOnSightOfPlayer BK_BRO_6 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_7_Dead TENSEC && ISDEAD-BK_BRO_7 && gt_STAT_7_OK
	RemoveC BK_BRO_7
	ResetStats BK_BRO_7
	PlaceC BK_BRO_7 pB_7
	FX_BurnPerson BK_BRO_7
	WanderNotFar BK_BRO_7 2 6
	SwitchOnSightOfPlayer BK_BRO_7 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Brother_8_Dead TENSEC && ISDEAD-BK_BRO_8 && gt_STAT_8_OK
	RemoveC BK_BRO_8
	ResetStats BK_BRO_8
	PlaceC BK_BRO_8 pB_8
	FX_BurnPerson BK_BRO_8
	WanderNotFar BK_BRO_8 2 6
	SwitchOnSightOfPlayer BK_BRO_8 AttackDemo2
END
/////////////////////////////////////////////////////////////////////
VIG Statue_1_Burned gt_STAT_1_OK && BKSTAT_1_BURNT
	Remove gt_STAT_1_OK
	SetHP BKSTAT_1 200
	FireDamageNA BKSTAT_1 250
	SetHP BK_BRO_1 200
	FireDamageNA BK_BRO_1 250
	FX_Torch 8639 36118 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_2_Burned gt_STAT_2_OK && BKSTAT_2_BURNT
	Remove gt_STAT_2_OK
	SetHP BKSTAT_2 200
	FireDamageNA BKSTAT_2 250
	SetHP BK_BRO_2 200
	FireDamageNA BK_BRO_2 250
	FX_Torch 8931 35321 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_3_Burned gt_STAT_3_OK && BKSTAT_3_BURNT
	Remove gt_STAT_3_OK
	SetHP BKSTAT_3 200
	FireDamageNA BKSTAT_3 250
	SetHP BK_BRO_3 200
	FireDamageNA BK_BRO_3 250
	FX_Torch 9727 34996 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_4_Burned gt_STAT_4_OK && BKSTAT_4_BURNT
	Remove gt_STAT_4_OK
	SetHP BKSTAT_4 200
	FireDamageNA BKSTAT_4 250
	SetHP BK_BRO_4 200
	FireDamageNA BK_BRO_4 250
	FX_Torch 10483 35302 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_5_Burned gt_STAT_5_OK && BKSTAT_5_BURNT
	Remove gt_STAT_5_OK
	SetHP BKSTAT_5 200
	FireDamageNA BKSTAT_5 250
	SetHP BK_BRO_5 200
	FireDamageNA BK_BRO_5 250
	FX_Torch 10818 36086 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_6_Burned gt_STAT_6_OK && BKSTAT_6_BURNT
	Remove gt_STAT_6_OK
	SetHP BKSTAT_6 200
	FireDamageNA BKSTAT_6 250
	SetHP BK_BRO_6 200
	FireDamageNA BK_BRO_6 250
	FX_Torch 10488 36857 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_7_Burned gt_STAT_7_OK && BKSTAT_7_BURNT
	Remove gt_STAT_7_OK
	SetHP BKSTAT_7 200
	FireDamageNA BKSTAT_7 250
	SetHP BK_BRO_7 200
	FireDamageNA BK_BRO_7 250
	FX_Torch 9722 37147 1024
END
/////////////////////////////////////////////////////////////////////
VIG Statue_8_Burned gt_STAT_8_OK && BKSTAT_8_BURNT
	Remove gt_STAT_8_OK
	SetHP BKSTAT_8 200
	FireDamageNA BKSTAT_8 250
	SetHP BK_BRO_8 200
	FireDamageNA BK_BRO_8 250
	FX_Torch 8963 36862 1024
END
/////////////////////////////////////////////////////////////////////

VIG NecronomDead ONESEC && ISDEAD-NECRONOM && gt_NECRONOM_OK

	IF !gt_STAT_1_OK && !gt_STAT_2_OK && !gt_STAT_3_OK && !gt_STAT_4_OK && !gt_STAT_5_OK && !gt_STAT_6_OK && !gt_STAT_7_OK && !gt_STAT_8_OK
		
		Remove gt_NECRONOM_OK
		//drop ghost cloak
		AwardOb NECRONOM ar_ltr_cl_ghst finally
		LooseOb NECRONOM ar_ltr_cl_ghst
		
		Set gg_FX_NECRONOM_DEATH 0

	ELSE

		AddTo gt_NECRO_TIMER 1

		IF gt_NECRO_TIMER>4
			Set gt_NECRO_TIMER 0
			Widescreen TRUE

			IF gt_STAT_1_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_1
				FX_WhiteFireGlow pS_1
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_2_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_2
				FX_WhiteFireGlow pS_2
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_3_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_3
				FX_WhiteFireGlow pS_3
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_4_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_4
				FX_WhiteFireGlow pS_4
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_5_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_5
				FX_WhiteFireGlow pS_5
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_6_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_6
				FX_WhiteFireGlow pS_6
				AddTo gt_RISE_AGAIN 1
			ELSE
			IF gt_STAT_7_OK
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_7
				FX_WhiteFireGlow pS_7
				AddTo gt_RISE_AGAIN 1
			ELSE
				RemoveC NECRONOM
				ResetStats NECRONOM
				PlaceC NECRONOM pS_8
				FX_WhiteFireGlow pS_8
				AddTo gt_RISE_AGAIN 1
			ENDIF
			ENDIF
			ENDIF
			ENDIF
			ENDIF
			ENDIF
			ENDIF

			FX_BurnPerson NECRONOM
			campan NECRONOM
			LookAtTurnFollow NECRONOM P

			IF gt_RISE_AGAIN=1
				Say ro0001 NECRONOM.BIN
				QLAdd ql510 qlt510 qlb510
			ELSE
				IF gt_RISE_AGAIN=2
					Say ro0002 NECRONOM.BIN
				ELSE
					Wait 2000
				ENDIF
			ENDIF

			GiveSightOfPlayerTo NECRONOM
			AttackDemo2 NECRONOM
			camcut P

			Widescreen FALSE
		ENDIF
	ENDIF

END

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

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

VIG FlyBy FALSE

	Widescreen TRUE

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

	// use Wait at start and end to help when editing the final recording
	// use UUCameraComplete to wait for a pan to finish
	// use SetCamMoveConstant to set camera movement per frame
	//     - remember the movie is played at 25fps no matter how slow it records

	SetCamMoveConstant 15
	FreeCam
	PhotoOn

	camcut flyby01

	campan flyby02
	UUCameraComplete

//==================================//

	SetCamMoveConstant 20
	
	camcut flyby03
	UUCameraComplete

	//campan flyby04
	//UUCameraComplete

	campan flyby05
	UUCameraComplete

//==================================//

	SetCamMoveConstant 20

	camcut flyby06
	UUCameraComplete

	campan flyby07
	UUCameraComplete

	campan flyby08
	UUCameraComplete

	// <Quick> look left then right...
	SetCamMoveConstant 50
	
	campan flyby09
	UUCameraComplete

	campan flyby10
	UUCameraComplete

	campan flyby08
	UUCameraComplete
	
	wait 5000

	PhotoOff

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

	Widescreen FALSE

END

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

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

VIG DoDeathEffectNecronom ONESEC && gg_FX_NECRONOM_DEATH && gg_FX_NECRONOM_DEATH<4
	AddTo gg_FX_NECRONOM_DEATH 1

	IF gg_FX_NECRONOM_DEATH=4
		FX_RevSpiritToPerson NECRONOM P 3
		AwardEP xp_NECRONOM_DEAD
	ENDIF
END

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



