/////////////////////////////////////////////////////////////////////
// NEWHEX.S
/////////////////////////////////////////////////////////////////////

SETUP

	IF mj_DEFEAT_LILITH
		DelStock HEXK_SHOP mess2
		DelStock HEXK_SHOP mess3
	ENDIF

	IF ce_MALKUTH && !gt_PLACED_MALKUTH_IN_HEX
		Add gt_PLACED_MALKUTH_IN_HEX
		RemoveC HEX_KEEPER
		PlaceC HEX_KEEPER pMALK_IN_TREE_ROOM
		WanderNotFar HEX_KEEPER 2 5
	ENDIF

	IF mj_DEFEAT_SKORN
		RemoveC HEX_KEEPER
	ENDIF

END

VIG TempSetup FALSE

    DisableTeleport NX_HEXSTONE

	IF gt_PLACED_JAARD_IN_HEX
		SwapObj e_hades easel2
	ENDIF
	IF gt_PLACED_CALDOR_IN_HEX
		SwapObj e_cauldron skulcol1
	ENDIF
	IF gt_PLACED_CRUCIBUS_IN_HEX
		SwapObj e_plinth anvilex1
	ENDIF

	IF gt_PLACED_TRINKETS_BOOK
		SwapObj e_trinkets easel2
	ENDIF
	IF gt_PLACED_STORMS_BOOK
		SwapObj e_storms easel2
	ENDIF
	IF gt_PLACED_STONES_BOOK
		SwapObj e_stones easel2
	ENDIF
	IF gt_PLACED_SHADOWS_BOOK
		SwapObj e_shadows easel2
	ENDIF
	IF gt_PLACED_MEDICINES_BOOK
		SwapObj e_medicines easel2
	ENDIF
	IF gt_PLACED_MANIPULATIONS_BOOK
		SwapObj e_manipulations easel2
	ENDIF
	IF gt_PLACED_KNIVES_BOOK
		SwapObj e_knives easel2
	ENDIF
	IF gt_PLACED_GLYPHS_BOOK
		SwapObj e_glyphs easel2
	ENDIF
	//IF gt_PLACED_DREAMS_BOOK...duh...
		SwapObj e_dreams easel2

	IF gt_PLACED_CORPSES_BOOK
		SwapObj e_corpses easel2
	ENDIF
	IF gt_PLACED_CLOAKS_BOOK
		SwapObj e_cloaks easel2
	ENDIF
	IF gt_PLACED_BREATHS_BOOK
		SwapObj e_breath easel2
	ENDIF
	IF gt_PLACED_ARROWS_BOOK
		SwapObj e_arrows easel2
	ENDIF

	SetWeather 0 0 0 0 0 0 0 0

	Playloopedmusic rpg31.wav

	// change these for torches in each elemental colour.
	FX_Torch 13312 22016 1114
	FX_Torch 14848 23040 1114
	FX_Torch 14336 25088 1114
	FX_Torch 12288 25088 1114
	FX_Torch 11776 23040 1114

	IF !ce_MALKUTH
		CachePortrait PC1.BIN
	ELSE
		CachePortrait CRUCIBUS.BIN
	ENDIF
	CachePortrait HEXKEEPR.BIN
	CachePortrait CALDOR.BIN
	CachePortrait JAARD.BIN

END

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

VIG BootUpHexGuys gt_DEMO_HEX_GUYS_GO_GO_GO

	Remove gt_DEMO_HEX_GUYS_GO_GO_GO

	PlaceC HEX_KEEPER pMALK_IN_TREE_ROOM
	WanderNotFar HEX_KEEPER 2 5
	PlaceC JAARD pJAARD_IN_LIBRARY
	RunS JaardActions
	PlaceC CRUCIBUS pCRUCIBUS_IN_SMITHY
	PlaceC CALDOR pCALDOR_IN_LAB
	RunS CaldorActions

END

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

VIG MustFadeIn gt_FAY_BOOT

	Remove gt_FAY_BOOT

	RunS PalFadeRPG

END

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

VIG FuckedUpHorribly ONESEC && mj_DEFEAT_SKORN

	Widescreen TRUE
	
	camcut pos100
	setcammoveconstant 1
	campan pos300

	Say Hxeg03
	Say Hxeg04
	Say Hxeg05

	// Game over message
	sglcredit centre 4000 gamovr
	wait 4000

	RunS PalFadeBLACK

	gameover

	Remove mj_DEFEAT_SKORN

END

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


/////////////////////////////////////////////////////////////////////
//		T H E   H E X   K E E P E R
/////////////////////////////////////////////////////////////////////


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

VIG MeetHexKeeper !ce_MALKUTH
camcut pos01
	Widescreen TRUE
	ShowTeleportNames

