/////////////////////////////////////////////////////////////////////
// BLANDS.S
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_BLOODLAND_PROGRESS

		PlaceC BANE pBANE_1
		PlaceC BLAND_BKIN_A1 pBK1_A1
		PlaceC BLAND_BKIN_A2 pBK1_A2
		PlaceC BLAND_BKIN_A3 pBK1_A3
		PlaceC BLAND_BKIN_B1 pBK1_B1
		PlaceC BLAND_BKIN_B2 pBK1_B2
		PlaceC BLAND_BKIN_B3 pBK1_B3
		PlaceC BLAND_BKIN_C1 pBK1_C1
		PlaceC BLAND_BKIN_C2 pBK1_C2
		PlaceC BLAND_BKIN_C3 pBK1_C3
		PlaceC BLAND_BKIN_D1 pBK1_D1
		PlaceC BLAND_BKIN_D2 pBK1_D2
		PlaceC BLAND_BKIN_D3 pBK1_D3
		PlaceC BLAND_EVIL_02 pBAD1_02
		PlaceC BLAND_EVIL_03 pBAD1_03
		PlaceC BLAND_EVIL_04 pBAD1_04
		PlaceC BLAND_EVIL_05 pBAD1_05
		PlaceC BLAND_EVIL_07 pBAD1_07
		PlaceC BLAND_EVIL_08 pBAD1_08
		PlaceC BLAND_EVIL_09 pBAD1_09
		PlaceC BLAND_EVIL_10 pBAD1_10
		PlaceC BLAND_EVIL_12 pBAD1_12

		Set gt_BLOODLAND_PROGRESS 0

		// *** player positioning fudges ***
		RemoveC P
		PlaceC P pP1
		camcut P

	ELSE
		IF DEMO_BLANDS_2

			Set gt_BLOODLAND_PROGRESS 2
			PlaceC BANE pBANE_2
			PlaceC BLAND_BKIN_A1 pBK2_A1
			PlaceC BLAND_BKIN_A2 pBK2_A2
			PlaceC BLAND_BKIN_A3 pBK2_A3
			PlaceC BLAND_BKIN_B1 pBK2_B1
			PlaceC BLAND_BKIN_B2 pBK2_B2
			PlaceC BLAND_BKIN_B3 pBK2_B3
			PlaceC BLAND_BKIN_C1 pBK2_C1
			PlaceC BLAND_BKIN_C2 pBK2_C2
			PlaceC BLAND_BKIN_C3 pBK2_C3
			PlaceC BLAND_BKIN_D1 pBK2_D1
			PlaceC BLAND_BKIN_D2 pBK2_D2
			PlaceC BLAND_BKIN_D3 pBK2_D3
			RemoveC P
			PlaceC P pP2
			camcut P

		ELSE
			IF DEMO_BLANDS_3

				Set gt_BLOODLAND_PROGRESS 6
				PlaceC BANE pBANE_3
				PlaceC BLAND_BKIN_A1 pBK3_A1
				PlaceC BLAND_BKIN_A2 pBK3_A2
				PlaceC BLAND_BKIN_A3 pBK3_A3
				PlaceC BLAND_BKIN_B1 pBK3_B1
				PlaceC BLAND_BKIN_B2 pBK3_B2
				PlaceC BLAND_BKIN_B3 pBK3_B3
				PlaceC BLAND_BKIN_C1 pBK3_C1
				PlaceC BLAND_BKIN_C2 pBK3_C2
				PlaceC BLAND_BKIN_C3 pBK3_C3
				PlaceC BLAND_BKIN_D1 pBK3_D1
				PlaceC BLAND_BKIN_D2 pBK3_D2
				PlaceC BLAND_BKIN_D3 pBK3_D3
				RemoveC P
				PlaceC P pP3
				camcut P

			ELSE
				IF DEMO_BLANDS_4

					Set gt_BLOODLAND_PROGRESS 8
					PlaceC BANE pBANE_4
					PlaceC BLAND_BKIN_A1 pBK4_A1
					PlaceC BLAND_BKIN_A2 pBK4_A2
					PlaceC BLAND_BKIN_A3 pBK4_A3
					PlaceC BLAND_BKIN_B1 pBK4_B1
					PlaceC BLAND_BKIN_B2 pBK4_B2
					PlaceC BLAND_BKIN_B3 pBK4_B3
					PlaceC BLAND_BKIN_C1 pBK4_C1
					PlaceC BLAND_BKIN_C2 pBK4_C2
					PlaceC BLAND_BKIN_C3 pBK4_C3
					PlaceC BLAND_BKIN_D1 pBK4_D1
					PlaceC BLAND_BKIN_D2 pBK4_D2
					PlaceC BLAND_BKIN_D3 pBK4_D3
					RemoveC P
					PlaceC P pP4
					camcut P

				ELSE

					IF gt_BLOODLAND_PROGRESS<20
						Set gt_BLOODLAND_PROGRESS 20

						RemoveC BANE
						RemoveC BLAND_BKIN_A1
						RemoveC BLAND_BKIN_A2
						RemoveC BLAND_BKIN_A3
						RemoveC BLAND_BKIN_B1
						RemoveC BLAND_BKIN_B2
						RemoveC BLAND_BKIN_B3
						RemoveC BLAND_BKIN_C1
						RemoveC BLAND_BKIN_C2
						RemoveC BLAND_BKIN_C3
						RemoveC BLAND_BKIN_D1
						RemoveC BLAND_BKIN_D2
						RemoveC BLAND_BKIN_D3

						RunS RegenerateEvilChars
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF

	Add gg_FROMSETUP
