/////////////////////////////////////////////////////////////////////
// FAITH.S
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_CLEAR_MINES && mj_FREED_FARMERS
		Add gt_CLEAR_MINES
	ENDIF

	IF !gd_DONE_PUB && gd_PLACED_BARTH
		//Bart can't STILL be walking to the pub!
		Add gd_DONE_PUB
	ENDIF

	IF !mj_SLEPT_AT_ANDRUS
		IF !gd_PLACED_BART_INTRO
			PlaceC  BARTH pBARTH_INTRO
			Add     gd_PLACED_BART_INTRO

			Add gt_RECENT_MUSIC_IN_MADRIGAL
		ENDIF
	ELSE
		IF gd_PLACED_BART_INTRO
			RemoveC BARTH
			Remove  gd_PLACED_BART_INTRO
		ENDIF
	ENDIF

	IF !mj_BEEN_TO_HEX
		IF gt_FESTIVAL_PREP && !gt_PLACED_FESTIVAL_CHARACTERS

			PlaceC HAMMER pHAMMER_FAITH_STONE
			PlaceC ALLIS pALLIS_FAITH_STONE
			PlaceC ELRIC pELRIC_FAITH_STONE
			PlaceC ALPH pALPH_FAITH_STONE
			PlaceC BARTH pBART_FEST
			SetNoObjInLeftHand BARTH
			UnDrawSword BARTH

			PlaceC FEST_FARMER_1 pFARMER1
			PlaceC FEST_FARMER_2 pFARMER3
			PlaceC FEST_FARMER_3 pFARMER5
			PlaceC FEST_FARMER_4 pFARMER7
			PlaceC FEST_FARMER_5 pFARMER2
			PlaceC FEST_FARMER_6 pFARMER4
			PlaceC FEST_FARMER_7 pFARMER6
			PlaceC FEST_FARMER_8 pFARMER8
			
			Add gt_PLACED_FESTIVAL_CHARACTERS

			Capture HAMMER cM_V16_LAUGHING_GENTLE1
			AddControl HAMMER Capture cM_V16_LAUGHING_GENTLE2
			AddControl HAMMER Capture cM_V16_LAUGHING_NORMAL1
			AddControl HAMMER Capture cM_V16_LAUGHING_NORMAL2
			SequenceRandomlySelects HAMMER
			Capture ALLIS cM_V16_LAUGHING_GENTLE1
			AddControl ALLIS Capture cM_V16_LAUGHING_GENTLE2
			AddControl ALLIS Capture cM_V16_LAUGHING_NORMAL1
			AddControl ALLIS Capture cM_V16_LAUGHING_NORMAL2
			SequenceRandomlySelects ALLIS
			Capture ELRIC cM_V16_LAUGHING_GENTLE1
			AddControl ELRIC Capture cM_V16_LAUGHING_GENTLE2
			AddControl ELRIC Capture cM_V16_LAUGHING_NORMAL1
			AddControl ELRIC Capture cM_V16_LAUGHING_NORMAL2
			SequenceRandomlySelects ELRIC
			Capture ALPH cM_V16_LAUGHING_GENTLE1
			AddControl ALPH Capture cM_V16_LAUGHING_GENTLE2
			AddControl ALPH Capture cM_V16_LAUGHING_NORMAL1
			AddControl ALPH Capture cM_V16_LAUGHING_NORMAL2
			SequenceRandomlySelects ALPH
			Capture BARTH cM_V16_HANDS_HIPS_LOOK_AROUND1
			AddControl BARTH Capture cM_V16_HANDS_HIPS_LOOK_AROUND2
			SequenceRandomlySelects BARTH


			MessagesOff
			QLDelete ql007
			MessagesOn

			Add gt_RECENT_MUSIC_IN_MADRIGAL

		ENDIF
	ELSE
		IF gt_PLACED_FESTIVAL_CHARACTERS

			KillC  FEST_FARMER_1
			KillC  FEST_FARMER_2
			KillC  FEST_FARMER_3
			KillC  FEST_FARMER_4
			KillC  FEST_FARMER_5
			KillC  FEST_FARMER_6
			KillC  FEST_FARMER_7
			KillC  FEST_FARMER_8

			RemoveC HAMMER
			RemoveC ALLIS
			RemoveC ALPH
			Remove gt_PLACED_ALPH
			RemoveC ELRIC
			Remove gt_PLACED_ELRIC

			IF !gd_PLACED_BART_INTRO
				RemoveC BARTH
			ENDIF

			Remove gt_PLACED_FESTIVAL_CHARACTERS
		ENDIF
	ENDIF

	//Madrigal Guards

	IF (!gt_PLACED_FESTIVAL_CHARACTERS || mj_BEEN_TO_HEX) && !mj_DEFEAT_GARGOS_2
		IF !gt_PLACED_MG_CAPT
			Add gt_PLACED_MG_CAPT
			PlaceC MG_CAPT pMG_CAPT
			PlaceC MG_PATA pMG_PAT1
		ENDIF
		RunS MadGuardCaptainOrders
		RunS MadGuardPatrolAOrders
	ELSE
		IF gt_PLACED_MG_CAPT
			Remove gt_PLACED_MG_CAPT
			RemoveC MG_CAPT
			RemoveC MG_PATA
			MessagesOff
			QLDelete ql004
			MessagesOn
		ENDIF
	ENDIF


    // Stage 3
    IF mj_DEFEAT_GARGOS_2
        IF !gd_PLACED_FS_DRAGONS
            Add gd_PLACED_FS_DRAGONS

            PlaceC              FS_DRAGON_1 pFS_DRAGON_1A
            RunS                FS_Setup_Dragon_1

            PlaceC              FS_DRAGON_2 pFS_DRAGON_2
            RunS                FS_Setup_Dragon_2

            PlaceC              FS_DRAGON_3 pFS_DRAGON_3
            RunS                FS_Setup_Dragon_3

            PlaceC              FS_DRAGON_4 pFS_DRAGON_4A
            RunS                FS_Setup_Dragon_4
        ENDIF
		//IF gt_PLACED_MAD_FARMER_1
				//Remove gt_PLACED_MAD_FARMER_1
				//RemoveC MAD_FARMER_1
		//ENDIF
	ELSE
		IF mj_FREED_FARMERS
			IF !gt_PLACED_MAD_FARMER_1
				Add gt_PLACED_MAD_FARMER_1
				PlaceC MAD_FARMER_1 pMADF_1
				Wander MAD_FARMER_1
			ENDIF
		ENDIF
    ENDIF

	//Stage 4
	IF mj_RECOVER_CROWN
		IF !mj_BARTS_ASSAULT
			KillC  FS_DRAGON_1
			KillC  FS_DRAGON_2
			KillC  FS_DRAGON_3
			KillC  FS_DRAGON_4
			KillC MAD_FARMER_1

			PlaceC HAMMER pHAMMER_V_RATS

			PlaceC MAD_DRAGON_1 pMDRAG_1
			PlaceC MAD_DRAGON_2 pMDRAG_2
			PlaceC MAD_DRAGON_3 pMDRAG_3
			PlaceC MAD_DRAGON_4 pMDRAG_4
			PlaceC MAD_DRAGON_5 pMDRAG_5
			PlaceC MAD_DRAGON_6 pMDRAG_6
		ELSE
			IF gt_P_V_BART
				IF !gt_CUE_BART_FIGHT
					Add gt_CUE_BART_FIGHT
					Add gt_NO_MORE_RATS

					PlaceC BARTH pELRIC_FAITH_STONE
					PlaceC RENYA pHAMMER_V_RATS
					MakeHeld RENYA broadsword

					// Move Hammer out of the way so he doesn't get killed
					PlaceC HAMMER pHAMMER_V_RATS

					// Get rid of the rats so they don't muck things up
					KillC  RAT_1
					KillC  RAT_2
					KillC  RAT_3
					KillC  RAT_4
					KillC  RAT_5
					KillC  RAT_6
					KillC  RAT_7
					KillC  RAT_8
					KillC  RAT_9
					KillC  RAT_10
					KillC  RAT_11
					KillC  RAT_12
					KillC  RAT_13
					KillC  RAT_14
					KillC  RAT_15
					KillC  RAT_16
					KillC  RAT_17
					KillC  RAT_18
					KillC  RAT_19
					KillC  RAT_20
					KillC  RAT_21
					KillC  RAT_22
					KillC  RAT_23
					KillC  RAT_24

					RunS EndOfRats

				ENDIF
			ENDIF
		ENDIF
	ENDIF

	IF !gt_RECENT_MUSIC_IN_MADRIGAL
		Add gt_RECENT_MUSIC_IN_MADRIGAL
		PlayMusic RPG18.WAV
	ENDIF

	Add gt_CUE_BART_BREWING