setcammoveconstant 5	
campan pos20

	IF POS-P-lore_staff
		DeleteObjectsInBackpackWithID P lore_staff
	ENDIF
	PlaceC HEX_KEEPER pSTAFF_START
	FX_BurnPerson HEX_KEEPER
	FX_GreenFire HEX_KEEPER
	Wait 2125
	FX_GreenFire HEX_KEEPER
	Wait 2125
	FX_GreenFire HEX_KEEPER
	
	LookAtTurnFollow P HEX_KEEPER
	//"Welcome back, Soulbringer...The Hex awakens once more."
	QuickSay XX0001
	Wait 2125
	FX_GreenFire HEX_KEEPER
	Wait 2125
	FX_GreenFire HEX_KEEPER
	Wait 2125
	FX_GreenFire HEX_KEEPER
	UUSay

	RestoreInsideLightRadius 5
	RestoreOutsideLightRadius 5
camcut pos03
	//"What is this place?"
	Say Hx0230
	//"Ah, you do not remember...This is...the Hex...I am Malkuth...the Staff of Lore..."
    Add ce_MALKUTH
	ChangeProfileToIdentified Xhex_Malkuth
	Say XX0002

	AwardEP xp_BEEN_TO_HEX
	SetCharSet	Faith	FS1
	Wait 2500

	Widescreen FALSE
SetCamMoveNormal
camcut p
	
END

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

VIG TalkToMalkuth MSG-iHEX_KEEPER

	Widescreen TRUE

	//"Welcome home, Soulbringer. What assistance do you need?"
	QuickSay xx0003
	StopC P
	LookAtTurnFollow HEX_KEEPER P
	Engage P HEX_KEEPER
	AddControl P LookAtTurnFollow HEX_KEEPER
	UUSay

	ResetChoice
	WHILE !MenuExit

		ClearChoices
		
		//The Hex Stone
		AddChoice 1 txhx01

		//The Hex Symbol
		AddChoice 2 txhx02

		IF gt_PLACED_JAARD_IN_HEX
			//Jaard
			AddChoice 3 txhx3b
		ELSE
			//The Library
			AddChoice 3 txhx3a
		ENDIF

		IF gt_PLACED_CRUCIBUS_IN_HEX
			//Crucibus
			AddChoice 4 txhx4b
		ELSE
			//The Smithy
			AddChoice 4 txhx4a
		ENDIF

		IF gt_PLACED_CALDOR_IN_HEX
			//Caldor
			AddChoice 5 txhx5b
		ELSE
			//The Laboratory
			AddChoice 5 txhx5a
		ENDIF

		IF gt_HEX_TREE_ROOM
			//Items
			AddChoice 6 txhx6b
		ELSE
			//The Tree Room
			AddChoice 6 txhx6a
		ENDIF

		//Leave
		AddChoice 0 tx0003

		GetChoice HEX_KEEPER

		SWITCH CHOICE
			CASE 1
				//The Hex Stone

				//"...only means of travel...many...stones...lost their link...touch them..."
				Say xx0004
				//"...Heart of Kinkathra...other realms...in Talendrah..."
				Say xx0005
				QLAdd ql016 qlt016 qlb016

			CASE 2
				//The Hex Symbol

				//"...shows your mastery of each element...look within - at your seculorum."
				Say xx0006

				Add f_SECULORUM





			CASE 3
				//Jaard -and- The Library

				//"The library is where all your magics are kept...by Jaard..."
				Say xx0007

				IF !gt_PLACED_JAARD_IN_HEX
					IF !POS-P-hades_tome
						//"However, you must seek the Tome of Hades before his spirit can help you."
						Say xx0008

						Add co_TOME_OF_HADES
						QLAdd ql018 qlt018 qlb018
					ELSE
						QLRemove ql018
						//"I will take the Tome...and place it in its proper place...Jaard's spirit forms."
						Say xx0009

						DeleteObjectsInBackpackWithID P hades_tome
						PlaceC JAARD pJAARD_IN_LIBRARY
						RunS JaardActions

						PlaySFXPerson IG_131.WAV JAARD

						Add gt_PLACED_JAARD_IN_HEX
						AwardEP xp_JAARD_IN_HEX
						SwapObj e_hades easel2

						Reveal mscroll_banish	libhide1
						Reveal mscroll_rage		libhide2
						Reveal mscroll_lgtning	libhide3

					ENDIF
				ENDIF

			CASE 4
				//Crucibus -and- The Smithy

				//"The smithy...Crucibus...There is nothing...he cannot repair."
				Say xx0010

				IF !gt_PLACED_CRUCIBUS_IN_HEX
					IF !POS-P-anvilhorath
						//"Without the Anvil of Horath, his spirit is forbidden entrance..."
						Say xx0011

						Add co_ANVIL_OF_HORATH
						QLAdd ql017 qlt017 qlb017
					ELSE
						QLRemove ql017

						//"You have the Anvil of Horath, which permits his spirit entry."
						Say xx0012

						DeleteObjectsInBackpackWithID P anvilhorath
						PlaceC CRUCIBUS pCRUCIBUS_IN_SMITHY

						PlaySFXPerson IG_133.WAV CRUCIBUS

						Add gt_PLACED_CRUCIBUS_IN_HEX
						AwardEP xp_CRUCIBUS_IN_HEX
						SwapObj e_plinth anvilex1

						Set gt_CRUC_POWER_TICK 0
						Set f_CRUCIBUS_POWER 2

						Reveal ar_ltr_bd_sala	anvhide1
						Reveal sack				anvhide2
						Reveal ring_str			anvhide3

					ENDIF
				ENDIF

			CASE 5
				//Caldor -and- The Laboratory

				//"The laboratory is Caldor's...He can reproduce any potion...without...ingredients."
				Say xx0013

				IF !gt_PLACED_CALDOR_IN_HEX
					IF !POS-P-skull
						//"However, the Skull of Alchemy is required..."
						Say xx0014

						Add co_SKULL_OF_ALCHEMY
						QLAdd ql019 qlt019 qlb019
					ELSE
						QLRemove ql019
						//"With the Skull of Alchemy...Caldor will be eager to help..."
						Say xx0015

						DeleteObjectsInBackpackWithID P skull
						PlaceC CALDOR pCALDOR_IN_LAB
						RunS CaldorActions

						PlaySFXPerson IG_132.WAV CALDOR

						Add gt_PLACED_CALDOR_IN_HEX
						AwardEP xp_CALDOR_IN_HEX
						SwapObj e_cauldron skulcol1

						//RememberEP

						Reveal explode_bomb	labhide1
						Reveal ptn_mana_f	labhide2
						Reveal ptn_heal_f	labhide3

					ENDIF
				ENDIF

			CASE 6
				//Items -and- The Tree Room

				IF gt_HEX_TREE_ROOM
					MessagesOff
					ShopPanel	HEXK_SHOP	0		0		HEX_KEEPER			GIVETAKE
					MessagesOn
				ELSE
					//"That is my chamber...I can keep any item...You can send items to me..."
					Say xx0016

					Add gt_HEX_TREE_ROOM
				ENDIF

			CASE 0
				//Leave

				//"I shall await your return here."
				Say xx0017
		ENDSWITCH
	ENDWHILE

	Widescreen FALSE
	MoveC HEX_KEEPER pMALK_IN_TREE_ROOM
	AddControl HEX_KEEPER WanderNotFar 2 5