END

VIG TempSetup FALSE

	//Set	gd_WEATHER_TYPE	0
	Set	gd_WEATHER_TYPE	1
	Set gd_WIND_TYPE	2
    RunS CueWeather

	IF !gg_FROMSETUP
		playloopedmusic rpg23.wav
	ENDIF

	CachePortrait LORDBANE.BIN
	CachePortrait CREDO.BIN

END

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

VIG RemoveAFlag gg_FROMSETUP
	Remove gg_FROMSETUP
END

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

VIG HorriblyBodgyDemoMessages FIVESEC && DEMO_BLANDS_2 || DEMO_BLANDS_3 || DEMO_BLANDS_4

	Remove DEMO_BLANDS_2
	Remove DEMO_BLANDS_3
	Remove DEMO_BLANDS_4
	Message "These characters could be anywhere after that last battle..." 10

END

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

VIG MoveToAmbushOne gt_BLOODLAND_PROGRESS=0

	Set gt_BLOODLAND_PROGRESS 1

	Widescreen TRUE

camcut BANE 45
	// *** march to first battle ***

	MoveC BANE pBANE_2

	Wait 500
	MoveCDir P pP2
	Wait 500

	MoveCDir BLAND_BKIN_A1 pBK2_A1
	MoveCDir BLAND_BKIN_A2 pBK2_A2
	MoveCDir BLAND_BKIN_A3 pBK2_A3
	Wait 500
	MoveCDir BLAND_BKIN_B1 pBK2_B1
	MoveCDir BLAND_BKIN_B2 pBK2_B2
	MoveCDir BLAND_BKIN_B3 pBK2_B3
	Wait 500
	MoveCDir BLAND_BKIN_C1 pBK2_C1
	MoveCDir BLAND_BKIN_C2 pBK2_C2
	MoveCDir BLAND_BKIN_C3 pBK2_C3
	Wait 500
	MoveCDir BLAND_BKIN_D1 pBK2_D1
	MoveCDir BLAND_BKIN_D2 pBK2_D2
	MoveCDir BLAND_BKIN_D3 pBK2_D3
	Wait 500

	UUComplete BANE 100
StartRecord
	Capture		BANE cM_HOLD_OBJ_ALOFT1
	AddControl	BANE LookAtTurn	pBAD1_03

	//"Slowly, my friends. I sense some malevolence here."
	Say lb0025
//camcut p 220
	// *** bad guys form a line on the crest of the hill ***

	MoveCDir BLAND_EVIL_03 pINT_03
	MoveCDir BLAND_EVIL_04 pINT_04
	LookAtTurn BLAND_BKIN_A1 pBAD1_03
	LookAtTurn BLAND_BKIN_B1 pBAD1_03
	LookAtTurn BLAND_BKIN_D1 pBAD1_03
	Wait 100
	MoveCDir BLAND_EVIL_02 pINT_02
	MoveCDir BLAND_EVIL_05 pINT_05
	LookAtTurn BLAND_BKIN_A2 pBAD1_03
	LookAtTurn BLAND_BKIN_C2 pBAD1_03
	LookAtTurn BLAND_BKIN_A3 pBAD1_03
	Wait 100
	LookAtTurn BLAND_BKIN_C1 pBAD1_03
	LookAtTurn BLAND_BKIN_B3 pBAD1_03
	LookAtTurn BLAND_BKIN_C3 pBAD1_03
	Wait 100
	MoveCDir BLAND_EVIL_07 pINT_07
	MoveCDir BLAND_EVIL_10 pINT_10
	LookAtTurn BLAND_BKIN_D3 pBAD1_03
	LookAtTurn BLAND_BKIN_B2 pBAD1_03
	Wait 100
	MoveCDir BLAND_EVIL_08 pINT_08
	LookAtTurn BLAND_BKIN_D2 pBAD1_03
	Wait 100
	MoveCDir BLAND_EVIL_09 pINT_09
	MoveCDir BLAND_EVIL_12 pINT_12