END

VIG TempSetup FALSE

    DisableTeleport FS_HEXSTONE
	IF gt_PLACED_FESTIVAL_CHARACTERS
		Set gd_WEATHER_TYPE 1
	ELSE
		RunS AndrusWeather
	ENDIF
	Set gd_WIND_TYPE	5
    RunS CueWeather

	IF mj_RECOVER_CROWN
		SwapModel HAMMER Hammer5
	ENDIF

	IF gt_P_V_BART
		SwapModel BARTH Barthelago5
	ENDIF
	PlaceFFlys 13696 24500 

END

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

VIG BartBrewing ONESEC && gt_CUE_BART_BREWING

	Remove gt_CUE_BART_BREWING

	IF ISINSHOP-BART_SHOP-mshrm_boom
		DelStock BART_SHOP mshrm_boom
		Stock BART_SHOP explode_bomb 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_hex
		DelStock BART_SHOP herb_hex
		Stock BART_SHOP ptn_mana_l 1
		Stock BART_SHOP ptn_heal_m 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_mana
		DelStock BART_SHOP mshrm_mana
		Stock BART_SHOP ptn_mana_m 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_trippy
		DelStock BART_SHOP mshrm_trippy
		Stock BART_SHOP ptn_trippy 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_poison
		DelStock BART_SHOP mshrm_poison
		Stock BART_SHOP ptn_nomana 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_dpoison
		DelStock BART_SHOP mshrm_dpoison
		Stock BART_SHOP ptn_poison 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_cure
		DelStock BART_SHOP herb_cure
		Stock BART_SHOP ptn_curing 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_str
		DelStock BART_SHOP herb_str
		Stock BART_SHOP ptn_strength 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_mad
		DelStock BART_SHOP mshrm_mad
		Stock BART_SHOP ptn_haste 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_sick
		DelStock BART_SHOP mshrm_sick
		Stock BART_SHOP poison_bomb 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_bigmana
		DelStock BART_SHOP mshrm_bigmana
		Stock BART_SHOP ptn_mana_g 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_bheal
		DelStock BART_SHOP herb_bheal
		Stock BART_SHOP ptn_heal_f 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_magic
		DelStock BART_SHOP herb_magic
		Stock BART_SHOP ptn_mana_f 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_poison
		DelStock BART_SHOP herb_poison
		Stock BART_SHOP ptn_heal_l 1
	ENDIF
	IF ISINSHOP-BART_SHOP-mshrm_acid
		DelStock BART_SHOP mshrm_acid
		Stock BART_SHOP hurt_bomb 1
	ENDIF
	IF ISINSHOP-BART_SHOP-herb_heal
		DelStock BART_SHOP herb_heal
		Stock BART_SHOP ptn_heal_g 1
	ENDIF

END

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

VIG TalkToHammerFinal MSG-iHAMMER && mj_RECOVER_CROWN


	IF mj_BARTS_ASSAULT && !mj_DEFEAT_BART
	QuickSay ha075a HAMMER5.BIN
	ELSE
		Widescreen TRUE
		EngageAndFace P HAMMER
		Say ha075a HAMMER5.BIN
		Widescreen FALSE
	ENDIF

END

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

VIG HorribleDemoBodge1 DEMO_FAITH_1

	Remove DEMO_FAITH_1

	PlaceC HAMMER pHAMMER_V_RATS
	PlaceC MAD_DRAGON_1 pMDRAG_1
	PlaceC MAD_DRAGON_2 pMDRAG_2
	PlaceC MAD_DRAGON_3 pMDRAG_3
	PlaceC MAD_DRAGON_4 pMDRAG_4
	PlaceC MAD_DRAGON_5 pMDRAG_5
	PlaceC MAD_DRAGON_6 pMDRAG_6

	Message "Use scroll on Hex Stone to enable gateway." 10

	AwardOb P bart_scroll "magic-scroll"

END

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

VIG FS_Setup_Dragon_1   FALSE
    AddControl          FS_DRAGON_1 MoveC       pFS_DRAGON_1B
    AddControl          FS_DRAGON_1 MoveC       pFS_DRAGON_1C
    AddControl          FS_DRAGON_1 MoveC       pFS_DRAGON_1B
    AddControl          FS_DRAGON_1 MoveC       pFS_DRAGON_1A
    SequenceLoops       FS_DRAGON_1
	AddFilter			FS_DRAGON_1 CompletesOnDamaged
	AddControl			FS_DRAGON_1 MeleeAttackBLands
END

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

VIG FS_Setup_Dragon_2   FALSE
    WanderNotFar        FS_DRAGON_2 3 12
	AddFilter			FS_DRAGON_2 CompletesOnDamaged
	AddControl			FS_DRAGON_2 MeleeAttackBLands
END

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

