/////////////////////////////////////////////////////////////////////
// ALTOMB4.S
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_PLACED_ALVARIS
		Add gt_PLACED_ALVARIS

		PlaceC		RR_GARD_G_1 pG1
		SetHP		RR_GARD_G_1 250
		EngagePoint	RR_GARD_G_1 pALVARIS_BY_TOMB 500
		AddControl	RR_GARD_G_1 AttackDemo2

		PlaceC		RR_GARD_G_2 pG2
		SetHP		RR_GARD_G_2 500
		EngagePoint	RR_GARD_G_2 pALVARIS_BY_TOMB 500
		AddControl	RR_GARD_G_2 AttackDemo2

		Set gt_ALVARIS_TRAP_TIMER 1
	ENDIF

END

VIG TempSetup FALSE

	SetWeather  0 0 0 0 0 0 0 0

	SetLiquid ALL 1250 20 10
	SetWaterType 0
	SetWaterAnimSpeed 0

	CachePortrait SKELETON.BIN
	CachePortrait PC1.BIN

END

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

VIG AwardBloodMaster ONESEC && !mj_FOUND_BLOODMASTER && INAREA-P-NEAR_TOMB && ISDEAD-RR_GARD_G_1 && ISDEAD-RR_GARD_G_2

 	Widescreen TRUE

	freecam
	setcammoveconstant 1
	camcut cam3
	campan cam2

	PlayMusic MUSIC03.WAV

	PlaceC ALVARIS pALVARIS_BY_TOMB
	FX_GreenFire ALVARIS
	Wait 1500

	EngagePoint P pALVARIS_BY_TOMB 300

	//"I am Alvaris...are you he who was prophesied...?"
	Say al0001
	ChangeProfileToIdentified Sbloodkin_Alvaris
	LookAtTurn ALVARIS P
	//"I am..."
	Say Hx0314
	//"...you seek Blood Master..."
	Say al0002
	//"I do."
	Say Hx0315
	//"...The hammer was forged for thee...I foresaw your coming..."
	Say al0003
	//"...how should Blood Master be wielded...?"
	Say Hx0316
	//"...One touch is all..."
	Say al0004
	//"Where is the weapon, great Seer?"
	Say Hx0317
	//"Walk to the light, Hex master. Blood Master awaits thee."
	Say al0006

	FX_GreenFire ALVARIS
	KillC ALVARIS
	Wait 1000

	FX_WhiteFireGlow pALVARIS_BY_TOMB

	wait 3000

	MoveC P pALVARIS_BY_TOMB

	UUComplete P

	//FX_CircEffect 16864 20466 150

	Add mj_FOUND_BLOODMASTER
	AwardEP xp_FOUND_BLOODMASTER

	AwardOb P bloodmaster "hammer"
	FX_WhiteFireGlow pALVARIS_BY_TOMB

	Wait 2000
	FX_Invisible P
	Add gg_VANISHED_ALTOMB
	Wait 3000

	normalcam
	setcammovenormal

	PostMsg t_RA_ALVARIS

	Widescreen FALSE

END

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

VIG DisableTraps MSG-iDISARM && gt_ALVARIS_TRAP_TIMER

	Widescreen TRUE
	UnDrawSwordRemember
FreeCam
CamNLock 90
CamPan pP_BY_PLINTH

	MoveCDir P pP_BY_PLINTH
	UUComplete P

	//"This monument has a small keyhole..."
	Say HX0313

	IF POS-P-alvaris_key

		Capture P cM_POINT
		UUComplete P
		DeleteObjectsInBackPackWithID P alvaris_key
		PlaySFXPerson IG_218xx.WAV P
		Remove gt_ALVARIS_TRAP_TIMER
		AwardEP xp_ALVARIS_TRAPS
		Wait 2500

	ENDIF


SetCamMoveNormal
NormalCam
CamCut P
	
	DrawSwordRemember
	Widescreen FALSE

END

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

VIG TrapTests TENTHSEC && gt_ALVARIS_TRAP_TIMER

	SWITCH FLAG-gt_ALVARIS_TRAP_TIMER
		CASE 1
			Set gt_ALVARIS_TRAP_TIMER 2
			IF INAREA-P-TRAP_01 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_01 && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_01  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 2
			Set gt_ALVARIS_TRAP_TIMER 3
			IF INAREA-P-TRAP_02 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_02 && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_02  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 3
			Set gt_ALVARIS_TRAP_TIMER 4
			IF INAREA-P-TRAP_03 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_03  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_03  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 4
			Set gt_ALVARIS_TRAP_TIMER 5
			IF INAREA-P-TRAP_04 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_04  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_04  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 5
			Set gt_ALVARIS_TRAP_TIMER 6
			IF INAREA-P-TRAP_05 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_05  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_05  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 6
			Set gt_ALVARIS_TRAP_TIMER 7
			IF INAREA-P-TRAP_06 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_06  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_06  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 7
			Set gt_ALVARIS_TRAP_TIMER 8
			IF INAREA-P-TRAP_07 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_07  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_07  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 8
			Set gt_ALVARIS_TRAP_TIMER 9
			IF INAREA-P-TRAP_08 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_08  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_08  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 9
			Set gt_ALVARIS_TRAP_TIMER 10
			IF INAREA-P-TRAP_09 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_09  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_09  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
		CASE 10
			Set gt_ALVARIS_TRAP_TIMER 1
			IF INAREA-P-TRAP_10 && !ISDEAD-P
				FX_BurnPerson P
				FireDamage P 50
			ENDIF
			IF INAREA-RR_GARD_G_1-TRAP_10  && !ISDEAD-RR_GARD_G_1
				FX_BurnPerson RR_GARD_G_1
				FireDamage RR_GARD_G_1 50
			ENDIF
			IF INAREA-RR_GARD_G_2-TRAP_10  && !ISDEAD-RR_GARD_G_2
				FX_BurnPerson RR_GARD_G_2
				FireDamage RR_GARD_G_2 50
			ENDIF
	ENDSWITCH

END

