//////////////////////////////////////////////////////////////////////////
// Define Hex Stones
//////////////////////////////////////////////////////////////////////////

VIG InitHexStones FALSE

    // Stage 1
    AddHexStone     FAITH       earth       278 404 hs0001  FS_HEXSTONE
    AddHexStone     RAVENSCAR   earth       159 377 hs0002  RV_HEXSTONE
    AddHexStone     OBELISK     earth       203 390 hs0003  HS_HEXSTONE
    AddHexStone     HEX         elemental   512 120 hs0004  NX_HEXSTONE

    // Stage 2
    AddHexStone     RAINBOW     earth       424 373 hs0005  RA_HEXSTONE
    AddHexStone     SHADOW      earth       380 361 hs0006  NS_HEXSTONE
    AddHexStone     TALENDRAH	earth       553 591 hs0007  TA_HEXSTONE
    AddHexStone     FENS		earth       395 448 hs0007  EF_HEXSTONE

	// Stage 3
	AddHexStone     JAARD		earth       657 434 hs0007  WL_HEXSTONE

	// Stage 4
	AddHexStone     DHEX		earth       525 113 hs0007  D2_HEXSTONE
	AddHexStone     MIRES2		earth       525 136 hs0007  MP_HEXSTONE

	// Hades
	AddHexStone     WELL		elemental   364 574 hs0007  RW_HEXSTONE
	AddHexStone     RIM			elemental   660 574 hs0007  RH_HEXSTONE
	AddHexStone     MINE		elemental   750 294 hs0007  MI_HEXSTONE
	AddHexStone     CHAOS		elemental   274 294 hs0007  CS_HEXSTONE

END

//////////////////////////////////////////////////////////////////////////
// Faith Stone
//////////////////////////////////////////////////////////////////////////

VIG ClickFaithHex  MSG-iFAITH_HEXSTONE

	IF gg_JUST_AFTER_FEST
		PleaseSteveDontMessWithTheLightingAfterThisVignette
		PlayerControl Off
	ENDIF

    MoveCDir        P           pP_FAITH_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_FAITH_HEX
END

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

VIG ReachedFaithHex gd_GOT_TO_FAITH_HEX
	Remove          gd_GOT_TO_FAITH_HEX
	IF mj_BEEN_TO_HEX && !f_DISABLE_HEXSTONE_FAITH
		IF gg_JUST_AFTER_FEST
			Remove gg_JUST_AFTER_FEST
			PleaseSteveDontMessWithTheLightingAfterThisVignette
			PlayerControl On
		ENDIF
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-FAITH
			ActivateHexStone        FAITH
			AwardEP xp_HEXSTONE_FAITH
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
			UUComplete	P
			PostMsg     t_NX_HEXSTONE
		ELSE
			// PlaySFXPerson	M-H1.WAV	P
			Wait			2000
			UUComplete      P
			DoHexStone		FAITH
		ENDIF
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter  P FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// New Hex
//////////////////////////////////////////////////////////////////////////

VIG ClickHexHex     MSG-iHEX_HEXSTONE
    MoveCDir        P           pP_HEX_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_HEX_HEX
END

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

VIG ReachedHexHex gd_GOT_TO_HEX_HEX
	Remove          gd_GOT_TO_HEX_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-HEX
			ActivateHexStone        HEX
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait        1000
		DoHexStone     HEX
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter  P FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Ravenscar
//////////////////////////////////////////////////////////////////////////

VIG ClickRavensHex  MSG-iRAVENS_HEXSTONE
    MoveCDir        P           pP_RAVENS_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_RAVENS_HEX
END

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

VIG ReachedRavensHex gd_GOT_TO_RAVENS_HEX
    Remove          gd_GOT_TO_RAVENS_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-RAVENSCAR
			ActivateHexStone        RAVENSCAR
			AwardEP xp_HEXSTONE_RAVENS
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait        1000
		DoHexStone     RAVENSCAR
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter  P FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Obelisk
//////////////////////////////////////////////////////////////////////////