END

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


/////////////////////////////////////////////////////////////////////
//		T H E   B L A C K S M I T H
/////////////////////////////////////////////////////////////////////


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

//VIG CrucibusAnvilReady FIVESEC && gt_PLACED_CRUCIBUS_IN_HEX && f_CRUCIBUS_WORK_READY
VIG CrucibusAnvilReady FIVESEC && gt_PLACED_CRUCIBUS_IN_HEX && f_CRUCIBUS_POWER>0

	FX_RedFireGlow pANVIL

END

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

VIG TalkToCrucibus MSG-iCRUCIBUS

	Widescreen TRUE
	EngageAndFace P CRUCIBUS
	WHILE !CC-P
		TryToRunS CrucibusAnvilReady
		Wait 100
	ENDWHILE

	//IF f_CRUCIBUS_WORK_READY
	IF f_CRUCIBUS_POWER>0

		//"I am ready to repair your stuff my lord." 
		QuickSay bu0004

		WHILE SPEAKING
			TryToRunS CrucibusAnvilReady
			Wait 100
		ENDWHILE

		MessagesOff
		ShopPanel CRUC_SHOP 0 0 CRUCIBUS REPAIR
		MessagesOn

		//IF HasCrucibusRepairedSomething
		//	Remove f_CRUCIBUS_WORK_READY
		//ENDIF

	ENDIF

	//IF !f_CRUCIBUS_WORK_READY	
	IF f_CRUCIBUS_POWER<1

		//"Go away my lord."
		Say bu0005

	ENDIF

	Widescreen FALSE

END

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


/////////////////////////////////////////////////////////////////////
//		T H E   A L C H E M I S T
/////////////////////////////////////////////////////////////////////


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

VIG CaldorActions FALSE

	MoveC CALDOR pCALDOR_IN_LAB
	AddControl CALDOR WanderInRectangle pCALDOR_A pCALDOR_B