VIG FS_Setup_Dragon_3   FALSE
    AddControl          FS_DRAGON_3 Capture     cM_GUARD_STAND1
    AddControl          FS_DRAGON_3 Capture     cM_GUARD_STAND2
    AddControl          FS_DRAGON_3 Capture     cM_GUARD_STAND3
    SequenceRandomlySelects FS_DRAGON_3
	AddFilter			FS_DRAGON_3 CompletesOnDamaged
	AddControl			FS_DRAGON_3 MeleeAttackBLands
END

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

VIG FS_Setup_Dragon_4   FALSE
    AddControl          FS_DRAGON_4 MoveCDir    pFS_DRAGON_4B
    AddControl          FS_DRAGON_4 Capture     cM_GUARD_STAND2
    AddControl          FS_DRAGON_4 MoveCDir    pFS_DRAGON_4A
    AddControl          FS_DRAGON_4 Capture     cM_GUARD_STAND2
    SequenceLoops       FS_DRAGON_4
	AddFilter			FS_DRAGON_4 CompletesOnDamaged
	AddControl			FS_DRAGON_4 MeleeAttackBLands
END

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

VIG TalkToFsDragon1 MSG-iFS_DRAGON_1

	Widescreen TRUE
    StopC           FS_DRAGON_1
    EngageAndFace   FS_DRAGON_1 P
    RunS            TalkToDragonWarrior
    RunS            FS_Setup_Dragon_1
	Widescreen FALSE
END

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

VIG TalkToFsDragon2 MSG-iFS_DRAGON_2

	Widescreen TRUE
    StopC           FS_DRAGON_2
    EngageAndFace   FS_DRAGON_2 P
    RunS            TalkToDragonWarrior
    RunS            FS_Setup_Dragon_2
	Widescreen FALSE
END

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

VIG TalkToFsDragon3 MSG-iFS_DRAGON_3

	Widescreen TRUE
    StopC           FS_DRAGON_3
    EngageAndFace   FS_DRAGON_3 P
    RunS            TalkToDragonWarrior
    RunS            FS_Setup_Dragon_3
	Widescreen FALSE
END

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

VIG TalkToFsDragon4 MSG-iFS_DRAGON_4

	Widescreen TRUE
    StopC           FS_DRAGON_4
    EngageAndFace   FS_DRAGON_4 P
    RunS            TalkToDragonWarrior
    RunS            FS_Setup_Dragon_4
	Widescreen FALSE
END

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

VIG TalkToMadDragon MSG-iMAD_DRAGON_1 || MSG-iMAD_DRAGON_2 || MSG-iMAD_DRAGON_3 || MSG-iMAD_DRAGON_4 || MSG-iMAD_DRAGON_5 || MSG-iMAD_DRAGON_6

	QuickSay ds1057 DWARRIOR.BIN

END

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

VIG TalkToMadFarmer_1 MSG-iMAD_FARMER_1

	Widescreen TRUE
	StopC MAD_FARMER_1
	EngageAndFace P MAD_FARMER_1

	IF mj_DEFEAT_GARGOS_2
		Say faf404 farmerf1.bin
	ELSE
		//"We thank you once more, stranger. We owe you our lives."
		Say fa2002 farmerf1.bin
	ENDIF

	Wander MAD_FARMER_1
	Widescreen FALSE

END

/////////////////////////////////////////////////////////////////////
//
//		M A D R I G A L   G U A R D S
//
/////////////////////////////////////////////////////////////////////

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

VIG MG_PATA_Attacked ONESEC && !gt_MG_CAPT_FIGHT && DAMAGED-MG_PATA

	Add gt_MG_CAPT_FIGHT
	GiveSightOfPlayerTo MG_CAPT
	RunS MadGuardPatrolAOrders
	RunS MadGuardCaptainOrders

END

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

VIG MadGuardPatrolAOrders FALSE

	MoveC MG_PATA pMG_PAT1
	AddControl MG_PATA MoveC pMG_PAT2
	AddControl MG_PATA MoveC pMG_PAT3
	AddControl MG_PATA MoveC pMG_PAT4
	AddControl	MG_PATA	Capture	cM_GUARD_STAND1
	AddControl	MG_PATA	Capture	cM_GUARD_STAND2
	AddControl	MG_PATA	Capture	cM_GUARD_STAND3
	SequenceRandomlySelects MG_PATA
	IF gt_MG_CAPT_FIGHT
		SwitchOnSightOfPlayer MG_PATA AttackDemo2
	ELSE
		SwitchOnSightOfPlayer MG_PATA LookAtTurnFollow P
	ENDIF

END

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

VIG TalkToMadGuardPatrolA MSG-iMG_PATA && !gt_MG_CAPT_FIGHT

	LookAtTurn MG_PATA P
	UUComplete MG_PATA
	IF mj_SLEPT_AT_ANDRUS
		//"Everything's in order here...any questions...Elric..."
		Say mg0008 ADDEPUTY.BIN
	ELSE
		//"You'd best get indoors...brigands...inside the town..."
		Say mg0001 ADDEPUTY.BIN
	ENDIF
	RunS MadGuardPatrolAOrders
END

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

VIG MG_CAPT_Attacked ONESEC && !gt_MG_CAPT_FIGHT && DAMAGED-MG_CAPT

	Add gt_MG_CAPT_FIGHT
	GiveSightOfPlayerTo MG_PATA
	RunS MadGuardPatrolAOrders
	RunS MadGuardCaptainOrders

END

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

VIG MadGuardCaptainOrders FALSE

	Capture		MG_CAPT	cM_GUARD_STAND1
	AddControl	MG_CAPT	Capture	cM_GUARD_STAND2
	AddControl	MG_CAPT	Capture	cM_GUARD_STAND3
	SequenceRandomlySelects MG_CAPT

	IF gt_MG_CAPT_FIGHT
		SwitchOnSightOfPlayer MG_CAPT AttackDemo2
	ELSE
		SwitchOnSightOfPlayer MG_CAPT LookAtFollow P
	ENDIF

END

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

