/////////////////////////////////////////////////////////////////////
// DHEX2.S		-	The Dark Hex, Skorn's seat of power
/////////////////////////////////////////////////////////////////////

SETUP

	IF !gt_PLACED_DHEX2
		Add gt_PLACED_DHEX2
		PlaceC SKORN pSKORN1
		ClearDamaged SKORN
		ChangeProfileToIdentified erev_skorn
	ENDIF

END

VIG TempSetup FALSE

	IF !gt_DHEX2_DONE
		DisableTeleport D2_RW
	ENDIF
	DisableTeleport D2_HEXSTONE
	SetWeather 0 0 0 0 0 0 0 0
	//SwapModel SKORN SkornD

	FX_Torch 17024 27008 784
	FX_Torch 17024 26240 784
	FX_Torch 15232 26240 720
	FX_Torch 15232 27008 720

	CachePortrait BARTH5.BIN

END

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

VIG TeleportLighting FIVESEC && gt_DHEX2_DONE

	FX_RedFireGlow D2_RW

END

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

VIG HorribleDemoBodge DEMO_DHEX2

	Remove DEMO_DHEX2

	Message "Chase Skorn to the Pentagram and attack him." 50

	Set hp_SKORN_HEX 1000
	SetHP SKORN 1001

END


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

VIG ChaseSkorn ONESEC && !gt_CHASING_SKORN && (INAREA-P-NEAR_SKORN || DAMAGED-SKORN)

	Widescreen TRUE
	ClearDamaged SKORN

	PlaySFXPerson	vampires1.WAV P
	Capture			P	cM_V6_LOOK_AROUND2_BETTER
	MoveCDir SKORN pSKORN2 run
	AddControl SKORN DelayControl 1 1
	AddControl SKORN AttackDemo2
	Add gt_CHASING_SKORN
	UUComplete P

	PlayLoopedMusic RPG23.WAV

	Widescreen FALSE

END

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

VIG AmbushAtPentagram ONESEC && gt_CHASING_SKORN && !gt_P_V_SEEKERS && HPLESSTHAN-SKORN-hp_SKORN_HEX

	Add gt_P_V_SEEKERS

	StopC P
	MoveC SKORN pSKORN3 run

	ChangeProfileToIdentified Tdemon_Jalastor
	ChangeProfileToIdentified Hwell_Mahoraz
	ChangeProfileToIdentified Tdemon_Kaldarath
	ChangeProfileToIdentified Mdemon_Tamaran
	ChangeProfileToIdentified Mdemon_Bart

	IF !f_JALASTOR_DEAD
		ResetStats JALASTOR
		PlaceC JALASTOR pJALASTOR
		FX_GreenFire JALASTOR
	ENDIF

	IF !f_MAHORAZ_DEAD && gt_MAHORAZ_KILLED_IN_WSOUL1
		ResetStats MAHORAZ
		PlaceC MAHORAZ pMAHORAZ
		FX_GreenFire MAHORAZ
	ENDIF

	IF !f_KALDARATH_DEAD
		ResetStats KALDARATH
		PlaceC KALDARATH pKALDARATH
		FX_GreenFire KALDARATH
	ENDIF

	IF !f_TAMARAN_DEAD
		ResetStats TAMARAN
		PlaceC TAMARAN pTAMARAN
		FX_GreenFire TAMARAN
		ChangeXP Mdemon_Tamaran xp_D2_TAMARAN
	ENDIF

	IF !f_BART_DEAD
		PlaceC BART pBARTH
		Widescreen TRUE
camcut BART
		FX_GreenFire BART
		Wait 1000
		Say bag401 BARTH5.BIN
		Say bag402 BARTH5.BIN
camcut P
		Widescreen FALSE
	ENDIF

	GiveSightOfPlayerTo	JALASTOR
	GiveSightOfPlayerTo	MAHORAZ
	GiveSightOfPlayerTo	KALDARATH
	GiveSightOfPlayerTo	TAMARAN
	GiveSightOfPlayerTo BART
	AttackDemo2	JALASTOR
	AttackDemo2	MAHORAZ
	AttackDemo2	KALDARATH
	AttackDemo2	TAMARAN
	AttackDemo2 BART

END

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

VIG SkornLeaves ONESEC && INAREA-SKORN-NEAR_EXIT

	SetWalkType SKORN walk
	FX_BurnPerson           SKORN
	RemoveC SKORN
	Add gt_PURSUE_SKORN_TO_UPPERWELL

END

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

VIG AllDone ONESEC && !gt_DHEX2_DONE && ISDEAD-BART && ISDEAD-JALASTOR && ISDEAD-MAHORAZ && ISDEAD-KALDARATH && ISDEAD-TAMARAN

	Add gt_DHEX2_DONE
	EnableTeleport D2_RW
	RunS TeleportLighting

END

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