/////////////////////////////////////////////////////////////////////
// GUILD.S		the guild temple to Lightstealer
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_PLACED_GUILD_VAMPS

		Add gt_PLACED_GUILD_VAMPS
		Add gt_GUILD_VAMPS_DORMANT
		Add gt_CIRCE_IN_TEMPLE
		Add gt_GUILD_SHADOWS_LURKING

		PlaceC CIRCE pCIRCE
		PlaceC GUILD_VAMP_1 p1
		PlaceC GUILD_VAMP_2 p2
		PlaceC GUILD_VAMP_3 p3
		PlaceC GUILD_VAMP_4 p4
		PlaceC GUILD_SHAD_1 p5
		PlaceC GUILD_SHAD_2 p6
		PlaceC CAP_BK_1 pBK_1
		PlaceC CAP_BK_2 pBK_2
		AttackDemo2	GUILD_VAMP_4

	ENDIF

	IF !mj_DEFEAT_LIGHTSTEALER && !f_CRUX_DEAD && !gt_PLAYED_CRUX_VAMP
		Add gt_PLAY_CRUX_VAMP_NOW
	ENDIF

END

VIG TempSetup FALSE

	SetWeather  0 0 0 0 0 0 0 0
	SetDoorSpeed GUILD_DOOR 50

	IF gt_BK_TO_PIGS
		SwapModel CAP_BK_1 GuildGuardian
		SwapModel CAP_BK_2 GuildGuardian
	ENDIF

	IF mj_DEFEAT_LIGHTSTEALER
		//prevent player getting bonus sword
		DeleteObjectsInWorldWithID mess2
	ENDIF

	CachePortrait LGHTSTLR.BIN
	CachePortrait LORDCRUX.BIN
	CachePortrait VAMPRESS.BIN

END

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

VIG StartDoorSFX !gg_DOOR_SLIDE_SFX && !DOORSTILL-guild_door
	PlayLoopSFXPerson ig_177.wav P
	Add gg_DOOR_SLIDE_SFX 
END

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

VIG StopDoorSFX gg_DOOR_SLIDE_SFX && DOORSTILL-guild_door
	StopSFX ig_177.wav
	PlaySFXPerson IG_145.WAV P
	Remove gg_DOOR_SLIDE_SFX
END

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

VIG RaalNoise1 FIVESEC && ONMAP-GUILD_SHAD_1 && !ISDEAD-GUILD_SHAD_1 && !INCOMBAT-GUILD_SHAD_1
	SWITCH RAND-3
		CASE 0
			SWITCH RAND-3
				CASE 0
//					PlaySFXPerson Raal1.wav GUILD_SHAD_1
				CASE 1
					PlaySFXPerson Raal2.wav GUILD_SHAD_1
				CASE 2
					PlaySFXPerson Raal9.wav GUILD_SHAD_1
			ENDSWITCH 
	ENDSWITCH
END

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

VIG RaalNoise2 FIVESEC && ONMAP-GUILD_SHAD_2 && !ISDEAD-GUILD_SHAD_2 && !INCOMBAT-GUILD_SHAD_2
	SWITCH RAND-3
		CASE 0
			SWITCH RAND-3
				CASE 0
//					PlaySFXPerson Raal1.wav GUILD_SHAD_2
				CASE 1
					PlaySFXPerson Raal2.wav GUILD_SHAD_2
				CASE 2
					PlaySFXPerson Raal9.wav GUILD_SHAD_2
			ENDSWITCH 
	ENDSWITCH
END

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