VIG TalkToMadGuardCaptain MSG-iMG_CAPT && !gt_MG_CAPT_FIGHT

	Widescreen TRUE
	UnDrawSwordRemember
	EngageAndFace P MG_CAPT

	IF mj_SLEPT_AT_ANDRUS
		
		IF !gt_MAD_GUARD_DONE && (POS-P-ar_ltr_cl_brig || ISEQUIPED-P-ar_ltr_cl_brig) && gt_MAD_GUARD_STARTED
			//"Good work, stranger. Here's your reward. You can keep the cloak, too."
			Say mg0006 ADDEPUTY.BIN

			Capture MG_CAPT cM_TOSS_GENTLE
			Capture P cM_OBJ_ACCEPT_1H1

			Gold+ P 10

			Add gt_MAD_GUARD_DONE
			AwardEP xp_BRIGAND_CLOAK
			QLRemove ql004

		ELSE
			//"Everything's in order here...any questions...Elric..."
			Say mg0008 ADDEPUTY.BIN
		ENDIF
	ELSE
	

		//Hail, stranger. What are you doing out so late?"
		Say mg0002 ADDEPUTY.BIN

		ResetChoice

		WHILE !MenuExit
			ClearChoices

			//Uncle
			AddChoice 1 txmg01

			//Inn
			AddChoice 2 txmg02

			IF !gt_MAD_GUARD_DONE

				IF !mj_SLEPT_AT_ANDRUS
					//Brigands
					AddChoice 3 txmg03
				ENDIF

				IF (POS-P-ar_ltr_cl_brig || ISEQUIPED-P-ar_ltr_cl_brig) && gt_MAD_GUARD_STARTED
					//Brigand's Cloak
					AddChoice 4 txmg04
				ENDIF
			ENDIF

			//Leave
			AddChoice 0 tx0003

			GetChoice MG_CAPT

			SWITCH Choice
				CASE 1
					//Uncle

					//"Andrus lives out of town - through this gate. Be careful..."
					Say mg0003 ADDEPUTY.BIN

				CASE 2
					//Inn

					MoveCDir MG_CAPT pMG_CAPT
					AddControl MG_CAPT Capture cM_POINT
					AddControl MG_CAPT LookAtTurn P

					//"The inn is off that way..."
					Say mg0004 ADDEPUTY.BIN

					UUComplete MG_CAPT

				CASE 3
					//Brigands

					//"...drive them out...bring...cloak...proof...gold in it for you."
					Say mg0005 ADDEPUTY.BIN

					Add gt_MAD_GUARD_STARTED
					QLAdd ql004 qlt004 qlb004

				CASE 4
					//Brigand Cloak

					//"Good work, stranger. Here's your reward. You can keep the cloak, too."
					Say mg0006 ADDEPUTY.BIN

					Capture MG_CAPT cM_TOSS_GENTLE
					Capture P cM_OBJ_ACCEPT_1H1

					Gold+ P 10

					Add gt_MAD_GUARD_DONE
					QLRemove ql004
					AwardEP xp_BRIGAND_CLOAK
			ENDSWITCH
		ENDWHILE

		//"Be careful out there, stranger."
		Say mg0007 ADDEPUTY.BIN
	ENDIF

	Widescreen FALSE
	RunS MadGuardCaptainOrders

END

/////////////////////////////////////////////////////////////////////
//
//		M E E T   B A R T
//
/////////////////////////////////////////////////////////////////////

VIG MeetBartIntro !f_PLAYED_BART && INAREA-P-BART
	Add     f_PLAYED_BART
	PlaceC  BARTH pBARTH_INTRO
    freecam

	StartRecord

	PlayerControl on
	Widescreen	TRUE
	playmusic rpg25.wav

	// *** START INTRO VIGNETTE WITH BART ***

	camcut arch
	setcammoveconstant 8
	campan start01

    SetInsideLightRadius 1536 5
	SetOutsideLightRadius 2048 5
	MoveCDir	BARTH	pBART_OFF
	camnlock 90
	MoveCDir	P		pP_LOOK_FS
	UUComplete	P

	//Capture		P		cM_LOOK_AROUND_HANDS_HIPS2
	//"Well well..."
	QuickSay			ba001a	BARTH.BIN
	Wait 2500
	LookAtTurnFollow	P		BARTH
	LookAtTurnFollow	BARTH	P
	//UUComplete	BARTH
	UUSay

	camcut play001
	//"Good even sir. Might you know of Andrus?"
	Say			Hx008e

	
	LookAtTurn  BARTH	P
	Wait 500 
	camcut start01
	//"I might."
	Say			ba001b BARTH.BIN

	Wait 500

	MoveCDir	BARTH	pBART_OFF
	Wait		2000

	LookAtTurnFollow	P		BARTH
	
	//"Then do you know where I can find him?"
	QuickSay			Hx008f
	Wait		1000

	StopC		BARTH
	UUSay

	camcut start01	
	MoveCDir	BARTH	pBART_POINT1
	UUComplete	BARTH

	Capture		BARTH	cM_TALK_BECKON_FORWARD1
	//"His cabin's up that way...but...He doesn't like beggars."
	Say	ba001c	BARTH.BIN

	UUComplete	BARTH

	camcut nosign
	MoveCDir	BARTH	pBART_POINT2
	Wait 1500

	//"Sir?"
	Say	Hx008g

	//"If a fire is what you seek...the Inn..."
	QuickSay	ba001d	BARTH.BIN

	Capture		BARTH	cM_TALK_BECKON_FORWARD2
	UUComplete	BARTH

	LookAtTurn  BARTH	P
	UUComplete  BARTH

	UUSay

	Capture		BARTH	cM_SHRUG2
	//"Take my advice or leave it..."
	Say			ba001e	BARTH.BIN

	UUComplete BARTH

	MoveCDir	BARTH	pBART_OFF2
	Wait		2000

	Capture		P		cM_SHRUG1
	AddControl	P	LookAtTurn	MG_PATA
	UUComplete	P

	Capture		MG_PATA	cM_SHRUG1
	UUComplete	MG_PATA
	
	RemoveC		BARTH

	// *** END INTRO VIGNETTE WITH BART ***
	camcut p
	setcammovenormal
	NormalCam
	Widescreen FALSE
	
	//RestoreRadius 0
    RestoreInsideLightRadius 0
	RestoreOutsideLightRadius 0

    // you can now go between the eriv and south square maps.
    IDoorLocked deriv_southsq

	// guard will no longer interfere with vignette, let him wander freely
	RunS MadGuardPatrolAOrders

StopRecord

END

/////////////////////////////////////////////////////////////////////
//
//		F E S T I V A L   O F   L I G H T S
//
/////////////////////////////////////////////////////////////////////

VIG DancingFarmers1 FALSE

	TDCapture FEST_FARMER_1 cF_V16_DANCE_AROUND_POINT1 pDANCE151 100 9 dontplay
	TDCapture FEST_FARMER_2 cF_V16_DANCE_AROUND_POINT1 pDANCE262 100 9 dontplay
	TDCapture FEST_FARMER_3 cF_V16_DANCE_AROUND_POINT1 pDANCE373 100 9 dontplay
	TDCapture FEST_FARMER_4 cF_V16_DANCE_AROUND_POINT1 pDANCE484 100 9 dontplay
	TDCapture FEST_FARMER_5 cF_V16_DANCE_AROUND_POINT1 pDANCE155 100 9 dontplay
	TDCapture FEST_FARMER_6 cF_V16_DANCE_AROUND_POINT1 pDANCE266 100 9 dontplay
	TDCapture FEST_FARMER_7 cF_V16_DANCE_AROUND_POINT1 pDANCE377 100 9 dontplay
	TDCapture FEST_FARMER_8 cF_V16_DANCE_AROUND_POINT1 pDANCE488 100 9 dontplay