END

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

VIG PotionFromCaldor gt_PLACED_CALDOR_IN_HEX && ((EPCHANGED && DISTFROM-P-CALDOR-10) || MSG-iCALDOR)

	Widescreen TRUE

	UnDrawSwordRemember
	LookAtTurnFollow P CALDOR
	Engage CALDOR P 1000
	UUComplete CALDOR

	IF !EPCHANGED
		//"I have nothing for you..."
		Say ct0002 CALDOR.BIN
	ELSE
		//"I have created a potion for you..."
		QuickSay ct0001 CALDOR.BIN

		EngageAndFace CALDOR P 
		UUComplete CALDOR

		Capture CALDOR cM_TOSS_GENTLE
		Capture P cM_OBJ_ACCEPT_1H1
		UUComplete CALDOR

		IF mj_RECOVER_CROWN
			//Stage 4 goodies
			SWITCH RAND-16
				CASE 0
					AwardOb P ptn_curing "potion"
				CASE 1
					AwardOb P ptn_strength "potion"
				CASE 2
					AwardOb P ptn_haste "potion"
				CASE 3
					AwardOb P ptn_haste "potion"
				CASE 4
					AwardOb P ptn_heal_g "potion"
				CASE 5
					AwardOb P ptn_heal_g "potion"
				CASE 6
					AwardOb P ptn_heal_f "potion"
				CASE 7
					AwardOb P ptn_heal_f "potion"
				CASE 8
					AwardOb P ptn_heal_f "potion"
				CASE 9
					AwardOb P ptn_heal_f "potion"
				CASE 10
					AwardOb P ptn_mana_g "potion"
				CASE 11
					AwardOb P ptn_mana_g "potion"
				CASE 12
					AwardOb P ptn_mana_f "potion"
				CASE 13
					AwardOb P ptn_mana_f "potion"
				CASE 14
					AwardOb P ptn_mana_f "potion"
				CASE 15
					AwardOb P ptn_mana_f "potion"
			ENDSWITCH
		ELSE
		IF mj_DEFEAT_GARGOS_2
			//Stage 3 goodies
			SWITCH RAND-16
				CASE 0
					AwardOb P hurt_bomb "potion"
				CASE 1
					AwardOb P explode_bomb "potion"
				CASE 2
					AwardOb P ptn_curing "potion"
				CASE 3
					AwardOb P ptn_haste "potion"
				CASE 4
					AwardOb P ptn_heal_m "potion"
				CASE 5
					AwardOb P ptn_heal_g "potion"
				CASE 6
					AwardOb P ptn_heal_g "potion"
				CASE 7
					AwardOb P ptn_heal_g "potion"
				CASE 8
					AwardOb P ptn_heal_g "potion"
				CASE 9
					AwardOb P ptn_heal_f "potion"
				CASE 10
					AwardOb P ptn_mana_m "potion"
				CASE 11
					AwardOb P ptn_mana_g "potion"
				CASE 12
					AwardOb P ptn_mana_g "potion"
				CASE 13
					AwardOb P ptn_mana_g "potion"
				CASE 14
					AwardOb P ptn_mana_g "potion"
				CASE 15
					AwardOb P ptn_mana_f "potion"
			ENDSWITCH
		ELSE
		IF mj_DEFEAT_GARGOS_1
			//Stage 2 goodies
			SWITCH RAND-16
				CASE 0
					AwardOb P poison_bomb "potion"
				CASE 1
					AwardOb P ptn_curing "potion"
				CASE 2
					AwardOb P ptn_strength "potion"
				CASE 3
					AwardOb P ptn_haste "potion"
				CASE 4
					AwardOb P ptn_heal_l "potion"
				CASE 5
					AwardOb P ptn_heal_m "potion"
				CASE 6
					AwardOb P ptn_heal_m "potion"
				CASE 7
					AwardOb P ptn_heal_m "potion"
				CASE 8
					AwardOb P ptn_heal_m "potion"
				CASE 9
					AwardOb P ptn_heal_g "potion"
				CASE 10
					AwardOb P ptn_mana_l "potion"
				CASE 11
					AwardOb P ptn_mana_m "potion"
				CASE 12
					AwardOb P ptn_mana_m "potion"
				CASE 13
					AwardOb P ptn_mana_m "potion"
				CASE 14
					AwardOb P ptn_mana_m "potion"
				CASE 15
					AwardOb P ptn_mana_g "potion"
			ENDSWITCH
		ELSE
			//Stage 1 goodies
			SWITCH RAND-16
				CASE 0
					AwardOb P skeleton_bomb "potion"
				CASE 1
					AwardOb P skeleton_bomb "potion"
				CASE 2
					AwardOb P ptn_curing "potion"
				CASE 3
					AwardOb P ptn_strength "potion"
				CASE 4
					AwardOb P ptn_heal_l "potion"
				CASE 5
					AwardOb P ptn_heal_l "potion"
				CASE 6
					AwardOb P ptn_heal_l "potion"
				CASE 7
					AwardOb P ptn_heal_l "potion"
				CASE 8
					AwardOb P ptn_heal_m "potion"
				CASE 9
					AwardOb P ptn_heal_m "potion"
				CASE 10
					AwardOb P ptn_mana_l "potion"
				CASE 11
					AwardOb P ptn_mana_l "potion"
				CASE 12
					AwardOb P ptn_mana_l "potion"
				CASE 13
					AwardOb P ptn_mana_l "potion"
				CASE 14
					AwardOb P ptn_mana_m "potion"
				CASE 15
					AwardOb P ptn_mana_m "potion"
			ENDSWITCH
		ENDIF
		ENDIF
		ENDIF

		RememberEP
		UUSay
	ENDIF
	RunS CaldorActions

	Widescreen FALSE

