/////////////////////////////////////////////////////////////////////
// RAVINT1.S
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_PLACED_RAV_SEWER_DENIZENS
		Add gt_PLACED_RAV_SEWER_DENIZENS

		PlaceC RKI_SKEL_1 pRKI_SKEL_1
        AddControl  RKI_SKEL_1   Capture cM_GUARD_STAND1
        AddControl  RKI_SKEL_1   Capture cM_GUARD_STAND2
        AddControl  RKI_SKEL_1   Capture cM_GUARD_STAND3
        SequenceRandomlySelects   RKI_SKEL_1
        SwitchOnSightOfPlayer     RKI_SKEL_1 SetScriptFlagControl gd_RKI_SKEL_12_RUMBLE

		PlaceC RKI_SKEL_2 pRKI_SKEL_2
        AddControl  RKI_SKEL_2   Capture cM_GUARD_STAND1
        AddControl  RKI_SKEL_2   Capture cM_GUARD_STAND2
        AddControl  RKI_SKEL_2   Capture cM_GUARD_STAND3
        SequenceRandomlySelects   RKI_SKEL_2
        SwitchOnSightOfPlayer     RKI_SKEL_2 SetScriptFlagControl gd_RKI_SKEL_22_RUMBLE

		PlaceC RKI_SKEL_3 pRKI_SKEL_3
        RestrictedWanderButAttackOnSight  RKI_SKEL_3

		PlaceC RKI_SKEL_4 pRKI_SKEL_4
        AddControl  RKI_SKEL_4   Capture cM_GUARD_STAND1
        AddControl  RKI_SKEL_4   Capture cM_GUARD_STAND2
        AddControl  RKI_SKEL_4   Capture cM_GUARD_STAND3
        SequenceRandomlySelects   RKI_SKEL_4
        SwitchOnSightOfPlayer     RKI_SKEL_4    AttackDemo2

		PlaceC RKI_SKEL_5 pRKI_SKEL_5
        AddControl  RKI_SKEL_5  MoveC   pRKI_SKEL_5
        AddControl  RKI_SKEL_5  Capture cM_GUARD_STAND2
        AddControl  RKI_SKEL_5  MoveC   pRKI_SKEL_5A
        AddControl  RKI_SKEL_5  Capture cM_GUARD_STAND2
        SequenceLoops   RKI_SKEL_5
        SwitchOnSightOfPlayer   RKI_SKEL_5  AttackDemo2

		PlaceC RKI_BODY_1 pRKI_BODY_1
        AddControl  RKI_BODY_1  MoveCDir   pRKI_BODY_1
        AddControl  RKI_BODY_1  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_1  MoveCDir   pRKI_BODY_1A
        AddControl  RKI_BODY_1  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_1  MoveCDir   pRKI_BODY_1B
        AddControl  RKI_BODY_1  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_1  MoveCDir   pRKI_BODY_1C
        AddControl  RKI_BODY_1  Capture cM_GUARD_STAND2
        SequenceRandomlySelects RKI_BODY_1
        SwitchOnSightOfPlayer   RKI_BODY_1  AttackDemo2

		PlaceC RKI_BODY_2 pBODY_2
        RestrictedWanderButAttackOnSight  RKI_BODY_2

		PlaceC RKI_BODY_3 pBODY_3
        AddControl  RKI_BODY_3  MoveCDir   pRKI_BODY_3
        AddControl  RKI_BODY_3  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_3  MoveCDir   pRKI_BODY_3A
        AddControl  RKI_BODY_3  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_3  MoveCDir   pRKI_BODY_3B
        AddControl  RKI_BODY_3  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_3  MoveCDir   pRKI_BODY_3C
        AddControl  RKI_BODY_3  Capture cM_GUARD_STAND2
        SequenceRandomlySelects RKI_BODY_3
        SwitchOnSightOfPlayer   RKI_BODY_3  AttackDemo2

		PlaceC RKI_BODY_4 pRKI_BODY_4
        AddControl  RKI_BODY_4  MoveC   pRKI_BODY_4
        AddControl  RKI_BODY_4  Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_4  MoveC   pRKI_BODY_4A
        AddControl  RKI_BODY_4  Capture cM_GUARD_STAND2
        SequenceLoops   RKI_BODY_4
        SwitchOnSightOfPlayer   RKI_BODY_4  AttackDemo2

		PlaceC RKI_BODY_5 pRKI_BODY_5
        AddControl  RKI_BODY_5   Capture cM_GUARD_STAND1
        AddControl  RKI_BODY_5   Capture cM_GUARD_STAND2
        AddControl  RKI_BODY_5   Capture cM_GUARD_STAND3
        SequenceRandomlySelects   RKI_BODY_5
        SwitchOnSightOfPlayer     RKI_BODY_5 AttackDemo2

		// *** ELSEBTHS SHADE ***

		PlaceC ELSBETH pELSBETH_MEET_WARLOCK
		MakeInvisible ELSBETH
		//pELSBETH_START

		RemoveC ELSBETH_GARG_1
		RemoveC ELSBETH_GARG_2
		RemoveC ELSBETH_GARG_3
		RemoveC ELSBETH_GARG_4

		// *** ELSBETHS BODY ***
		PlaceC  ELSBETH_BODY pELSBETH_BODY
        Capture ELSBETH_BODY cF_TALK_THEN_DIE

		// *** SEWER SPIDERS ***
		PlaceC RAV_SPIDER_1 pSP_1
		PlaceC RAV_SPIDER_2 pSP_2
		PlaceC RAV_SPIDER_3 pSP_3
		PlaceC RAV_SPIDER_4 pSP_4

		RestrictedWanderButAttackOnSight RAV_SPIDER_1
		RestrictedWanderButAttackOnSight RAV_SPIDER_2
		RestrictedWanderButAttackOnSight RAV_SPIDER_3
		RestrictedWanderButAttackOnSight RAV_SPIDER_4

	ENDIF

	IF f_BISHOP_DEAD
		KillC ELSBETH
		KillC ELSBETH_BODY
	ENDIF