Wait 2000
//moved down...
camcut p 220

	UUComplete BLAND_EVIL_12

	//"Bloodkin to arms! The battle is begun!"
	Say lb0026

	// *** START OF FIRST BATTLE ***
	playloopedmusic rpg23.wav

	EngagePoint	BLAND_BKIN_A1 pINT_10 1150
	AddControl	BLAND_BKIN_A1 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_D1 pINT_09 1150
	AddControl	BLAND_BKIN_D1 StaticMeleeAttackBLands
	EngagePoint BLAND_BKIN_B1 pINT_03 1150
	AddControl	BLAND_BKIN_B1 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_C1 pINT_06 1150
	AddControl	BLAND_BKIN_C1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_A2 pINT_11 1150
	AddControl	BLAND_BKIN_A2 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_D2 pINT_08 1150
	AddControl	BLAND_BKIN_D2 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_B2 pINT_02 1150
	AddControl	BLAND_BKIN_B2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C2 pINT_05 1150
	AddControl	BLAND_BKIN_C2 StaticMeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_A3 pINT_12 1150
	AddControl	BLAND_BKIN_A3 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_B3 pINT_01 1150
	AddControl	BLAND_BKIN_B3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C3 pINT_04 1150
	AddControl	BLAND_BKIN_C3 MeleeAttackBLands
	Wait 75
	EngagePoint BLAND_BKIN_D3 pINT_07 1150
	AddControl	BLAND_BKIN_D3 StaticMeleeAttackBLands
	Wait 75
	MeleeAttackBLands BLAND_EVIL_03
	MeleeAttackBLands BLAND_EVIL_04
	Wait 75
	MeleeAttackBLands BLAND_EVIL_02
	MeleeAttackBLands BLAND_EVIL_05
	Wait 75
	Wait 75
	StaticMeleeAttackBLands BLAND_EVIL_07
	StaticMeleeAttackBLands BLAND_EVIL_10
	Wait 75
	MeleeAttackBLands BLAND_EVIL_08
	Wait 75
	MeleeAttackBLands BLAND_EVIL_09
	StaticMeleeAttackBLands BLAND_EVIL_12

	DelayControl BANE 2 0
	AddControl BANE MeleeAttackBLands
camcut p 
setcammovenormal
	Widescreen FALSE

	Add gt_CANNOT_LEAVE_BLOODLANDS

	Add gt_STATIC_C2
	Add gt_STATIC_D1
	Add gt_STATIC_D3
	Add gt_STATIC_07
	Add gt_STATIC_10
	Add gt_STATIC_12

END

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

VIG OutOfAmmo_C2 FIVESEC && gt_STATIC_C2 && !POS-BLAND_BKIN_C2-arrow

	Remove gt_STATIC_C2
	MeleeAttackBLands BLAND_BKIN_C2

END

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

VIG OutOfAmmo_D1 FIVESEC && gt_STATIC_D1 && !POS-BLAND_BKIN_D1-arrow

	Remove gt_STATIC_D1
	MeleeAttackBLands BLAND_BKIN_D1

END

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

VIG OutOfAmmo_D3 FIVESEC && gt_STATIC_D3 && !POS-BLAND_BKIN_D3-arrow

	Remove gt_STATIC_D3
	MeleeAttackBLands BLAND_BKIN_D3

END

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

VIG OutOfAmmo_07 FIVESEC && gt_STATIC_07 && !POS-BLAND_EVIL_07-arrow

	Remove gt_STATIC_07
	MeleeAttackBLands BLAND_EVIL_07

END

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

VIG OutOfAmmo_10 FIVESEC && gt_STATIC_10 && !POS-BLAND_EVIL_10-arrow

	Remove gt_STATIC_10
	MeleeAttackBLands BLAND_EVIL_10

END

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

VIG OutOfAmmo_12 FIVESEC && gt_STATIC_12 && !POS-BLAND_EVIL_12-arrow

	Remove gt_STATIC_12
	MeleeAttackBLands BLAND_EVIL_12

END

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

VIG PreventPlayerLeaving HALFSEC && gt_CANNOT_LEAVE_BLOODLANDS && INAREA-P-NEAR_START

	camcut BANE
	MoveC P pP2 RUN

	//"To me! Rally to me!"
	Say lb0024

	Wait 500
	camcut P
	Wait 4500

END

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

VIG TalkToBaneInCombat MSG-iBANE

	//"For the Blood and the White Moon!"
	QuickSay lb0027

END

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

VIG TalkToBKInCombat1 MSG-iBLAND_BKIN_A2 || MSG-iBLAND_BKIN_C3 || MSG-iBLAND_BKIN_D2

	//"For the White Moon!"
	QuickSay bk0003 CREDO.BIN

END

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

VIG TalkToBKInCombat2 MSG-iBLAND_BKIN_A1 || MSG-iBLAND_BKIN_A3 || MSG-iBLAND_BKIN_D3 || MSG-iBLAND_BKIN_E1 || MSG-iBLAND_BKIN_E2

	//"For the White Moon!"
	QuickSay bk0003 BKINMAN3.BIN

END

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

VIG TalkToBKInCombat3 MSG-iBLAND_BKIN_B1 || MSG-iBLAND_BKIN_C1 || MSG-iBLAND_BKIN_B3

	IF LANG-French || LANG-Dutch || LANG-German
		//"For the White Moon!"
		QuickSay bk0003 BKINMAN1.BIN
	ELSE
		//"For Tortalaran and the Blood!"
		QuickSay bk0008 BKINMAN1.BIN
	ENDIF