END

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


/////////////////////////////////////////////////////////////////////
//		T H E   L I B R A R Y
/////////////////////////////////////////////////////////////////////


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

VIG JaardActions FALSE

	MoveCDir JAARD pJAARD_IN_LIBRARY
	AddControl JAARD DelayControl 1 1
	AddControl JAARD DelayControl 1 1
	AddControl JAARD DelayControl 1 1
	AddControl JAARD DelayControl 1 1
	AddControl JAARD DelayControl 1 1
	AddControl JAARD DelayControl 1 1
	AddControl JAARD Filter FilterToStart Capture cM_PULL_LEVEL
	AddControl JAARD Filter FilterToStart Capture cM_TOSS_GENTLE
	SequenceRandomlySelects JAARD

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

VIG TalkToJaard MSG-iJAARD

	Widescreen TRUE

	UnDrawSwordRemember
	LookAtTurnFollow JAARD P
	Wait 1500
	Capture JAARD cM_GREETING_BOW_WAIST
	Engage P JAARD 500

	//"I am a servant of knowledge, my lord."
	Say jd0004

	Remove gt_JAARD_VIEW_LIBRARY

	ResetChoice
	WHILE !MenuExit

		ClearChoices
		
		IF gt_JAARD_VIEW_LIBRARY

			IF f_ATTUNED_TRINKETS
				AddChoice  1 txsp01
			ENDIF
			IF f_ATTUNED_STORMS
				AddChoice  2 txsp02
			ENDIF
			IF f_ATTUNED_STONES
				AddChoice  3 txsp03
			ENDIF
			IF f_ATTUNED_SHADOWS
				AddChoice  4 txsp04
			ENDIF
			IF f_ATTUNED_MEDICINES
				AddChoice  5 txsp05
			ENDIF
			IF f_ATTUNED_MANIPULATIONS
				AddChoice  6 txsp06
			ENDIF
			IF f_ATTUNED_KNIVES
				AddChoice  7 txsp07
			ENDIF
			IF f_ATTUNED_GLYPHS
				AddChoice  8 txsp08
			ENDIF
			IF f_ATTUNED_DREAMS
				AddChoice  9 txsp09
			ENDIF
			IF f_ATTUNED_CORPSES
				AddChoice 10 txsp10
			ENDIF
			IF f_ATTUNED_CLOAKS
				AddChoice 11 txsp11
			ENDIF
			IF f_ATTUNED_BREATHS
				AddChoice 12 txsp12
			ENDIF
			IF f_ATTUNED_ARROWS
				AddChoice 13 txsp13
			ENDIF

		ELSE

			IF f_ATTUNED_TRINKETS || f_ATTUNED_STORMS || f_ATTUNED_STONES || f_ATTUNED_SHADOWS || f_ATTUNED_MEDICINES || f_ATTUNED_MANIPULATIONS || f_ATTUNED_KNIVES || f_ATTUNED_GLYPHS || f_ATTUNED_DREAMS || f_ATTUNED_CORPSES || f_ATTUNED_CLOAKS || f_ATTUNED_BREATHS || f_ATTUNED_ARROWS
				//The Library
				AddChoice 14 txhx3a
			ENDIF

			IF POS-P-TRINKETS_BOOK ||		(gt_PLACED_TRINKETS_BOOK &&			POS-P-TRINKETS_RUNE)
				AddChoice  1 txsp01
			ENDIF
			IF POS-P-STORMS_BOOK ||			(gt_PLACED_STORMS_BOOK &&			POS-P-STORMS_RUNE)
				AddChoice  2 txsp02
			ENDIF
			IF POS-P-STONES_BOOK ||			(gt_PLACED_STONES_BOOK &&			POS-P-STONES_RUNE)
				AddChoice  3 txsp03
			ENDIF
			IF POS-P-FEARS_BOOK ||			(gt_PLACED_SHADOWS_BOOK &&			POS-P-FEARS_RUNE)
				AddChoice  4 txsp04
			ENDIF
			IF POS-P-MEDICINES_BOOK ||		(gt_PLACED_MEDICINES_BOOK &&		POS-P-MEDICINES_RUNE)
				AddChoice  5 txsp05
			ENDIF
			IF POS-P-MANIPULATIONS_BOOK ||	(gt_PLACED_MANIPULATIONS_BOOK &&	POS-P-MANIPULATIONS_RUNE)
				AddChoice  6 txsp06
			ENDIF
			IF POS-P-KNIVES_BOOK ||			(gt_PLACED_KNIVES_BOOK &&			POS-P-KNIVES_RUNE)
				AddChoice  7 txsp07
			ENDIF
			IF POS-P-GLYPHS_BOOK ||			(gt_PLACED_GLYPHS_BOOK &&			POS-P-GLYPHS_RUNE)
				AddChoice  8 txsp08
			ENDIF
			IF POS-P-DREAMS_BOOK ||			(gt_PLACED_DREAMS_BOOK &&			POS-P-DREAMS_RUNE)
				AddChoice  9 txsp09
			ENDIF
			IF POS-P-CORPSES_BOOK ||		(gt_PLACED_CORPSES_BOOK &&			POS-P-CORPSES_RUNE)
				AddChoice 10 txsp10
			ENDIF
			IF POS-P-CLOAKS_BOOK ||			(gt_PLACED_CLOAKS_BOOK &&			POS-P-CLOAKS_RUNE)
				AddChoice 11 txsp11
			ENDIF
			IF POS-P-BREATHS_BOOK ||		(gt_PLACED_BREATHS_BOOK &&			POS-P-BREATHS_RUNE)
				AddChoice 12 txsp12
			ENDIF
			IF POS-P-ARROWS_BOOK ||			(gt_PLACED_ARROWS_BOOK &&			POS-P-ARROWS_RUNE)
				AddChoice 13 txsp13
			ENDIF

		ENDIF

		//Leave
		AddChoice 0 tx0003

		GetChoice JAARD

		UUComplete JAARD

		IF !MENUEXIT
			SWITCH CHOICE
				CASE  1
					LookAtTurn JAARD pPED_TRINKETS
				CASE  2
					LookAtTurn JAARD pPED_STORMS
				CASE  3
					LookAtTurn JAARD pPED_STONES
				CASE  4
					LookAtTurn JAARD pPED_SHADOWS
				CASE  5
					LookAtTurn JAARD pPED_MEDICINES
				CASE  6
					LookAtTurn JAARD pPED_MANIPULATIONS
				CASE  7
					LookAtTurn JAARD pPED_KNIVES
				CASE  8
					LookAtTurn JAARD pPED_GLYPHS
				CASE  9
					LookAtTurn JAARD pPED_DREAMS
				CASE 10
					LookAtTurn JAARD pPED_CORPSES
				CASE 11
					LookAtTurn JAARD pPED_CLOAKS
				CASE 12
					LookAtTurn JAARD pPED_BREATH
				CASE 13
					LookAtTurn JAARD pPED_ARROWS
				CASE 14
					Add gt_JAARD_VIEW_LIBRARY
					Add gt_JAARD_JUST_SET_LIB
			ENDSWITCH
			
			IF gt_JAARD_JUST_SET_LIB

				Remove gt_JAARD_JUST_SET_LIB

			ELSE

				UUComplete JAARD
				Capture JAARD cM_POINT
				//"The proper place for that tome is over there, my lord."
				Say jd0003

			ENDIF

			SWITCH CHOICE
				CASE  1
					RunS Use_TRINKETS_Pedestal
				CASE  2
					RunS Use_STORMS_Pedestal
				CASE  3
					RunS Use_STONES_Pedestal
				CASE  4
					RunS Use_SHADOWS_Pedestal
				CASE  5
					RunS Use_MEDICINES_Pedestal
				CASE  6
					RunS Use_MANIPULATIONS_Pedestal
				CASE  7
					RunS Use_KNIVES_Pedestal
				CASE  8
					RunS Use_GLYPHS_Pedestal
				CASE  9
					RunS Use_DREAMS_Pedestal
				CASE 10
					RunS Use_CORPSES_Pedestal
				CASE 11
					RunS Use_CLOAKS_Pedestal
				CASE 12
					RunS Use_BREATH_Pedestal
				CASE 13
					RunS Use_ARROWS_Pedestal
			ENDSWITCH
			Widescreen TRUE
			EngageAndFace P JAARD
			UUComplete P
		ENDIF
	ENDWHILE

	Widescreen FALSE
	RunS JaardActions