END

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

VIG DancingFarmers2 FALSE
	
	UUComplete FEST_FARMER_1
	UUComplete FEST_FARMER_2
	UUComplete FEST_FARMER_3
	UUComplete FEST_FARMER_4
	UUComplete FEST_FARMER_5
	UUComplete FEST_FARMER_6
	UUComplete FEST_FARMER_7
	UUComplete FEST_FARMER_8
	Capture FEST_FARMER_1 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_1 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE151 100 9 dontplay
	Capture FEST_FARMER_2 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_2 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE262 100 9 dontplay
	Capture FEST_FARMER_3 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_3 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE373 100 9 dontplay
	Capture FEST_FARMER_4 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_4 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE484 100 9 dontplay
	Capture FEST_FARMER_5 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_5 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE155 100 9 dontplay
	Capture FEST_FARMER_6 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_6 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE266 100 9 dontplay
	Capture FEST_FARMER_7 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_7 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE377 100 9 dontplay
	Capture FEST_FARMER_8 cF_V16_DANCE_AROUND_POINT1
	AddControl FEST_FARMER_8 TDCapture cF_V16_DANCE_AROUND_POINT3 pDANCE488 100 9 dontplay

END

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

VIG DancingFarmers3 FALSE
	
	UUComplete FEST_FARMER_1
	UUComplete FEST_FARMER_2
	UUComplete FEST_FARMER_3
	UUComplete FEST_FARMER_4
	UUComplete FEST_FARMER_5
	UUComplete FEST_FARMER_6
	UUComplete FEST_FARMER_7
	UUComplete FEST_FARMER_8
	Capture FEST_FARMER_1 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_1 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE151 100 9  dontplay
	Capture FEST_FARMER_2 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_2 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE262 100 9  dontplay
	Capture FEST_FARMER_3 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_3 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE373 100 9  dontplay
	Capture FEST_FARMER_4 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_4 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE484 100 9  dontplay
	Capture FEST_FARMER_5 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_5 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE155 100 9  dontplay
	Capture FEST_FARMER_6 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_6 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE266 100 9  dontplay
	Capture FEST_FARMER_7 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_7 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE377 100 9  dontplay
	Capture FEST_FARMER_8 cF_V16_DANCE_AROUND_POINT3
	AddControl FEST_FARMER_8 TDCapture cF_V16_DANCE_AROUND_POINT2 pDANCE488 100 9  dontplay

END

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

VIG DancingFarmers4 FALSE
	
	UUComplete FEST_FARMER_1
	UUComplete FEST_FARMER_2
	UUComplete FEST_FARMER_3
	UUComplete FEST_FARMER_4
	UUComplete FEST_FARMER_5
	UUComplete FEST_FARMER_6
	UUComplete FEST_FARMER_7
	UUComplete FEST_FARMER_8
	Capture FEST_FARMER_1 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_1 Engage P 800
	Capture FEST_FARMER_5 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_5 Engage P 800

	Capture FEST_FARMER_2 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_2 Engage P 800
	Capture FEST_FARMER_6 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_6 Engage P 800

	Capture FEST_FARMER_3 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_3 Engage P 600
	Capture FEST_FARMER_7 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_7 Engage P 600

	Capture FEST_FARMER_4 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_4 Engage P 600
	Capture FEST_FARMER_8 cF_V16_DANCE_AROUND_POINT2
	AddControl FEST_FARMER_8 Engage P 600

END
/////////////////////////////////////////////////////////////////////

VIG FestivalOfLights gt_FESTIVAL_PREP && !mj_BEEN_TO_HEX

	// This vignette will kick in as soon as the player enters the map

	Widescreen TRUE

	Playmusic rpg10.wav
	// [ANDYR]reset the light radius for repeated viewing of vignette.
	//can be removed ultimately.
	//SetInsideLightRadius 1792 0
	//SetOutsideLightRadius 2560 0

	UnDrawSwordRemember

	//tidy up Mad Guard
	Engage MG_PATA pMG_CAPT 500
		
	// *** FESTIVAL OF LIGHTS BEGINS ***

	camcut p 

	setcammoveconstant 9
	campan pos001

	MoveCDir		P		pP_NEAR_FAITH_STONE
	MoveCDir		ALLIS	pALLIS_NEAR_FAITH_STONE

	RunS DancingFarmers1
	RunS DancingFarmers2

	UUComplete		P
	UUComplete		ALLIS

	//"Ah, hello...welcome...join us..."
	QuickSay ah021b
	LookAtTurnFollow ALLIS P
	RunS DancingFarmers3

	UUSay

	//"...part of Madrigal's heritage..."
	QuickSay ha1029 HAMMER.BIN
	LookAtTurnFollow HAMMER P
	RunS DancingFarmers4

	UUSay

	//"So what is the ceremony?"
	Say hx228b

	LookAtTurn ALLIS P
	LookAtTurn ALPH P

	//"Just walk up to the Stone and make a wish"
	Say ha129a HAMMER.BIN

	MoveCDir		P		pP_NEXT_TO_FAITH_STONE

	LookAtTurn ELRIC P
	//"Wish well..."
	Say el017d
	UUComplete		P

	LookAtTurn		P		ELRIC
	UUComplete		P

	//"Just make a wish?"
	Say hx228d

	//"Yes."
	Say el010b

	LookAtTurn HAMMER P
	//"Aye."
	Say ha129b HAMMER.BIN

	//"Simple enough, lad."
	Say ah021a

	LookAtTurn		P		pFAITH_STONE
	

	MoveCDir BARTH pBART_LEAVE_FEST
	
	//target bathelago's leaving with ArCam04
	FreeCam
	SetCamMoveNormal
	CamCut ArCam04

	LookAtTurnFollow ALPH BARTH
	LookATTurnFollow FEST_FARMER_1 BARTH	
	UUComplete P
	
	//[AndyR] wait until Barthelago is out of sight before doing rest
	wait 4000
	CamCut pos001

	SetInsideLightRadius 256 5
	SetOutsideLightRadius 768 5

	PleaseSteveDontMessWithTheLightingAfterThisVignette
	Add gg_JUST_AFTER_FEST
	PlayerControl Off
//RestoreRadius 0

	Wait 2500

	Add mj_BEEN_TO_HEX
	
	HideTeleportNames
	PostMsg i_FAITH_HEXSTONE

	//[ANDYR] Clean up Camera
	SetCamMoveNormal
	NormalCam

	// *** FESTIVAL OF LIGHTS ENDS ***

END

/////////////////////////////////////////////////////////////////////
//
//		B A R T ' S   A S S A U L T
//
/////////////////////////////////////////////////////////////////////