END

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

VIG TalkToBKInCombat4 MSG-iBLAND_BKIN_B2 || MSG-iBLAND_BKIN_C2 || MSG-iBLAND_BKIN_D1 || MSG-iBLAND_BKIN_E3

	IF LANG-French || LANG-Dutch || LANG-German
		//"For the White Moon!"
		QuickSay bk0003 BKINMAN4.BIN
	ELSE
		//"For Tortalaran and the Blood!"
		QuickSay bk0008 BKINMAN4.BIN
	ENDIF

END

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

VIG EndOfAmbushOne TENSEC && gt_BLOODLAND_PROGRESS=1

	IF ISDEAD-BLAND_EVIL_01 && ISDEAD-BLAND_EVIL_02 && ISDEAD-BLAND_EVIL_03 && ISDEAD-BLAND_EVIL_04 && ISDEAD-BLAND_EVIL_05 && ISDEAD-BLAND_EVIL_06
		IF ISDEAD-BLAND_EVIL_07 && ISDEAD-BLAND_EVIL_08 && ISDEAD-BLAND_EVIL_09 && ISDEAD-BLAND_EVIL_10 && ISDEAD-BLAND_EVIL_11 && ISDEAD-BLAND_EVIL_12
			Set gt_BLOODLAND_PROGRESS 2
StopRecord
			Remove gt_STATIC_C2
			Remove gt_STATIC_D1
			Remove gt_STATIC_D3
			Remove gt_STATIC_07
			Remove gt_STATIC_10
			Remove gt_STATIC_12
		ENDIF
	ENDIF

END

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

VIG RegenerateEvilChars FALSE

	RemoveC BLAND_EVIL_02
	RemoveC BLAND_EVIL_03
	RemoveC BLAND_EVIL_04
	RemoveC BLAND_EVIL_05
	RemoveC BLAND_EVIL_07
	RemoveC BLAND_EVIL_08
	RemoveC BLAND_EVIL_09
	RemoveC BLAND_EVIL_10
	RemoveC BLAND_EVIL_12
	RemoveC BLAND_EVIL_13
	RemoveC BLAND_EVIL_14
	RemoveC BLAND_EVIL_15
	ResetStats BLAND_EVIL_02
	ResetStats BLAND_EVIL_03
	ResetStats BLAND_EVIL_04
	ResetStats BLAND_EVIL_05
	ResetStats BLAND_EVIL_07
	ResetStats BLAND_EVIL_08
	ResetStats BLAND_EVIL_09
	ResetStats BLAND_EVIL_10
	ResetStats BLAND_EVIL_12
	ResetStats BLAND_EVIL_13
	ResetStats BLAND_EVIL_14
	ResetStats BLAND_EVIL_15

END

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

VIG RegroupGoodChars FALSE

	Filter		P				Timeout 10 Engage BANE 500
	AddControl	P				LookAtTurn BANE
	Filter		BLAND_BKIN_A1	Timeout 10 Engage BANE 800
	AddControl	BLAND_BKIN_A1	LookAtTurn BANE
	Filter		BLAND_BKIN_A2	Timeout 10 Engage BANE 800
	AddControl	BLAND_BKIN_A2	LookAtTurn BANE
	Filter		BLAND_BKIN_A3	Timeout 10 Engage BANE 800
	AddControl	BLAND_BKIN_A3	LookAtTurn BANE
	Filter		BLAND_BKIN_B1	Timeout 10 Engage BANE 800
	AddControl	BLAND_BKIN_B1	LookAtTurn BANE
	Filter		BLAND_BKIN_B2	Timeout 10 Engage BANE 1000
	AddControl	BLAND_BKIN_B2	LookAtTurn BANE
	Filter		BLAND_BKIN_B3	Timeout 10 Engage BANE 1000
	AddControl	BLAND_BKIN_B3	LookAtTurn BANE
	Filter		BLAND_BKIN_C1	Timeout 10 Engage BANE 1000
	AddControl	BLAND_BKIN_C1	LookAtTurn BANE
	Filter		BLAND_BKIN_C2	Timeout 10 Engage BANE 1000
	AddControl	BLAND_BKIN_C2	LookAtTurn BANE
	Filter		BLAND_BKIN_C3	Timeout 10 Engage BANE 1200
	AddControl	BLAND_BKIN_C3	LookAtTurn BANE
	Filter		BLAND_BKIN_D1	Timeout 10 Engage BANE 1200
	AddControl	BLAND_BKIN_D1	LookAtTurn BANE
	Filter		BLAND_BKIN_D2	Timeout 10 Engage BANE 1200
	AddControl	BLAND_BKIN_D2	LookAtTurn BANE
	Filter		BLAND_BKIN_D3	Timeout 10 Engage BANE 1200
	AddControl	BLAND_BKIN_D3	LookAtTurn BANE

	UUcomplete P
	UUComplete BLAND_BKIN_A1
	UUComplete BLAND_BKIN_A2
	UUComplete BLAND_BKIN_A3
	UUComplete BLAND_BKIN_B1
	UUComplete BLAND_BKIN_B2
	UUComplete BLAND_BKIN_B3
	UUComplete BLAND_BKIN_C1
	UUComplete BLAND_BKIN_C2
	UUComplete BLAND_BKIN_C3
	UUComplete BLAND_BKIN_D1
	UUComplete BLAND_BKIN_D2
	UUComplete BLAND_BKIN_D3

	Set xp_BK_BONUS -100

	IF !ISDEAD-BLAND_BKIN_A1
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_A2
		AddTo xp_BK_BONUS 40
	ENDIF
	IF !ISDEAD-BLAND_BKIN_A3
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_B1
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_B2
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_B3
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_C1
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_C2
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_C3
		AddTo xp_BK_BONUS 40
	ENDIF
	IF !ISDEAD-BLAND_BKIN_D1
		AddTo xp_BK_BONUS 20
	ENDIF
	IF !ISDEAD-BLAND_BKIN_D2
		AddTo xp_BK_BONUS 40
	ENDIF
	IF !ISDEAD-BLAND_BKIN_D3
		AddTo xp_BK_BONUS 20
	ENDIF

	AwardEP xp_BK_BONUS