END

/////////////////////////////////////////////////////////////////////
VIG Use_TRINKETS_Pedestal MSG-iTRINKETS
	Widescreen TRUE
	MoveCDir P pPED_TRINKETS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_TRINKETS
			IF !gt_PLACED_TRINKETS_BOOK
				IF POS-P-TRINKETS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P TRINKETS_BOOK
					Add gt_PLACED_TRINKETS_BOOK
					SwapObj e_trinkets easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_TRINKETS_BOOK
				IF POS-P-TRINKETS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P TRINKETS_RUNE
					Add f_ATTUNED_TRINKETS
					AwardEP xp_TRINKETS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_TRINKETS
			SpellPanel TRINKETS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_STORMS_Pedestal MSG-iSTORMS
	Widescreen TRUE
	MoveCDir P pPED_STORMS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_STORMS
			IF !gt_PLACED_STORMS_BOOK
				IF POS-P-STORMS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P STORMS_BOOK
					Add gt_PLACED_STORMS_BOOK
					SwapObj e_storms easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_STORMS_BOOK
				IF POS-P-STORMS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P STORMS_RUNE
					Add f_ATTUNED_STORMS
					AwardEP xp_STORMS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_STORMS
			SpellPanel STORMS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_STONES_Pedestal MSG-iSTONES
	Widescreen TRUE
	MoveCDir P pPED_STONES
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_STONES
			IF !gt_PLACED_STONES_BOOK
				IF POS-P-STONES_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P STONES_BOOK
					Add gt_PLACED_STONES_BOOK
					SwapObj e_stones easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_STONES_BOOK
				IF POS-P-STONES_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P STONES_RUNE
					Add f_ATTUNED_STONES
					AwardEP xp_STONES
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_STONES
			SpellPanel STONES 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_SHADOWS_Pedestal MSG-iSHADOWS
	Widescreen TRUE
	MoveCDir P pPED_SHADOWS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_SHADOWS
			IF !gt_PLACED_SHADOWS_BOOK
				IF POS-P-FEARS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P FEARS_BOOK
					Add gt_PLACED_SHADOWS_BOOK
					SwapObj e_shadows easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_SHADOWS_BOOK
				IF POS-P-FEARS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P FEARS_RUNE
					Add f_ATTUNED_SHADOWS
					Add f_ATTUNED_FEARS
					AwardEP xp_SHADOWS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_SHADOWS
			SpellPanel FEARS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_MEDICINES_Pedestal MSG-iMEDICINES
	Widescreen TRUE
	MoveCDir P pPED_MEDICINES
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_MEDICINES
			IF !gt_PLACED_MEDICINES_BOOK
				IF POS-P-MEDICINES_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P MEDICINES_BOOK
					Add gt_PLACED_MEDICINES_BOOK
					SwapObj e_medicines easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_MEDICINES_BOOK
				IF POS-P-MEDICINES_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P MEDICINES_RUNE
					Add f_ATTUNED_MEDICINES
					AwardEP xp_MEDICINES
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_MEDICINES
			SpellPanel MEDICINES 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_MANIPULATIONS_Pedestal MSG-iMANIPULATIONS
	Widescreen TRUE
	MoveCDir P pPED_MANIPULATIONS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_MANIPULATIONS
			IF !gt_PLACED_MANIPULATIONS_BOOK
				IF POS-P-MANIPULATIONS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P MANIPULATIONS_BOOK
					Add gt_PLACED_MANIPULATIONS_BOOK
					SwapObj e_manipulations easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_MANIPULATIONS_BOOK
				IF POS-P-MANIPULATIONS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P MANIPULATIONS_RUNE
					Add f_ATTUNED_MANIPULATIONS
					AwardEP xp_MANIPULATIONS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_MANIPULATIONS
			SpellPanel MANIPULATIONS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_KNIVES_Pedestal MSG-iKNIVES
	Widescreen TRUE
	MoveCDir P pPED_KNIVES
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_KNIVES
			IF !gt_PLACED_KNIVES_BOOK
				IF POS-P-KNIVES_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P KNIVES_BOOK
					Add gt_PLACED_KNIVES_BOOK
					SwapObj e_knives easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_KNIVES_BOOK
				IF POS-P-KNIVES_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P KNIVES_RUNE
					Add f_ATTUNED_KNIVES
					AwardEP xp_KNIVES
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_KNIVES
			SpellPanel KNIVES 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_GLYPHS_Pedestal MSG-iGLYPHS
	Widescreen TRUE
	MoveCDir P pPED_GLYPHS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_GLYPHS
			IF !gt_PLACED_GLYPHS_BOOK
				IF POS-P-GLYPHS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P GLYPHS_BOOK
					Add gt_PLACED_GLYPHS_BOOK
					SwapObj e_glyphs easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_GLYPHS_BOOK
				IF POS-P-GLYPHS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P GLYPHS_RUNE
					Add f_ATTUNED_GLYPHS
					AwardEP xp_GLYPHS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_GLYPHS
			SpellPanel GLYPHS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_DREAMS_Pedestal MSG-iDREAMS
	Widescreen TRUE
	MoveCDir P pPED_DREAMS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_DREAMS
			IF !gt_PLACED_DREAMS_BOOK
				IF POS-P-DREAMS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P DREAMS_BOOK
					Add gt_PLACED_DREAMS_BOOK
					SwapObj e_dreams easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_DREAMS_BOOK
				IF POS-P-DREAMS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P DREAMS_RUNE
					Add f_ATTUNED_DREAMS
					AwardEP xp_DREAMS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_DREAMS
			SpellPanel DREAMS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_CORPSES_Pedestal MSG-iCORPSES
	Widescreen TRUE
	MoveCDir P pPED_CORPSES
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_CORPSES
			IF !gt_PLACED_CORPSES_BOOK
				IF POS-P-CORPSES_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P CORPSES_BOOK
					Add gt_PLACED_CORPSES_BOOK
					SwapObj e_corpses easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_CORPSES_BOOK
				IF POS-P-CORPSES_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P CORPSES_RUNE
					Add f_ATTUNED_CORPSES
					AwardEP xp_CORPSES
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_CORPSES
			SpellPanel CORPSES 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_CLOAKS_Pedestal MSG-iCLOAKS
	Widescreen TRUE
	MoveCDir P pPED_CLOAKS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_CLOAKS
			IF !gt_PLACED_CLOAKS_BOOK
				IF POS-P-CLOAKS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P CLOAKS_BOOK
					Add gt_PLACED_CLOAKS_BOOK
					SwapObj e_cloaks easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_CLOAKS_BOOK
				IF POS-P-CLOAKS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P CLOAKS_RUNE
					Add f_ATTUNED_CLOAKS
					AwardEP xp_CLOAKS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_CLOAKS
			SpellPanel CLOAKS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_BREATH_Pedestal MSG-iBREATH
	Widescreen TRUE
	MoveCDir P pPED_BREATH
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_BREATHS
			IF !gt_PLACED_BREATHS_BOOK
				IF POS-P-BREATHS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P BREATHS_BOOK
					Add gt_PLACED_BREATHS_BOOK
					SwapObj e_breath easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_BREATHS_BOOK
				IF POS-P-BREATHS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P BREATHS_RUNE
					Add f_ATTUNED_BREATHS
					AwardEP xp_BREATHS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_BREATHS
			SpellPanel BREATHS 
		ENDIF
	ENDIF
	Widescreen FALSE