VIG StartBartsAssault mj_RECOVER_CROWN && !mj_BARTS_ASSAULT

	// it's not my bug but I can certainly fix it...
	IDoorOpen delric1
	
	Freecam

	//Elric is waiting in front of player
	IF INAREA-P-NEAR_ARCH_1
		PlaceC ELRIC pELRIC_RATS_1
		camcut ass01
	ELSE
		IF INAREA-P-NEAR_ARCH_2
			PlaceC ELRIC pELRIC_RATS_2
			camcut ass02
		ELSE
			IF INAREA-P-NEAR_ARCH_3
				PlaceC ELRIC pELRIC_RATS_3
				camcut ass03
			ELSE
				IF INAREA-P-NEAR_ARCH_4
					PlaceC ELRIC pELRIC_RATS_4
					camcut ass04
				ELSE
					IF INAREA-P-NEAR_ARCH_5
						PlaceC ELRIC pELRIC_RATS_5
						camcut ass05
					ELSE
						//must be by the Hex Stone ?
						PlaceC ELRIC pALLIS_FAITH_STONE
						camcut ass11
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF

	Widescreen TRUE

	EngageAndFace ELRIC P 600

	//"...Come, there are others waiting to thank you."
	Say ela401
	UUComplete ELRIC

	// *** traipse over to town hall ***
	MoveC ELRIC pELRIC_BY_HALL
	Wait 1000
	MoveC P pP_BY_HALL

	setcammoveconstant 15
	campan ass06

	AddControl P LookAtTurn ELRIC

	LookAtTurnFollow HAMMER P

	UUComplete ELRIC

	LookAtTurn ELRIC HAMMER

	// *** commence stuffy ceremony ***

	IF mj_DEFEAT_AL && !gt_HAA401

		Add gt_HAA401

		//"...You've done a fine job...killing Al'Kadath."
		Say haa401 HAMMER5.BIN

	ENDIF

	AwardEP xp_BARTS_ASSAULT

	LookAtTurn ELRIC P

	//"We are all proud..."
	Say ela402

	AddControl P LookAtTurn HAMMER

	//"As a representative of Thardolin I..."
	Say haa402 HAMMER5.BIN

	PlayMusic STOP!

	camcut ass07

	PlayLoopSFXPosid IG_195.WAV pFAITH_STONE

	FX_WhiteFireGlow peffect01
	wait 250
	FX_WhiteFireGlow peffect02
	wait 250
	FX_WhiteFireGlow peffect03
	
	Wait 2000

	camcut ass06

	LookAtTurn P pFAITH_STONE
	Wait 150
	LookAtTurn HAMMER pFAITH_STONE
	Wait 100
	LookAtTurn ELRIC pFAITH_STONE

	//"What is that?"
	Say ela403

	// *** Allis comes running from eriv ***
	PlaceC ALLIS pALLIS_V_RATS
	SetWalkType ALLIS RUN
	
	camcut ass08
	campan ass09

	EngagePoint ALLIS pFS_DRAGON_1A 250
	AddControl ALLIS EngagePoint pFS_DRAGON_4B 250
	AddControl ALLIS MoveC_1tel FS_ELRIC_1 pALLIS_IN_HALL

	LookAtTurn P pALLIS_V_RATS
	Wait 50
	LookAtTurn HAMMER pALLIS_V_RATS
	Wait 150
	LookAtTurn ELRIC pALLIS_V_RATS

	//"Help..."
	Say aha401
	Wait 1000
	

	//"Elric...inside..."
	QuickSay haa403 HAMMER5.BIN
	Wait 1000

	MoveC_1tel ELRIC FS_ELRIC_1 pELRIC_AT_HOME

	UUSay
	Wait 2500

	PlaceC RAT_1 pRAT_1
	EngagePoint RAT_1 pELRIC_BY_HALL 1000
	AddControl RAT_1 MeleeAttackBLands
	PlaceC RAT_2 pRAT_2
	EngagePoint RAT_2 pELRIC_BY_HALL 1000
	AddControl RAT_2 MeleeAttackBLands
	PlaceC RAT_3 pRAT_3
	EngagePoint RAT_3 pELRIC_BY_HALL 1000
	AddControl RAT_3 MeleeAttackBLands
	PlaceC RAT_4 pRAT_4
	EngagePoint RAT_4 pELRIC_BY_HALL 1000
	AddControl RAT_4 MeleeAttackBLands
	PlaceC RAT_5 pRAT_5
	EngagePoint RAT_5 pELRIC_BY_HALL 1000
	AddControl RAT_5 MeleeAttackBLands
	PlaceC RAT_6 pRAT_6
	EngagePoint RAT_6 pELRIC_BY_HALL 1000
	AddControl RAT_6 MeleeAttackBLands
	
	//"To arms, men!..."
	QuickSay haa404 HAMMER5.BIN
	Wait 1000

	MeleeAttack MAD_DRAGON_1
	MeleeAttack MAD_DRAGON_2
	MeleeAttack MAD_DRAGON_3
	MeleeAttack MAD_DRAGON_4
	MeleeAttack MAD_DRAGON_5
	MeleeAttack MAD_DRAGON_6
	MeleeAttack HAMMER
	UUSay

	PlayMusic RPG15.WAV

	PlaceC		RAT_7 pRAT_1
	EngagePoint RAT_7 pELRIC_BY_HALL 1000
	AddControl	RAT_7 MeleeAttackBLands
	PlaceC		RAT_8 pRAT_2
	EngagePoint RAT_8 pELRIC_BY_HALL 1000
	AddControl	RAT_8 MeleeAttackBLands
	PlaceC		RAT_9 pRAT_3
	EngagePoint	RAT_9 pELRIC_BY_HALL 1000
	AddControl	RAT_9 MeleeAttackBLands
	PlaceC		RAT_10 pRAT_4
	EngagePoint	RAT_10 pELRIC_BY_HALL 1000
	AddControl	RAT_10 MeleeAttackBLands
	PlaceC		RAT_11 pRAT_5
	EngagePoint	RAT_11 pELRIC_BY_HALL 1000
	AddControl	RAT_11 MeleeAttackBLands
	PlaceC		RAT_12 pRAT_6
	EngagePoint	RAT_12 pELRIC_BY_HALL 1000
	AddControl	RAT_12 MeleeAttackBLands
	
	normalcam
	setcammovenormal
	camcut p
	camnlock 270
	Widescreen FALSE

	Add mj_BARTS_ASSAULT
	QLAdd ql401 qlt401 qlb401
END

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