END

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

VIG MoveToAmbushTwo FIVESEC && gt_BLOODLAND_PROGRESS=2

	Set gt_BLOODLAND_PROGRESS 3

	Widescreen TRUE

	// *** army regroups after first battle ***

	RunS RegroupGoodChars

	//"The first battle is ours! Let us march...This way."
	QuickSay lb0028
	Wait 5000

	// *** march to second battle ***

	MoveCDir BANE pBANE_3
	UUSay
	MoveCDir P pP3

	MoveCDir BLAND_BKIN_A1 pBK3_A1
	MoveCDir BLAND_BKIN_A2 pBK3_A2
	MoveCDir BLAND_BKIN_A3 pBK3_A3
	Wait 250
	MoveCDir BLAND_BKIN_B1 pBK3_B1
	MoveCDir BLAND_BKIN_B2 pBK3_B2
	MoveCDir BLAND_BKIN_B3 pBK3_B3
	Wait 250
	MoveCDir BLAND_BKIN_C1 pBK3_C1
	MoveCDir BLAND_BKIN_C2 pBK3_C2
	MoveCDir BLAND_BKIN_C3 pBK3_C3
	Wait 250
	MoveCDir BLAND_BKIN_D1 pBK3_D1
	MoveCDir BLAND_BKIN_D2 pBK3_D2
	MoveCDir BLAND_BKIN_D3 pBK3_D3
	Wait 250

	UUComplete BANE 100

	RunS RegenerateEvilChars

	// *** arrived at second battle site - pause to consider the evil stone ***

	IF !ISDEAD-BLAND_BKIN_A2 || !ISDEAD-BLAND_BKIN_C3 || !ISDEAD-BLAND_BKIN_D2
		camnlock 20
		IF !ISDEAD-BLAND_BKIN_A2
			UUcomplete BLAND_BKIN_A2
			Capture BLAND_BKIN_A2 cM_POINT
			campan BLAND_BKIN_A2
		ELSE
			IF !ISDEAD-BLAND_BKIN_C3
				UUcomplete BLAND_BKIN_C3
				Capture BLAND_BKIN_C3 cM_POINT
				campan BLAND_BKIN_C3
			ELSE
				UUcomplete BLAND_BKIN_D2
				Capture BLAND_BKIN_D2 cM_POINT
				campan BLAND_BKIN_D2
			ENDIF
		ENDIF
		//"What are these things the undead build upon our lands?"
		Say bkbl01 CREDO.BIN
		campan BANE
		//"I do not know, but...evil here...far greater than...before."
		Say lb0029
	ENDIF

	// *** bad guys teleport in with effects ***

	PlaceC BLAND_EVIL_03 pBAD2_03
	FX_GreenFire BLAND_EVIL_03
	PlaceC BLAND_EVIL_08 pBAD2_08
	FX_GreenFire BLAND_EVIL_08
	Wait 275
	PlaceC BLAND_EVIL_02 pBAD2_02
	FX_GreenFire BLAND_EVIL_02
	PlaceC BLAND_EVIL_04 pBAD2_04
	FX_GreenFire BLAND_EVIL_04
	PlaceC BLAND_EVIL_10 pBAD2_10
	FX_GreenFire BLAND_EVIL_10
	PlaceC BLAND_EVIL_12 pBAD2_12
	FX_GreenFire BLAND_EVIL_12
	Wait 175
	PlaceC BLAND_EVIL_05 pBAD2_05
	FX_GreenFire BLAND_EVIL_05
	PlaceC BLAND_EVIL_07 pBAD2_07
	FX_GreenFire BLAND_EVIL_07
	PlaceC BLAND_EVIL_09 pBAD2_09
	FX_GreenFire BLAND_EVIL_09
	PlaceC BLAND_EVIL_13 pBAD2_13
	FX_GreenFire BLAND_EVIL_13

	//"Attack!"
	QuickSay lb0030

	// *** START OF SECOND BATTLE ***

	MeleeAttackBLands BANE

	EngagePoint	BLAND_BKIN_A1 pBAD2_06 1000
	AddControl	BLAND_BKIN_A1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_A2 pBAD2_06 1000
	AddControl	BLAND_BKIN_A2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_A3 pBAD2_06 1000
	AddControl	BLAND_BKIN_A3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B1 pBAD2_06 1000
	AddControl	BLAND_BKIN_B1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B2 pBAD2_06 1000
	AddControl	BLAND_BKIN_B2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B3 pBAD2_06 1000
	AddControl	BLAND_BKIN_B3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C1 pBAD2_06 1000
	AddControl	BLAND_BKIN_C1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C2 pBAD2_06 1000
	AddControl	BLAND_BKIN_C2 StaticMeleeAttackBLands
	EngagePoint BLAND_BKIN_C3 pBAD2_06 1000
	AddControl	BLAND_BKIN_C3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_D1 pBAD2_06 1000
	AddControl	BLAND_BKIN_D1 StaticMeleeAttackBLands
	EngagePoint BLAND_BKIN_D2 pBAD2_06 1000
	AddControl	BLAND_BKIN_D2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_D3 pBAD2_06 1000
	AddControl	BLAND_BKIN_D3 StaticMeleeAttackBLands

	MeleeAttackBLands BLAND_EVIL_02
	MeleeAttackBLands BLAND_EVIL_03
	MeleeAttackBLands BLAND_EVIL_04
	MeleeAttackBLands BLAND_EVIL_05
	StaticMeleeAttackBLands BLAND_EVIL_07
	MeleeAttackBLands BLAND_EVIL_08
	MeleeAttackBLands BLAND_EVIL_09
	StaticMeleeAttackBLands BLAND_EVIL_10
	StaticMeleeAttackBLands BLAND_EVIL_12
	MeleeAttackBLands BLAND_EVIL_13

	UUSay
	camcut P
	Widescreen FALSE

	Add gt_STATIC_C2
	Add gt_STATIC_D1
	Add gt_STATIC_D3
	Add gt_STATIC_07
	Add gt_STATIC_10
	Add gt_STATIC_12