VIG LordCruxTalksToLightstealer ONESEC && gt_PLAY_CRUX_VAMP_NOW && !INAREA-P-TEMPLE_ANTEROOM

	Remove gt_PLAY_CRUX_VAMP_NOW
	Add gt_PLAYED_CRUX_VAMP

	PlaceC LIGHTSTEALER pLS
	PlaceC LORDCRUX pCRUX

	EngagePoint GUILD_SHAD_1 p5 500
	AddControl GUILD_SHAD_1 EngagePoint p6 500
	AddControl GUILD_SHAD_1 Engage LORDCRUX 1500
	AddControl GUILD_SHAD_1 Engage GUILD_SHAD_2 500
	AddControl GUILD_SHAD_1 DelayControl 0 1
	AddControl GUILD_SHAD_1 DelayControl 0 1
	AddControl GUILD_SHAD_1 DelayControl 0 1
	AddControl GUILD_SHAD_1 DelayControl 0 1
	SequenceRandomlySelects GUILD_SHAD_1
	SwitchOnSightOfPlayer GUILD_SHAD_1 AttackDemo2

	EngagePoint GUILD_SHAD_2 p6 500
	AddControl GUILD_SHAD_2 EngagePoint p5 500
	AddControl GUILD_SHAD_2 Engage LORDCRUX 1500
	AddControl GUILD_SHAD_2 Engage GUILD_SHAD_1 500
	AddControl GUILD_SHAD_2 DelayControl 0 1
	AddControl GUILD_SHAD_2 DelayControl 0 1
	AddControl GUILD_SHAD_2 DelayControl 0 1
	AddControl GUILD_SHAD_2 DelayControl 0 1
	SequenceRandomlySelects GUILD_SHAD_2
	SwitchOnSightOfPlayer GUILD_SHAD_2 AttackDemo2

	// *** CRUX TALKS TO L.S. ***

	Widescreen TRUE

camnlock 90

setcammoveconstant 50
campan lordcrux

	playmusic rpg26.wav

	UUCameraComplete

	Capture LORDCRUX cM_TALK_QUESTION1
	AddControl LORDCRUX Capture cM_TALK_REFER_SELF1
	AddControl LORDCRUX Capture cM_TALK_REFER_BEHIND1
	//"Master...security...may be jeopardised...an outlander from Madrigal..."
	Say lcex01

	Capture LIGHTSTEALER cM_TALK_DISAGREE1
	AddControl LIGHTSTEALER Capture cM_TALK_REFER_SELF2
	AddControl LIGHTSTEALER Capture cM_TALK_WARNING2
	//"...the shadows...should be...a match for this interloper...he seeks the weapon..."
	Say ghex01 LGHTSTLR.BIN
camcut pos01

	Capture LORDCRUX cM_TALK_QUESTION1
	AddControl LORDCRUX Capture cM_TALK_QUESTION2
	AddControl LORDCRUX Capture cM_TALK_WARNING1
	//"...the bloodkin...prince...has returned..."
	Say lcex02
camcut pos02


	Capture LIGHTSTEALER cM_TALK_CROWD1
	AddControl LIGHTSTEALER Capture cM_TALK_REFER_SELF2
	AddControl LIGHTSTEALER Capture cM_V16_LAUGHING_NORMAL1
	//"...of no significance...let the outlander find the temple."
	Say ghex02 LGHTSTLR.BIN

	Capture LORDCRUX cM_TALK_SURPRISE1

	//"As you command."
	Say lcex03

	//PalFade BLACK

wait 500
camcut P
setcammovenormal

	Widescreen FALSE

	MoveCDir GUILD_SHAD_1 p5
	MoveCDir GUILD_SHAD_2 p6
	RemoveC LIGHTSTEALER
	RemoveC LORDCRUX

	//PalFade RPG
	ChangeProfileToIdentified Sassassin_Crux

END

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

VIG CirceKilled TENSEC && gt_CIRCE_IN_TEMPLE && ISDEAD-CIRCE

	Remove gt_CIRCE_IN_TEMPLE
	RunS VampsAttack

END

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

VIG CirceAttacks ONESEC && gt_P_v_GUILD_PIGS && ((ISDEAD-PIG_BK_1 && ISDEAD-PIG_BK_2) || DAMAGED-CIRCE)

	Remove gt_P_v_GUILD_PIGS
	Remove gt_CIRCE_IN_TEMPLE
	RunS VampsAttack

	//Circe uses the 'Poison Bolt' spell
	//AddCharAction CIRCE 318 offensive 250 2500 10

	GiveSightOfPlayerTo CIRCE
	AttackDemo2 CIRCE

END

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

VIG VampsAttack ONESEC && gt_GUILD_VAMPS_DORMANT && (DAMAGED-GUILD_VAMP_1 || DAMAGED-GUILD_VAMP_2 || DAMAGED-GUILD_VAMP_3 || DAMAGED-GUILD_VAMP_4)

	Remove gt_GUILD_VAMPS_DORMANT
	
	GiveSightOfPlayerTo	GUILD_VAMP_1
	GiveSightOfPlayerTo	GUILD_VAMP_2
	GiveSightOfPlayerTo	GUILD_VAMP_3
	AttackDemo2	GUILD_VAMP_1
	AttackDemo2	GUILD_VAMP_2
	AttackDemo2	GUILD_VAMP_3