VIG MoreRats TENSEC && mj_BARTS_ASSAULT && !mj_DEFEAT_BART && !gt_NO_MORE_RATS

	IF !gt_RAT_TIMER
		Set gt_RAT_TIMER 0
	ENDIF

	SWITCH FLAG-gt_RAT_TIMER
		CASE 1
			PlaceC		RAT_13 pRAT_1
			EngagePoint RAT_13 pELRIC_BY_HALL 1000
			AddControl	RAT_13 MeleeAttackBLands
			PlaceC		RAT_14 pRAT_2
			EngagePoint RAT_14 pELRIC_BY_HALL 1000
			AddControl	RAT_14 MeleeAttackBLands
			PlaceC		RAT_15 pRAT_3
			EngagePoint	RAT_15 pELRIC_BY_HALL 1000
			AddControl	RAT_15 MeleeAttackBLands
		CASE 2
			PlaceC		RAT_16 pRAT_4
			EngagePoint	RAT_16 pELRIC_BY_HALL 1000
			AddControl	RAT_16 MeleeAttackBLands
			PlaceC		RAT_17 pRAT_5
			EngagePoint	RAT_17 pELRIC_BY_HALL 1000
			AddControl	RAT_17 MeleeAttackBLands
			PlaceC		RAT_18 pRAT_6
			EngagePoint	RAT_18 pELRIC_BY_HALL 1000
			AddControl	RAT_18 MeleeAttackBLands
		CASE 3
			PlaceC		RAT_19 pRAT_6
			EngagePoint RAT_19 pELRIC_BY_HALL 1000
			AddControl	RAT_19 MeleeAttackBLands
			PlaceC		RAT_20 pRAT_5
			EngagePoint RAT_20 pELRIC_BY_HALL 1000
			AddControl	RAT_20 MeleeAttackBLands
			PlaceC		RAT_21 pRAT_4
			EngagePoint	RAT_21 pELRIC_BY_HALL 1000
			AddControl	RAT_21 MeleeAttackBLands
		CASE 4
			PlaceC		RAT_22 pRAT_3
			EngagePoint	RAT_22 pELRIC_BY_HALL 1000
			AddControl	RAT_22 MeleeAttackBLands
			PlaceC		RAT_23 pRAT_2
			EngagePoint	RAT_23 pELRIC_BY_HALL 1000
			AddControl	RAT_23 MeleeAttackBLands
		CASE 5
			PlaceC		RAT_24 pRAT_1
			EngagePoint	RAT_24 pELRIC_BY_HALL 1000
			AddControl	RAT_24 MeleeAttackBLands
		CASE 6
			Add gt_NO_MORE_RATS
	ENDSWITCH

	AddTo gt_RAT_TIMER 1

END

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

VIG EndOfRats gt_NO_MORE_RATS && !gt_STOPPED_RATS

	IF ISDEAD-RAT_1 && ISDEAD-RAT_2 && ISDEAD-RAT_3 && ISDEAD-RAT_4 && ISDEAD-RAT_5 && ISDEAD-RAT_6
		IF ISDEAD-RAT_7 && ISDEAD-RAT_8 && ISDEAD-RAT_9 && ISDEAD-RAT_10 && ISDEAD-RAT_11 && ISDEAD-RAT_12
			IF ISDEAD-RAT_13 && ISDEAD-RAT_14 && ISDEAD-RAT_15 && ISDEAD-RAT_16 && ISDEAD-RAT_17 && ISDEAD-RAT_18
				IF ISDEAD-RAT_19 && ISDEAD-RAT_20 && ISDEAD-RAT_21 && ISDEAD-RAT_22 && ISDEAD-RAT_23 && ISDEAD-RAT_24
					
					Add gt_STOPPED_RATS

					Wander HAMMER
					
					Filter		MAD_DRAGON_1 Timeout 10 Engage HAMMER 500
					AddControl	MAD_DRAGON_1 LookAtTurnFollow P
					Filter		MAD_DRAGON_2 Timeout 10 Engage HAMMER 500
					AddControl	MAD_DRAGON_2 LookAtTurnFollow P
					Filter		MAD_DRAGON_3 Timeout 10 Engage HAMMER 650
					AddControl	MAD_DRAGON_3 LookAtTurnFollow P
					Filter		MAD_DRAGON_4 Timeout 10 Engage HAMMER 650
					AddControl	MAD_DRAGON_4 LookAtTurnFollow P
					Filter		MAD_DRAGON_5 Timeout 10 Engage HAMMER 800
					AddControl	MAD_DRAGON_5 LookAtTurnFollow P
					Filter		MAD_DRAGON_6 Timeout 10 Engage HAMMER 800
					AddControl	MAD_DRAGON_6 LookAtTurnFollow P
				ENDIF
			ENDIF
		ENDIF
	ENDIF

END

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

VIG FightBart gt_CUE_BART_FIGHT && !gg_BART_IS_FIGHTING

	Add gg_BART_IS_FIGHTING
	

	Widescreen TRUE

	SetWalkType P run
	Engage P BARTH 1000
	SetGoodBad BARTH bad

	wait 2000

	freecam
	camcut db01

	LookAtTurnFollow BARTH P
	Wait 1000

	Say bah401 BARTH5.BIN

	LookAtTurn BARTH pFAITH_STONE
	AddControl BARTH Capture cM_POINT

	QuickSay bah402 BARTH5.BIN

	wait 1000
	FX_HexStone pFAITH_STONE
	FX_WhiteFireGlow peffect01
	wait 250
	FX_WhiteFireGlow peffect02
	wait 250
	FX_WhiteFireGlow peffect03

	UUSay

	SetWalkType RENYA run
	Engage RENYA BARTH 750
	AddControl RENYA MeleeAttack
	LookAtTurnFollow BARTH RENYA
	QuickSay bah403 BARTH5.BIN
	wait 1000
	Capture BARTH cM_TALK_THREATEN1
	UUSay
	Wait 1000

	SetHP RENYA 25
	ChangeProfileToNotDestiny mbloodkin_renya
	DoAction 332 BARTH RENYA
	Wait 5000

	WHILE !ISDEAD-RENYA
		NormalDamageNA RENYA 100
	ENDWHILE

	LookAtTurnFollow BARTH P
	wait 1000
	QuickSay bah404 BARTH5.BIN
	wait 1000
	Capture BARTH cM_TALK_THREATEN1
	UUSay

	wait 2000
	normalcam
	camcut p
	AttackDemo2 BARTH

	playmusic rpg15.wav

	Add f_DISABLE_HEXSTONE_FAITH

	Add gg_BARTS_ATTACKING

	Widescreen FALSE

END

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

VIG BartSeesPlayer TENSEC && gt_P_V_BART && !mj_DEFEAT_BART && !ISDEAD-BARTH

	SWITCH RAND-6
		CASE 0
			GiveSightOfPlayerTo BARTH
		CASE 1
			GiveSightOfPlayerTo BARTH
		CASE 2
		CASE 3
		CASE 4
		CASE 5
	ENDSWITCH

END

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