END

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

VIG AttackerTeleportsIn TENSEC && (gt_BLOODLAND_PROGRESS=3 || gt_BLOODLAND_PROGRESS=4)

	IF gt_BLOODLAND_PROGRESS=4

		PlaceC BLAND_EVIL_15 pBAD2_15
		FX_GreenFire BLAND_EVIL_15
		GiveSightOfPlayerTo BLAND_EVIL_15
		Filter BLAND_EVIL_15 Timeout 20 AttackDemo2
		AddControl BLAND_EVIL_15 MeleeAttackBLands

		Set gt_BLOODLAND_PROGRESS 5

	ELSE
		IF gt_DECENT_WAIT

			PlaceC BLAND_EVIL_14 pBAD2_14
			FX_GreenFire BLAND_EVIL_14
			GiveSightOfPlayerTo BLAND_EVIL_14
			Filter BLAND_EVIL_14 Timeout 20 AttackDemo2
			AddControl BLAND_EVIL_14 MeleeAttackBLands

			Set gt_BLOODLAND_PROGRESS 4
		ELSE
			Add gt_DECENT_WAIT
		ENDIF

	ENDIF

END

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

VIG EndOfAmbushTwo TENSEC && gt_BLOODLAND_PROGRESS=5

	IF ISDEAD-BLAND_EVIL_01 && ISDEAD-BLAND_EVIL_02 && ISDEAD-BLAND_EVIL_03 && ISDEAD-BLAND_EVIL_04 && ISDEAD-BLAND_EVIL_05 && ISDEAD-BLAND_EVIL_06
		IF ISDEAD-BLAND_EVIL_07 && ISDEAD-BLAND_EVIL_08 && ISDEAD-BLAND_EVIL_09 && ISDEAD-BLAND_EVIL_10 && ISDEAD-BLAND_EVIL_11 && ISDEAD-BLAND_EVIL_12
			IF ISDEAD-BLAND_EVIL_13 && ISDEAD-BLAND_EVIL_14 && ISDEAD-BLAND_EVIL_15
				Set gt_BLOODLAND_PROGRESS 6
				Remove gt_STATIC_C2
				Remove gt_STATIC_D1
				Remove gt_STATIC_D3
				Remove gt_STATIC_07
				Remove gt_STATIC_10
				Remove gt_STATIC_12
			ENDIF
		ENDIF
	ENDIF

END

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