END

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

VIG CirceConfrontsPlayer gt_CIRCE_IN_TEMPLE && !gt_P_v_GUILD_PIGS && (DAMAGED-CIRCE || INAREA-P-NEAR_CIRCE)

	FreezeC GUILD_VAMP_1
	FreezeC GUILD_VAMP_2
	FreezeC GUILD_VAMP_3
	FreezeC GUILD_VAMP_4
	FreezeC GUILD_SHAD_1
	FreezeC GUILD_SHAD_2

	// *** CIRCE ATTACKS ***

	Widescreen TRUE

	Engage P CIRCE 1000

	camcut pos10
setcammoveconstant 4
campan pos40
	Capture CIRCE cF_STAND_AT_EASE
	//"Ah, the Warlock...I must destroy you."
	Say vw0001

	IF POS-P-bloodmaster
		Capture CIRCE cF_GREETING_NOD2
		//"...You have the weapon...the bane of Vampires..."
		Say vw0002
	ELSE
		Capture CIRCE cF_STAND_AT_EASE2
		//"You have not even recovered the hammer...Now you shall die..."
		Say vw002a
	ENDIF

	FX_Sprinkle CIRCE
	Capture CIRCE cF_ELSBETH_RAISE_HANDS1
	AddControl CIRCE LookAtTurnFollow P

	Wait 500
camcut pos30
	Capture CAP_BK_1 cM_COWER1
	wait 100
	Capture CAP_BK_2 cM_COWER1

	<< PlaySFXPerson ?bloodkin?scream?.wav CAP_BK_1 >>
	<< PlaySFXPerson ?bloodkin?scream?.wav CAP_BK_2 >>

	Wait 1250

	//oink SFX
	PlaySFXPerson ig_309.wav CAP_BK_1
	wait 100
	PlaySFXPerson ig_309.wav CAP_BK_2

	FX_BurnPerson CAP_BK_1
	wait 100
	FX_BurnPerson CAP_BK_2
	
	Wait 250
	
	Add gt_BK_TO_PIGS
	SwapModel CAP_BK_1 GuildGuardian
	wait 100
	SwapModel CAP_BK_2 GuildGuardian
	SetGoodBad CAP_BK_1 bad
	wait 100
	SetGoodBad CAP_BK_2 bad
	ChangeProfileToIdentified Sbloodkin_Monster

	UUComplete CAP_BK_1
	UUComplete CAP_BK_2

	Capture CIRCE cF_POINTING_INFORMAL
	//"Destroy the Warlock."
	Say vw0003

	GiveSightOfPlayerTo CAP_BK_1
	GiveSightOfPlayerTo CAP_BK_2
	AttackDemo2 CAP_BK_1
	AttackDemo2 CAP_BK_2
camcut p
setcammovenormal
	Widescreen FALSE

	Add gt_P_v_GUILD_PIGS
	UnFreezeC GUILD_VAMP_1
	UnFreezeC GUILD_VAMP_2
	UnFreezeC GUILD_VAMP_3
	UnFreezeC GUILD_VAMP_4
	UnFreezeC GUILD_SHAD_1
	UnFreezeC GUILD_SHAD_2

END

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

VIG ShadowsAttack gt_GUILD_SHADOWS_LURKING && (INAREA-P-NEAR_SWORD || DAMAGED-GUILD_SHAD_1 || DAMAGED-GUILD_SHAD_2)

	Remove gt_GUILD_SHADOWS_LURKING

	GiveSightOfPlayerTo GUILD_SHAD_1
	GiveSightOfPlayerTo GUILD_SHAD_2
	AttackDemo2 GUILD_SHAD_1
	AttackDemo2 GUILD_SHAD_2

END

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

VIG FoundMessenger FIVESEC && !mj_FOUND_MESSENGER && (POS-P-mess2 || POS-P-mess3 || POS-P-mess4)

	Add mj_FOUND_MESSENGER
	IF !gd_DONE_WHITE_MOON_CEREMONY
		AwardEP xp_FOUND_MESSENGER
	ENDIF
	DestroyHexCompass pMESS_2

END

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