VIG ClickObeliskHex  MSG-iOBELISK_HEXSTONE
    MoveCDir        P           pDOVE_OBELISK
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_OBELISK_HEX
END

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

VIG ReachedObeliskHex gd_GOT_TO_OBELISK_HEX
    Remove          gd_GOT_TO_OBELISK_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-OBELISK
			ActivateHexStone        OBELISK
			AwardEP xp_HEXSTONE_OBELISK
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		OBELISK
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter  P FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Rainbow Rock
//////////////////////////////////////////////////////////////////////////

VIG ClickRainbowHex  MSG-iRAINBOW_HEXSTONE
    MoveCDir        P           pP_RAINBOW_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_RAINBOW_HEX
END

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

VIG ReachedRainbowHex gd_GOT_TO_RAINBOW_HEX
    Remove          gd_GOT_TO_RAINBOW_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-RAINBOW
			ActivateHexStone        RAINBOW
			AwardEP		xp_HEXSTONE_RAINBOW
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		RAINBOW
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Shadow Guard
//////////////////////////////////////////////////////////////////////////

VIG ClickShadowHex  MSG-iSHADOW_HEXSTONE
    MoveCDir        P           pP_SHADOW_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_SHADOW_HEX
END

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

VIG ReachedShadowHex gd_GOT_TO_SHADOW_HEX
    Remove          gd_GOT_TO_SHADOW_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-SHADOW
			ActivateHexStone        SHADOW
			AwardEP xp_HEXSTONE_SHADOW
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		SHADOW
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Talendrah
//////////////////////////////////////////////////////////////////////////

VIG ClickTalenHex  MSG-iTALEN_HEXSTONE
    MoveCDir        P           pP_TALEN_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_TALEN_HEX
END

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

VIG ReachedTalenHex gd_GOT_TO_TALEN_HEX
    Remove          gd_GOT_TO_TALEN_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-TALENDRAH
			ActivateHexStone        TALENDRAH
			AwardEP xp_HEXSTONE_TALEN
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		TALENDRAH
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Eastern Fens
//////////////////////////////////////////////////////////////////////////

VIG ClickFensHex  MSG-iFENS_HEXSTONE
    MoveCDir        P           pP_FENS_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_FENS_HEX
END

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

VIG ReachedFensHex gd_GOT_TO_FENS_HEX
    Remove          gd_GOT_TO_FENS_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-FENS
			ActivateHexStone        FENS
			AwardEP xp_HEXSTONE_FENS
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		FENS
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Dark Hex
//////////////////////////////////////////////////////////////////////////

VIG ClickDHexHex  MSG-iDHEX_HEXSTONE
    MoveCDir        P           pP_DHEX_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_DHEX_HEX
END

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

VIG ReachedDHexHex gd_GOT_TO_DHEX_HEX
    Remove          gd_GOT_TO_DHEX_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-DHEX
			ActivateHexStone        DHEX
			AwardEP xp_HEXSTONE_DHEX
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		DHEX
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Mires2
//////////////////////////////////////////////////////////////////////////

VIG ClickMires2Hex  MSG-iMIRES_HEXSTONE
    MoveCDir        P           pP_MIRES_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_MIRES2_HEX
END

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

VIG ReachedMires2Hex gd_GOT_TO_MIRES2_HEX
    Remove          gd_GOT_TO_MIRES2_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-MIRES2
			ActivateHexStone        MIRES2
			AwardEP xp_HEXSTONE_GTHOR
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		MIRES2
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Jaard
//////////////////////////////////////////////////////////////////////////

VIG ClickJaardHex  MSG-iJAARD_HEXSTONE
    MoveCDir        P           pP_JAARD_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_JAARD_HEX
END

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

VIG ReachedJaardHex gd_GOT_TO_JAARD_HEX
    Remove          gd_GOT_TO_JAARD_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-JAARD
			ActivateHexStone        JAARD
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			AwardEP		xp_HEXSTONE_JAARD
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		JAARD
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Well
//////////////////////////////////////////////////////////////////////////