END

VIG TempSetup FALSE

	SetWeather 0 0 0 0 0 0 0 0

	CachePortrait ELSBETH.BIN
	CachePortrait PC1.BIN

END

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

VIG Skel12Attack    ONESEC && gd_RKI_SKEL_12_RUMBLE && !gd_RKI_SKEL_12_ATTACK
    IF !ISDEAD-RKI_SKEL_1
        AttackDemo2 RKI_SKEL_1
    ENDIF
    IF !ISDEAD-RKI_SKEL_2
        AttackDemo2 RKI_SKEL_2
    ENDIF
    Add gd_RKI_SKEL_12_ATTACK
END

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

VIG MeetElsbeth HALFSEC && !gt_MEET_EL_SHADE && DISTFROM-P-ELSBETH-8

	Widescreen TRUE

	Playmusic rpg13.wav		
	// *** Start of meeting with Elsbeths shade ***

	Freecam

StartRecord
	Camcut pos01
	SetCamMoveConstant 3
	Campan pos03

	MoveCDir P pP_MEET_ELSBETH
	UUComplete P

	SamplesOff
	FX_Visible ELSBETH
	SamplesOn
	Face	P	ELSBETH 
	Wait 500
	//Elsbeth reaches for player
	Capture ELSBETH cF_OBJ_ACCEPT_1H1
	Wait 250

	//Player flinches
	Capture P cM_TALK_SURPRISE1
	Wait 750

	//"Please, do not turn from me...I am Elsbeth...I beseech your aid...help you find the Staff."
	Say er0001
	ChangeProfileToIdentified Rcitizen_ElsbethGhost

	Set gt_EL_TALK_COUNT 0
        
	Camcut pos03

	ResetChoice
	WHILE !MenuExit
		ClearChoices
		
		//Aid
		AddChoice 1 txer01

		//The Staff
		AddChoice 2 txer02

		//Temple of Shadows
		AddChoice 3 tx0015

		//Bishop Mortan
		AddChoice 4 txer04

		GetChoice ELSBETH

		//If the player attempts to ask about a third thing, gargoyles attack

		SWITCH Choice
			CASE 1
				//Aid

				AddTo gt_EL_TALK_COUNT 1
				//"...find my still-living body and destroy it...use the magic of fire..."
				ChangeProfileToIdentified Rcitizen_ElsbethBody
				QLAdd ql014 qlt014 qlb014
				Add gt_EL_BOOTOUT_OK
				Say er0002
			CASE 2
				//The Staff

				AddTo gt_EL_TALK_COUNT 1
				//"The Staff of Lore...powerful...dangerous...the source of Mortan's corruption."
				Say er002a
			CASE 3
				//Temple Of Shadows

				AddTo gt_EL_TALK_COUNT 1
				//"...where Bishop Mortan resides...Be wary within...my body...is in the sewers..."
				ChangeProfileToIdentified Rcitizen_ElsbethBody
				Say er0003
			CASE 4
				//Bishop Mortan

				AddTo gt_EL_TALK_COUNT 1
				//"It is Mortan who keeps me from death...as my body lives, he can never truly die..."
				ChangeProfileToIdentified Rcitizen_ElsbethBody
				Say er0004
			CASE 0
				Remove gt_EL_TALK_COUNT
		ENDSWITCH

		IF gt_EL_TALK_COUNT>2 && gt_EL_BOOTOUT_OK
			SetChoiceToExit
		ENDIF
	ENDWHILE

	Add gt_MEET_EL_SHADE

	//"Wait. Mortan's servants approach. I must hide..."
	Say er0005
	
	SamplesOff
	FX_Invisible ELSBETH
	SamplesOn

	SetCamMoveConstant 3
	Campan pos04

	PlaceC ELSBETH_GARG_1 pGARG1_START
	PlaceC ELSBETH_GARG_2 pGARG2_START
	PlaceC ELSBETH_GARG_3 pGARG3_START
	PlaceC ELSBETH_GARG_4 pGARG4_START

	//"behind you!"
	LookAtTurn P pGARG3_START

	Wait 1000
	SetCamMoveConstant 70
	Campan pos05
	
	Wait 1000

	SetCamMoveConstant 1
	Campan pos06

	//gargoyles fan out
	MoveCDir ELSBETH_GARG_1 pGARG1_ATTACK
	MoveCDir ELSBETH_GARG_2 pGARG2_ATTACK
	MoveCDir ELSBETH_GARG_3 pGARG3_ATTACK
	MoveCDir ELSBETH_GARG_4 pGARG4_ATTACK

	//let gargoyles get into formation before attacking
	Wait 2500

	AttackDemo2 ELSBETH_GARG_1
	AttackDemo2 ELSBETH_GARG_2
	AttackDemo2 ELSBETH_GARG_3
	AttackDemo2 ELSBETH_GARG_4
	KillC ELSBETH

	// *** End of meeting with Elsbeths shade ***
	
	//[AndyR] wait for gargoyles to advance a bit then 
	//        clean up camera & return player control

	Wait 2000
	SetCamMoveNormal
	NormalCam
	Camcut p 240

	Widescreen FALSE

StopRecord

END

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

VIG DR_Elsbeth MSG-DR_ELSBETH_BODY && !gt_DR_EL_BODY

	Add gt_DR_EL_BODY

	IF !f_ELSBETH_FREED
		//"The spirit is not present - a magical force keeps this body alive."
		QuickSay Hxdre1
	ENDIF

END

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

VIG BurnElsbeth ELSBETH_BURNT && !f_ELSBETH_FREED

	IF gt_MEET_EL_SHADE
		QLRemove ql014
		AwardEP xp_ELSBETH_FREED
	ELSE
		//no more ghost
		KillC ELSBETH
		Add gt_MEET_EL_SHADE
	ENDIF

	//"Thank you, Soulbringer...Now, Mortan will be weakened."
	QuickSay erbody

	Add f_ELSBETH_FREED
END

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

VIG ClickElsbethsBody  MSG-iELSBETH_BODY
    MoveCDir        P           pPROD
    AddControl      P           SetScriptFlagControl    gg_APPROACHED_BODY
END

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

VIG ElsbethsBodyMcap gg_APPROACHED_BODY
    Remove		gg_APPROACHED_BODY
	Capture		P cM_SHRUG1
END

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