END
/////////////////////////////////////////////////////////////////////
VIG Use_ARROWS_Pedestal MSG-iARROWS
	Widescreen TRUE
	MoveCDir P pPED_ARROWS
	UUComplete P
	IF !gt_PLACED_JAARD_IN_HEX
		//"You must seek the Tome of Hades before Jaard can help you."
		Say xx0008
	ELSE
		IF !f_ATTUNED_ARROWS
			IF !gt_PLACED_ARROWS_BOOK
				IF POS-P-ARROWS_BOOK
					Capture P cM_HEX_PLACE_TOME1
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P ARROWS_BOOK
					Add gt_PLACED_ARROWS_BOOK
					SwapObj e_arrows easel2
					Wait 1125
				ELSE
					//"There are books still to be found, my lord. This is one of them."
					Say jd0001
				ENDIF
			ENDIF
			IF gt_PLACED_ARROWS_BOOK
				IF POS-P-ARROWS_RUNE
					Capture P cM_TOSS_GENTLE
					FX_Sprinkle P
					UUComplete P
					DeleteObjectsInBackpackWithID P ARROWS_RUNE
					Add f_ATTUNED_ARROWS
					AwardEP xp_ARROWS
					Wait 1250
				ELSE
					//"Without the proper rune, the secrets of the book may not be understood, my lord."
					Say jd0002
				ENDIF
			ENDIF
		ENDIF
		IF f_ATTUNED_ARROWS
			SpellPanel ARROWS 
		ENDIF
	ENDIF
	Widescreen FALSE
END

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