VIG ClickWellHex  MSG-iWELL_HEXSTONE
    MoveCDir        P           pP_WELL_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_WELL_HEX
END

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

VIG ReachedWellHex gd_GOT_TO_WELL_HEX
    Remove          gd_GOT_TO_WELL_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-WELL
			ActivateHexStone        WELL
			AwardEP		xp_HEXSTONE_WELL
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		WELL
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Chaos
//////////////////////////////////////////////////////////////////////////

VIG ClickChaosHex  MSG-iTORTOISE_HEXSTONE
    MoveCDir        P           pP_TORTOISE_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_CHAOS_HEX
END

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

VIG ReachedChaosHex gd_GOT_TO_CHAOS_HEX
    Remove          gd_GOT_TO_CHAOS_HEX
	IF mj_BEEN_TO_HEX && !f_DISABLE_HEXSTONE_CHAOS
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-CHAOS
			ActivateHexStone        CHAOS
			AwardEP		xp_HEXSTONE_CHAOS
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		CHAOS
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// HadesRim
//////////////////////////////////////////////////////////////////////////

VIG ClickRimHex  MSG-iRIM_HEXSTONE
    MoveCDir        P           pP_RIM_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_RIM_HEX
END

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

VIG ReachedRimHex gd_GOT_TO_RIM_HEX
    Remove          gd_GOT_TO_RIM_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-RIM
			ActivateHexStone        RIM
			AwardEP		xp_HEXSTONE_HRIM
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone		RIM
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Mine
//////////////////////////////////////////////////////////////////////////

VIG ClickMineHex  MSG-iMINE_HEXSTONE
    MoveCDir        P           pP_MINE_HEX
    AddControl      P           SetScriptFlagControl    gd_GOT_TO_MINE_HEX
END

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

VIG ReachedMineHex gd_GOT_TO_MINE_HEX
	Remove          gd_GOT_TO_MINE_HEX
	IF mj_BEEN_TO_HEX
		Capture         P           cM_POINT
		AddFilter		P			FilterToStart
		FX_Invisible	P
		Add				gg_PLAYER_INVIS
		IF              !HSACTIVE-MINE
			ActivateHexStone        MINE
			AwardEP		xp_HEXSTONE_MINE
			PlaySFX		hex-stone-activation.wav
			GainMP P 1000
			Wait        2000
		ELSE
			// PlaySFXPerson		M-H1.WAV	P
		ENDIF
		UUComplete      P
		Wait			2000
		DoHexStone      MINE
	ELSE
		Capture    P cM_POINT
		AddControl P DelayControl 0 1
		AddControl P Capture cM_SHRUG1
		AddFilter		P			FilterToStart
	ENDIF
END

//////////////////////////////////////////////////////////////////////////
// Make the player visible again
//////////////////////////////////////////////////////////////////////////

VIG MakeVis FIVESEC && gg_READY_FOR_VIS
	Remove gg_READY_FOR_VIS
	FX_Visible P
END

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

VIG Invis gg_PLAYER_INVIS
	Remove gg_PLAYER_INVIS
	Add gg_READY_FOR_VIS
END

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

VIG AttuneAllHS FALSE
    ActivateHexStone        FAITH       
    ActivateHexStone        RAVENSCAR   
    ActivateHexStone        OBELISK     
    ActivateHexStone        HEX         
    ActivateHexStone        RAINBOW     
    ActivateHexStone        SHADOW      
    ActivateHexStone        TALENDRAH	
    ActivateHexStone        FENS		
	ActivateHexStone        JAARD		
	ActivateHexStone        DHEX		
	ActivateHexStone        MIRES2
	ActivateHexStone        WELL		
	ActivateHexStone        RIM			
	ActivateHexStone        MINE		
	ActivateHexStone        CHAOS		
END

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