VIG MoveToFinalBattle FIVESEC && gt_BLOODLAND_PROGRESS=6

	Set gt_BLOODLAND_PROGRESS 7

	Widescreen TRUE

	// *** army regroups after second battle ***

	RunS RegroupGoodChars

	//"We are victorious! Quickly - let us march against the tower itself."
	Say lb0031

	// *** march to third and last battle ***

	MoveCDir BANE pBANE_4
	Wait 500
	MoveCDir P pP4
	Wait 500
	MoveCDir BLAND_BKIN_A1 pBK4_A1
	MoveCDir BLAND_BKIN_A2 pBK4_A2
	MoveCDir BLAND_BKIN_A3 pBK4_A3
	Wait 250
	MoveCDir BLAND_BKIN_B1 pBK4_B1
	MoveCDir BLAND_BKIN_B2 pBK4_B2
	MoveCDir BLAND_BKIN_B3 pBK4_B3
	Wait 250
	MoveCDir BLAND_BKIN_C1 pBK4_C1
	MoveCDir BLAND_BKIN_C2 pBK4_C2
	MoveCDir BLAND_BKIN_C3 pBK4_C3
	Wait 250
	MoveCDir BLAND_BKIN_D1 pBK4_D1
	MoveCDir BLAND_BKIN_D2 pBK4_D2
	MoveCDir BLAND_BKIN_D3 pBK4_D3

//camnlock 340
camnlock 160
campan BANE
	UUComplete BANE 100
camnlock 340
campan p
	// *** arrived at final battle site ***

	RunS RegenerateEvilChars

	// *** bad guys appear OFF - CAMERA ***

	PlaceC BLAND_EVIL_02 pBAD3_02
	PlaceC BLAND_EVIL_03 pBAD3_03
	PlaceC BLAND_EVIL_04 pBAD3_04
	PlaceC BLAND_EVIL_05 pBAD3_05
	PlaceC BLAND_EVIL_07 pBAD3_07
	PlaceC BLAND_EVIL_08 pBAD3_08
	PlaceC BLAND_EVIL_09 pBAD3_09
	PlaceC BLAND_EVIL_10 pBAD3_10
	PlaceC BLAND_EVIL_12 pBAD3_12
	PlaceC BLAND_EVIL_13 pBAD3_13
	PlaceC BLAND_EVIL_14 pBAD3_14
	PlaceC BLAND_EVIL_15 pBAD3_15

	//"Look! The gates of Tortalaran lie before us!"
	Say lb0032

	// *** Lord Bane wades in ***

	MoveC BANE pBANE_DOOR run
	//"Attack!"
	QuickSay lb0030
	Wait 1250

	SetWalkType BANE walk

	// *** START OF FINAL BATTLE ***

	MeleeAttackBLands BANE

	EngagePoint	BLAND_BKIN_A1 pBAD3_06 800
	AddControl	BLAND_BKIN_A1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_A2 pBAD3_06 800
	AddControl	BLAND_BKIN_A2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_A3 pBAD3_06 800
	AddControl	BLAND_BKIN_A3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B1 pBAD3_06 800
	AddControl	BLAND_BKIN_B1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B2 pBAD3_06 800
	AddControl	BLAND_BKIN_B2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_B3 pBAD3_06 800
	AddControl	BLAND_BKIN_B3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C1 pBAD3_06 800
	AddControl	BLAND_BKIN_C1 MeleeAttackBLands
	EngagePoint BLAND_BKIN_C2 pBAD3_06 800
	AddControl	BLAND_BKIN_C2 StaticMeleeAttackBLands
	EngagePoint BLAND_BKIN_C3 pBAD3_06 800
	AddControl	BLAND_BKIN_C3 MeleeAttackBLands
	EngagePoint BLAND_BKIN_D1 pBAD3_06 800
	AddControl	BLAND_BKIN_D1 StaticMeleeAttackBLands
	EngagePoint BLAND_BKIN_D2 pBAD3_06 800
	AddControl	BLAND_BKIN_D2 MeleeAttackBLands
	EngagePoint BLAND_BKIN_D3 pBAD3_06 800
	AddControl	BLAND_BKIN_D3 StaticMeleeAttackBLands

	MeleeAttackBLands BLAND_EVIL_02
	MeleeAttackBLands BLAND_EVIL_03
	MeleeAttackBLands BLAND_EVIL_04
	MeleeAttackBLands BLAND_EVIL_05
	StaticMeleeAttackBLands BLAND_EVIL_07
	MeleeAttackBLands BLAND_EVIL_08
	MeleeAttackBLands BLAND_EVIL_09
	StaticMeleeAttackBLands BLAND_EVIL_10
	StaticMeleeAttackBLands BLAND_EVIL_12
	MeleeAttackBLands BLAND_EVIL_13
	MeleeAttackBLands BLAND_EVIL_14
	MeleeAttackBLands BLAND_EVIL_15

	UUSay
//camcut P
	Widescreen FALSE

	Add gt_STATIC_C2
	Add gt_STATIC_D1
	Add gt_STATIC_D3
	Add gt_STATIC_07
	Add gt_STATIC_10
	Add gt_STATIC_12
END

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