VIG DeathOfBart gt_P_V_BART && !mj_DEFEAT_BART && ISDEAD-BARTH

	Widescreen TRUE

	Engage MAD_DRAGON_1 P 1000
	Engage MAD_DRAGON_2 P 1000
	Engage MAD_DRAGON_3 P 1250
	Engage MAD_DRAGON_4 P 1250
	Engage MAD_DRAGON_5 P 1500
	Engage MAD_DRAGON_6 P 1500
	Say dsmd01 DWARREVL.BIN
	Say hxba20
	Say dsmd02 DWARREVL.BIN

	Add mj_DEFEAT_BART
	AwardEP xp_DEFEAT_BART
	Remove f_DISABLE_HEXSTONE_FAITH
	SetCharSet eriv ER2

	MessagesOff
	QLRemove ql009
	MessagesOn
	QLRemove ql401

	Widescreen FALSE

END

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

VIG DRBart MSG-DR_BART

	IF !gt_PLAYED_DR_BART

		Widescreen TRUE

		Add gt_PLAYED_DR_BART

		Say bad401 BARTH5.BIN

		ResetChoice
		WHILE !MenuExit
			ClearChoices

			AddChoice 1 txlb08
			AddChoice 2 tx0025
			AddChoice 3 txel42
			AddChoice 0 tx0003

			GetChoice BARTH BARTH5.BIN

			SWITCH Choice
				CASE 3
					Say bad402 BARTH5.BIN
				CASE 2
					Say bad403 BARTH5.BIN
				CASE 1
					Say bad404 BARTH5.BIN
			ENDSWITCH
		ENDWHILE

		IF POS-P-stake
			QuickSay hxs405
			EngageAndFace P BARTH
			UUComplete P
			UUSay
			Capture P cM_STAKE_1
			Say bad405 BARTH5.BIN
			wait 1000
			FX_HexStake BARTH
			Add f_BART_DEAD
			AwardEP xp_BART_DEAD
			UUComplete P
			DeleteObjectsInBackpackWithID P stake 1
			Wait 1000
		ELSE
			Say bad406 BARTH5.BIN
		ENDIF

		Widescreen FALSE
	ELSE
		Runs DR_GENERIC_FAIL
	ENDIF
END

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

VIG TeleportToMiresPit MSG-BART_SCROLL_ON_FAITHSTONE

	FreeCam
	SetCamMoveConstant 20
	CamNLock 270
	CamPan pP_FAITH_HEX

	DeleteObjectsInBackpackWithID P bart_scroll

	Widescreen TRUE

	QLRemove ql402
	Add mj_ACTIVATE_GATEWAY
	AwardEP xp_ACTIVATE_GATEWAY

	EngagePoint P pP_FAITH_HEX 750

	Set gt_MIRES_PIT_TELEPORTS 0

	WHILE gt_MIRES_PIT_TELEPORTS<10

		IF CC-P
			Capture P cM_CAST_SPELL20_MISC
			FX_Sprinkle P
			IF !gt_NOW_DEPARTING
				Add gt_NOW_DEPARTING
				IF ISDEAD-MAD_DRAGON_1
					RemoveC MAD_DRAGON_1
					ResetStats MAD_DRAGON_1
					PlaceC MAD_DRAGON_1 pMDRAG_1
				ENDIF
				SetWalkType MAD_DRAGON_1 run
				SetWalkType MAD_DRAGON_2 run
				SetWalkType MAD_DRAGON_3 run
				SetWalkType MAD_DRAGON_4 run
				SetWalkType MAD_DRAGON_5 run
				SetWalkType MAD_DRAGON_6 run
				EngagePoint MAD_DRAGON_1 pP_FAITH_HEX 500
				EngagePoint MAD_DRAGON_2 pP_FAITH_HEX 500
				EngagePoint MAD_DRAGON_3 pP_FAITH_HEX 500
				EngagePoint MAD_DRAGON_4 pP_FAITH_HEX 500
				EngagePoint MAD_DRAGON_5 pP_FAITH_HEX 500
				EngagePoint MAD_DRAGON_6 pP_FAITH_HEX 500
				EngagePoint HAMMER pP_FAITH_HEX 500
			ENDIF
		ENDIF
		IF gt_NOW_DEPARTING
			IF !ISDEAD-HAMMER && CC-HAMMER
				FX_GreenFire HAMMER
				RemoveC HAMMER
				AddTo gt_MIRES_PIT_TELEPORTS 3
			ENDIF
			IF !ISDEAD-MAD_DRAGON_1 && CC-MAD_DRAGON_1
				FX_GreenFire MAD_DRAGON_1
				RemoveC MAD_DRAGON_1
				PlaceC MAD_DRAGON_1 pMDRAG_1
				EngagePoint MAD_DRAGON_1 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
			IF !ISDEAD-MAD_DRAGON_2 && CC-MAD_DRAGON_2
				FX_GreenFire MAD_DRAGON_2
				RemoveC MAD_DRAGON_2
				PlaceC MAD_DRAGON_2 pMDRAG_2
				EngagePoint MAD_DRAGON_2 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
			IF !ISDEAD-MAD_DRAGON_3 && CC-MAD_DRAGON_3
				FX_GreenFire MAD_DRAGON_3
				RemoveC MAD_DRAGON_3
				PlaceC MAD_DRAGON_3 pMDRAG_3
				EngagePoint MAD_DRAGON_3 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
			IF !ISDEAD-MAD_DRAGON_4 && CC-MAD_DRAGON_4
				FX_GreenFire MAD_DRAGON_4
				RemoveC MAD_DRAGON_4
				PlaceC MAD_DRAGON_4 pMDRAG_4
				EngagePoint MAD_DRAGON_4 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
			IF !ISDEAD-MAD_DRAGON_5 && CC-MAD_DRAGON_5
				FX_GreenFire MAD_DRAGON_5
				RemoveC MAD_DRAGON_5
				PlaceC MAD_DRAGON_5 pMDRAG_5
				EngagePoint MAD_DRAGON_5 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
			IF !ISDEAD-MAD_DRAGON_6 && CC-MAD_DRAGON_6
				FX_GreenFire MAD_DRAGON_6
				RemoveC MAD_DRAGON_6
				PlaceC MAD_DRAGON_6 pMDRAG_6
				EngagePoint MAD_DRAGON_6 pP_FAITH_HEX 500
				AddTo gt_MIRES_PIT_TELEPORTS 1
			ENDIF
		ENDIF
		Wait 250
		IF gt_MIRES_PIT_TELEPORTS>5 && !gt_MIRES_FADEOUT
			Add gt_MIRES_FADEOUT
			RunS QPalFadeBLACK
		ENDIF

	ENDWHILE

	UUFade		

	SetCamMoveNormal
	NormalCam
	CamCut P

	RemoveC MAD_DRAGON_1
	RemoveC MAD_DRAGON_2
	RemoveC MAD_DRAGON_3
	RemoveC MAD_DRAGON_4
	RemoveC MAD_DRAGON_5
	RemoveC MAD_DRAGON_6
	RemoveC HAMMER

	PostMsg t_MP_GT

END

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