VIG EndOfFinalBattle TENSEC && gt_BLOODLAND_PROGRESS=7

	IF ISDEAD-BLAND_EVIL_01 && ISDEAD-BLAND_EVIL_02 && ISDEAD-BLAND_EVIL_03 && ISDEAD-BLAND_EVIL_04 && ISDEAD-BLAND_EVIL_05 && ISDEAD-BLAND_EVIL_06
		IF ISDEAD-BLAND_EVIL_07 && ISDEAD-BLAND_EVIL_08 && ISDEAD-BLAND_EVIL_09 && ISDEAD-BLAND_EVIL_10 && ISDEAD-BLAND_EVIL_11 && ISDEAD-BLAND_EVIL_12
			IF ISDEAD-BLAND_EVIL_13 && ISDEAD-BLAND_EVIL_14 && ISDEAD-BLAND_EVIL_15
				Set gt_BLOODLAND_PROGRESS 8
				Remove gt_STATIC_C2
				Remove gt_STATIC_D1
				Remove gt_STATIC_D3
				Remove gt_STATIC_07
				Remove gt_STATIC_10
				Remove gt_STATIC_12
			ENDIF
		ENDIF
	ENDIF

END

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

VIG EnterTowerOfBlood FIVESEC && gt_BLOODLAND_PROGRESS=8

	Set gt_BLOODLAND_PROGRESS 9

	Widescreen TRUE

	// *** FINAL BATTLE OVER - Bane approaches the gate ***

camnlock 30
campan BANE
	MoveCDir BANE pBANE_DOOR
	AddFilter BANE Timeout 25

	////////////////////////////////////////////////////////////
	////////////////// new reinforcements bit //////////////////
	////////////////////////////////////////////////////////////
	ResetStats BANE_GUARD1
	ResetStats BANE_GUARD2
	ResetStats BANE_GUARD3
	ResetStats BANE_GUARD4
	PlaceC BANE_GUARD1 pBK2_A1
	PlaceC BANE_GUARD2 pBK2_A2
	PlaceC BANE_GUARD3 pBK2_A3
	PlaceC BANE_GUARD4 pBK2_B1
	PlaceC BK_EXTRA1 pBK2_B2
	PlaceC BK_EXTRA2 pBK2_B3
	PlaceC BK_EXTRA3 pBK2_C1
	PlaceC BK_EXTRA4 pBK2_C3
	SetWalkType BANE_GUARD1 run
	SetWalkType BANE_GUARD2 run
	SetWalkType BANE_GUARD3 run
	SetWalkType BANE_GUARD4 run
	SetWalkType BK_EXTRA1 run
	SetWalkType BK_EXTRA2 run
	SetWalkType BK_EXTRA3 run
	SetWalkType BK_EXTRA4 run
	Engage BANE_GUARD1 BANE 600 
	Engage BANE_GUARD2 BANE 700 
	Engage BANE_GUARD3 BANE 800 
	Engage BANE_GUARD4 BANE 900 
	Engage BK_EXTRA1 BANE 1000 
	Engage BK_EXTRA2 BANE 1100 
	Engage BK_EXTRA3 BANE 1200 
	Engage BK_EXTRA4 BANE 1300 
	////////////////////////////////////////////////////////////
	////////////// end new reinforcements bit //////////////////
	////////////////////////////////////////////////////////////

	Wait 5000
	Engage P BANE 500
	//AddFilter P Timeout 5

	UUComplete BANE

	IF !INAREA-BANE-NEAR_DOOR
		EngagePoint BANE pBEHIND_DOOR 900
		AddFilter BANE Timeout 20
		AddControl BANE LookAtTurn pBEHIND_DOOR
		UUComplete BANE
	ENDIF

	// *** the army survivors gather around ***

	RunS RegroupGoodChars

	LookAtTurn P pBEHIND_DOOR

	// *** Bane smashes his way in to the Tower of Blood ***

	Capture BANE cM_HEWING_STONE Notifies 3 245 BaneStrikesDoor 500 BaneStrikesDoor 800 BaneBreaksDoor
	WHILE !CC-BANE
		Wait 25
	ENDWHILE

	LookAtTurn BANE P
campan P
	//"The gates are open...Some of us should wait here to guard..."
	Say lb0033

	Wait 2500
	RunS PalFadeBLACK

	Remove gt_CANNOT_LEAVE_BLOODLANDS

	RemoveC BANE_GUARD1
	RemoveC BANE_GUARD2
	RemoveC BANE_GUARD3
	RemoveC BANE_GUARD4
	RemoveC BK_EXTRA1
	RemoveC BK_EXTRA2
	RemoveC BK_EXTRA3
	RemoveC BK_EXTRA4

	//load Tower of Blood
	PostMsg t_BD_SOUTH
END

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

VIG BaneStrikesDoor FALSE

	// clang SFX 
	PlaySFXPerson ig_301.WAV BANE

END

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

VIG BaneBreaksDoor FALSE

	// clang SFX
	PlaySFXPerson ig_301.WAV BANE
	// door opens SFX
	PlaySFXPerson IG_295.WAV BANE

	IDoorClosed dBLOOD
	RDoorOpen dBLOOD

END

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