SCRIPT_CHAPTER

/////////////////////////////////////////////////////////////////
// Déclaration constantes & variables
/////////////////////////////////////////////////////////////////

section DECLARE

// entites

	_CLAUDIUS			5
	_GARDE				7
	_CADFANNAN			8
	_GWEN				9
	_MADOG				11
	_FORGERON			12
	_NOVELIUS			13
	_OFFRANDE			14
	_COFFRET			15
	_PIERRE_SORCIER_1		31
	_PIERRE_SORCIER_2		32
	_PIERRE_SORCIER_3		33
	_PIERRE_SORCIER_4		34
	_PIERRE_SORCIER_5		35
	_PIERRE_SORCIER_6		36
	_DUMMY_CLAUDIUS			472
	_DUMMY_COFFRET			572
	_DUMMY_FORGERON			573
	_CORWYN_CHATEAU			743
	_COFFRET_2			750

// items objet

	_IO_EPEE_BRADWEN_CELTE		0
	_IO_HACHE			24
	_IO_LETTRE			26
	_IO_OFFRANDE			27
	_IO_COFFRET			28
	_IO_REPONSE			29
	_IO_EPEE_CASSEE_BRADWEN_CELTE	302

// items indice

	_II_SAXONS			2
	_II_LETTRE			3
	_II_ARDEN			181
	_II_CORWYN			6

// items destinations

	_ID_LANDSCAPE_UFF		100
	_ID_LANDSCAPE_ARDEN		101

// evenements

	// use

	_U_OFFRANDE			1
	_U_COFFRET			2

	// pick

	_P_COFFRET			13

	// explorer
	
	// commentaires

	_C_IDOLES_N			3
	_C_IDOLES_SE			4
	_C_IDOLES_SO			5
	_C_DOLMEN_1			6
	_C_DOLMEN_2			14

	// dialogues

	_D_CADFANNAN			7
	_D_GWEN				8
	_D_FORGERON			9
	_D_CORWYN_CHATEAU		10
	_D_NOVELIUS			11
	_D_CLAUDIUS			12

	// generiques

	_G_BW_ENTREE_UFF		16
	_G_BW_ENTREE_ARDEN		17
	
	// CTR
	
	_CTR_DISPAR_PIERRE_SORCIER	18
	_CTR_DEPART_CORWYN		19

section END


/////////////////////////////////////////////////////////////////
// Définition des événements
/////////////////////////////////////////////////////////////////

section EVENTS

	PICK
	{
		ID		_P_COFFRET
		AREA		_CHATEAU_UFF
		HEIGHT		"H0"

 		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_COFFRET
		}

		ITEM		(_IO_COFFRET, _INV_OBJET)
//		COMMENT		901
		ENTITE		_COFFRET
		ACTION		1
		STATUS		0
	}

	// ==============================================

	USE
	{
		ID		_U_OFFRANDE
		AREA		_ARBRE_MERLIN

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	2
		}

		BASEJEU		16
		ENTITE		_OFFRANDE
		ITEM		(_IO_OFFRANDE, _INV_OBJET)
		SYNC		"" "brandir pierre"
		ANIM		"use cup" "brandir pierre - pause"
	}

	USE
	{
		ID		_U_COFFRET
		AREA		_LAC_DES_OFFRANDES

		PRIMTRIG
		{
			DIST	170
			ORIENT	"TO"
			ENTITE	_DUMMY_COFFRET
		}
	
		ENTITE		_COFFRET_2
		ITEM		(_IO_COFFRET, _INV_OBJET)
		ANIM		"give 2" "pause - give 2"
	}

	// ==============================================

	COMMENT
	{
		ID		_C_IDOLES_N
		AREA		_LAC_DES_OFFRANDES
		HEIGHT		"H2"

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER 2
		}

		COMMENT		606
	}

	COMMENT
	{
		ID		_C_IDOLES_SE
		AREA		_LAC_DES_OFFRANDES
		HEIGHT		"H2"

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER 3
		}

		COMMENT		606
	}

	COMMENT
	{
		ID		_C_IDOLES_SO
		AREA		_LAC_DES_OFFRANDES
		HEIGHT		"H2"

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER 4
		}

		COMMENT		606
	}

	COMMENT
	{
		ID		_C_DOLMEN_1
		AREA		_ARBRE_MERLIN

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	3
		}

		ACTION		1
		COMMENT		607
		PERSIST		1
	}

	COMMENT
	{
		ID		_C_DOLMEN_2
		AREA		_ARBRE_MERLIN

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	4
		}

		ACTION		1
		COMMENT		607
		PERSIST		1
	}

	// ==============================================


	DIALOG
	{
		ID		_D_CADFANNAN
		AREA		_CHATEAU_UFF
		ENTITE		_CADFANNAN

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_CADFANNAN
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_CADFANNAN
		}

		STAND
		{
			ID	1
			TALK	(1, 2)
			BASEJEU	8
		}

		FIN
		{
			ID	1
			TALK	(3, 4)
		}

		RETOUR
		{
			ID	1
			TALK	(5, 6)
		}

		SUJET
		{
			ID	_II_SAXONS
			TALK	(7, 8, _II_LETTRE, _INV_INDIC)
			BASEJEU	9
			BASEDOC	25
		}

		SUJET
		{
			ID	_II_LETTRE
			TALK	(9, 10, _II_CORWYN, _INV_INDIC)
			BASEJEU	10
			BASEDOC	14
		}

		SUJET
		{
			ID	_II_ARDEN
			TALK	(13, 14, _ID_LANDSCAPE_ARDEN, _INV_DESTI)
			STATUS	0
		}

		SUJET
		{
			ID	_II_CORWYN
			TALK	(15, 16)
		}

		GIVE
		{
			ID	_IO_REPONSE
			TALK	(11, 12, _II_ARDEN, _INV_INDIC)
			BASEJEU	14
			BASEDOC	35
		}
	}
		
	DIALOG
	{
		ID		_D_GWEN
		AREA		_CHATEAU_UFF
		ENTITE		_GWEN

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_GWEN
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_GWEN
		}

		STAND
		{
			ID	1
			TALK	(17, 18)
			BASEJEU	11
			BASEDOC	47
		}

		FIN
		{
			ID	1
			TALK	(19, 20)
//			BASEJEU	16
		}

		RETOUR
		{
			ID	1
			TALK	(21, 22)
		}

		SUJET
		{
			ID	_II_CORWYN
			TALK	(23, 24)
		}
	}

	DIALOG
	{
		ID		_D_FORGERON
		AREA		_CHATEAU_UFF
		ENTITE		_FORGERON
		STATUS		0

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_FORGERON
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_FORGERON
		}

		STAND
		{
			ID	1
			TALK	(25, 26)
			BASEDOC	36
		}

		FIN
		{
			ID	1
			TALK	(27, 28)
		}

		RETOUR
		{
			ID	1
			TALK	(27, 28)
		}

		SUJET
		{
			ID	_II_CORWYN
			TALK	(31, 32)
		}
	}

	DIALOG
	{
		ID		_D_CORWYN_CHATEAU
		AREA		_CHATEAU_UFF
		ENTITE		_CORWYN_CHATEAU

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_CORWYN_CHATEAU
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_CORWYN_CHATEAU
		}

		STAND
		{
			ID	1
			TALK	(33, 34) (35, 36)
			BASEJEU	12
		}

		FIN
		{
			ID	1
			TALK	(37, 38)
		}

		RETOUR
		{
			ID	1
			TALK	(37, 38)
		}

		SUJET
		{
			ID	_II_LETTRE
			TALK	(39, 40, _IO_LETTRE, _INV_OBJET)
		}
	}

	DIALOG
	{
		ID		_D_NOVELIUS
		AREA		_COLLINE_ST_GEORGES
		ENTITE		_NOVELIUS

		CAMERA		49

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_NOVELIUS
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_NOVELIUS
		}

		STAND
		{
			ID	1
			TALK	(41, 42)
			BASEDOC	32
		}

		FIN
		{
			ID	1
			TALK	(43, 44)
		}

		RETOUR
		{
			ID	1
			TALK	(45, 46)
		}

		SUJET
		{
			ID	_II_SAXONS
			TALK	(49, 50)
		}

		GIVE
		{
			ID	_IO_LETTRE
			TALK	(47, 48, _IO_REPONSE, _INV_OBJET)
			BASEJEU	13
			BASEDOC	48
		}
	}

	DIALOG
	{
		ID		_D_CLAUDIUS
		AREA		_VILLA_LUCIUS
		ENTITE		_CLAUDIUS

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_CLAUDIUS
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_CLAUDIUS
		}

		FIN
		{
			ID	1
			TALK	(51, 52)
		}

		RETOUR
		{
			ID	1
			TALK	(51, 52)
		}
	}

	// ==============================================

	ACTION
	{
		ID		_G_BW_ENTREE_UFF
		AREA		_LANDSCAPE_UFF

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	4
		}

		STATUS		0
	}

	ACTION
	{
		ID		_G_BW_ENTREE_ARDEN
		AREA		_LANDSCAPE_ARDEN

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		STATUS		0
	}
	
section END

/////////////////////////////////////////////////////////////////
// Définition des combats
/////////////////////////////////////////////////////////////////

section COMBATS

section END

/////////////////////////////////////////////////////////////////
// Programme
/////////////////////////////////////////////////////////////////

section INIT

// desactivation sorties non permises

	#TRG_DISABLESZ		(1, _LANDSCAPE_UFF)
	#TRG_DISABLESZ		(3, _LANDSCAPE_UFF)
	#TRG_DISABLESZ		(6, _LANDSCAPE_UFF)
	
	#TRG_DISABLESL		(4, _ARBRE_MERLIN)
	#TRG_DISABLESL		(5, _ARBRE_MERLIN)
	#TRG_DISABLESL		(6, _ARBRE_MERLIN)
	#TRG_DISABLESL		(7, _ARBRE_MERLIN)
	#TRG_DISABLESL		(8, _ARBRE_MERLIN)
	#TRG_DISABLESL		(9, _ARBRE_MERLIN)
	
	
// objets de collision

	#COL_ENABLE		(1, _LANDSCAPE_UFF)
	#COL_ENABLE		(3, _LANDSCAPE_UFF)
	#COL_DISABLE		(2, _LANDSCAPE_UFF)
	
// objets decor

	#OBJ_DISABLEDECF	(2, _LANDSCAPE_UFF)
	#OBJ_DISABLEDECF	(4, _LANDSCAPE_UFF)
	#OBJ_DISABLEDECF	(7, _LANDSCAPE_UFF)

// Villa Lucius

	#OBJ_LOAD		(_CLAUDIUS,		11, _VILLA_LUCIUS, 1, 1, 1)
	#OBJ_LOAD		(_DUMMY_CLAUDIUS,	26, _VILLA_LUCIUS, 1, 0, 0)

// Chateau

	#OBJ_LOAD		(_GARDE,		44, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_CADFANNAN,		22, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_COFFRET,		24, _CHATEAU_UFF, 0, 1, 0)
	#OBJ_LOAD		(_GWEN,			17, _CHATEAU_UFF, 0, 1, 1)
	#OBJ_LOAD		(_MADOG,		18, _CHATEAU_UFF, 0, 1, 0)
	#OBJ_LOAD		(_FORGERON,		15, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_DUMMY_FORGERON,	43, _CHATEAU_UFF, 1, 0, 0)
	#OBJ_LOAD		(_CORWYN_CHATEAU,	 9, _CHATEAU_UFF, 0, 1, 1)

// Colline St Georges

	#OBJ_LOAD		(_NOVELIUS,		 5, _COLLINE_ST_GEORGES, 0, 1, 1)

// Foret d'Arden

// Arbre Merlin

	#OBJ_LOAD		(_OFFRANDE,		11, _ARBRE_MERLIN, 0, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_1,	12, _ARBRE_MERLIN, 1, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_2,	13, _ARBRE_MERLIN, 1, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_3,	14, _ARBRE_MERLIN, 1, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_4,	15, _ARBRE_MERLIN, 1, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_5,	16, _ARBRE_MERLIN, 1, 1, 0)
	#OBJ_LOAD		(_PIERRE_SORCIER_6,	17, _ARBRE_MERLIN, 1, 1, 0)

// Lac des Offrandes

	#OBJ_LOAD		(_DUMMY_COFFRET,	 7, _LAC_DES_OFFRANDES, 1, 0, 0)
	#OBJ_LOAD		(_COFFRET_2,		 7, _LAC_DES_OFFRANDES, 0, 1, 0)

	#OBJ_DISABLECOLLIOBJ	(_DUMMY_COFFRET)

// aauto

	#OBJ_AATARGET		(_CLAUDIUS, _DUMMY_CLAUDIUS)
	#OBJ_AATARGET		(_FORGERON, _DUMMY_FORGERON)
	
// FXs

 	// chateau uff
	
	#VFX_LOADBOX (_FX_FEU_1, 46, _CHATEAU_UFF, 0)
	#VFX_LOADBOX (_FX_FEU_2, 47, _CHATEAU_UFF, 0)
	#VFX_LOADBOX (_FX_FEU_3, 48, _CHATEAU_UFF, 0)
//	#VFX_LOADBOX (_FX_FEU_4, 49, _CHATEAU_UFF, 0)
//	#VFX_LOADBOX (_FX_FEU_5, 50, _CHATEAU_UFF, 0)
	#VFX_LOADBOX (_FX_FEU_6, 51, _CHATEAU_UFF, 0)
	
	#VFX_START (_FX_FEU_1)
	#VFX_START (_FX_FEU_2)
	#VFX_START (_FX_FEU_3)
//	#VFX_START (_FX_FEU_4)
//	#VFX_START (_FX_FEU_5)
	#VFX_START (_FX_FEU_6)
	
	// maison bw

	#VFX_LOADBOX	(_FX_FEU_CHEMINEE_BW, 52, _CHATEAU_UFF, 0)

	#VFX_START	(_FX_FEU_CHEMINEE_BW)
	
	// arbre merlin
	
	#VFX_LOADBOX	(_FX_PIERRE_SORCIER_1, 13, _ARBRE_MERLIN, 0)
	#VFX_LOAD	(_FX_PIERRE_SORCIER_2, _PIERRE_SORCIER_2, 0)
	
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_1, 12, _ARBRE_MERLIN, 0)
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_2, 13, _ARBRE_MERLIN, 0)
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_3, 14, _ARBRE_MERLIN, 0)
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_4, 15, _ARBRE_MERLIN, 0)
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_5, 16, _ARBRE_MERLIN, 0)
	#VFX_LOADBOX			(_FX_CYCLE_PIERRE_SORCIER_6, 17, _ARBRE_MERLIN, 0)
	
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_1)
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_2)
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_3)
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_4)
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_5)
	#VFX_START			(_FX_CYCLE_PIERRE_SORCIER_6)

// colli dummy

	#OBJ_DISABLECOLLIOBJ	(_DUMMY_CLAUDIUS)
	#OBJ_DISABLECOLLIOBJ	(_DUMMY_COFFRET)
	#OBJ_DISABLECOLLIOBJ	(_DUMMY_FORGERON)

section END

section LOOP

	OnEvent		_P_COFFRET
	{
		#DLG_ENABLESUJ	(_D_CADFANNAN, _CHATEAU_UFF, _II_ARDEN)
		#EVT_ENABLE	(_G_BW_ENTREE_ARDEN)
	}

	OnEvent		_U_OFFRANDE
	{
		RUN		18
	}

	OnEvent		_U_COFFRET
	{
		if @INV_OWNPL	(_ID_LANDSCAPE_UFF, _INV_DESTI) = 0
		{
			#INV_PUTPL	(_ID_LANDSCAPE_UFF, _INV_DESTI)
		}
		#BJE_EVENT	(17, _U_COFFRET)
		#OBJ_MOVETOBOX	(_COFFRET_2, 7)
		#OBJ_ENABLE	(_COFFRET_2)
		#NAR_COMMENT	(605)
		#EVT_ENABLE	(_G_BW_ENTREE_UFF)
	}

	OnEvent		_G_BW_ENTREE_UFF
	{
		#INV_REMPL	(_ID_LANDSCAPE_UFF, _INV_DESTI)
		#INV_REMPL	(_II_LETTRE, _INV_INDIC)
		#INV_REMPL	(_II_CORWYN, _INV_INDIC)
		#INV_REMPL	(_II_ARDEN, _INV_INDIC)
		ENDC
	}

	OnEvent		_G_BW_ENTREE_ARDEN
	{
		#INV_REMPL	(_ID_LANDSCAPE_ARDEN, _INV_DESTI)
	}

	OnEvent		_C_IDOLES_N
	{
		#BJE_EVENT	(18, _C_IDOLES_N)
		#BDC_ENABLE	(188)
	}

	OnEvent		_C_IDOLES_SE
	{
		#BJE_EVENT	(18, _C_IDOLES_SE)
		#BDC_ENABLE	(188)
	}

	OnEvent		_C_IDOLES_SO
	{
		#BJE_EVENT	(18, _C_IDOLES_SO)
		#BDC_ENABLE	(188)
	}

	OnEvent		_C_DOLMEN_1
	{
		#BJE_EVENT	(15, _C_DOLMEN_1)
	}

	OnEvent		_C_DOLMEN_2
	{
		#BJE_EVENT	(15, _C_DOLMEN_2)
	}

	OnDialog _D_CADFANNAN sujet _II_SAXONS
	{
		#OBJ_ENABLE	(_NOVELIUS)
	}

	OnDialog _D_CADFANNAN sujet _II_LETTRE
	{
		#OBJ_ENABLE	(_GWEN)
		#OBJ_ENABLE	(_MADOG)
	}

	OnDialog _D_CADFANNAN give _IO_REPONSE
	{
		#EVT_ENABLE	(_P_COFFRET)
	}

	OnDialog _D_GWEN sujet _II_CORWYN
	{
		#EVT_ENABLE	(_D_FORGERON)
	}
	
	OnDialog _D_GWEN fin 1
	{
		#INV_PUTPL	(_IO_OFFRANDE, _INV_OBJET)
	}
	
	OnDialog _D_GWEN retour 1
	{
		#BDC_ENABLE	(34)
	}

	Ondialog _D_FORGERON sujet _II_CORWYN
	{
		#OBJ_ENABLE	(_CORWYN_CHATEAU)
	}

	Ondialog _D_FORGERON fin 1
	{
		#INV_REMPL	(_IO_EPEE_CASSEE_BRADWEN_CELTE, _INV_OBJET)
		#INV_REMPL	(_IO_HACHE, _INV_OBJET)
		#INV_PUTPL	(_IO_EPEE_BRADWEN_CELTE, _INV_OBJET)
	}

	OnDialog _D_CADFANNAN give _IO_REPONSE
	{
		#OBJ_ENABLE	(_COFFRET)
	}
	
	OnDialog _D_CORWYN_CHATEAU fin 1
	{
		set $pub3, 1
	}

	OnDialog _D_CORWYN_CHATEAU sujet _II_LETTRE
	{
		#EVT_DISABLE	(_D_CORWYN_CHATEAU)
		RUN		19
	}

section END

/////////////////////////////////////////////////////////////////
// Définition des CTR
/////////////////////////////////////////////////////////////////

section CTR

	CTR
	{
		ID	_CTR_DISPAR_PIERRE_SORCIER
		
		PROG
		{
			#NAR_COMMENT	(604)
			Synccomm
			#CAM_LOCK	()
			#CAM_TRACK	(_PIERRE_SORCIER_2)
			#CAM_RETARGET	(1)
			SyncTime	3
			#VFX_START	(_FX_PIERRE_SORCIER_1)
			#VFX_START	(_FX_PIERRE_SORCIER_2)
			SyncFx		_FX_PIERRE_SORCIER_2 0
			#VFX_STOP	(_FX_CYCLE_PIERRE_SORCIER_2)
			#OBJ_DISABLE	(_PIERRE_SORCIER_2)
			#COL_DISABLE	(6, _ARBRE_MERLIN)
			#TRG_ENABLESL	(8, _ARBRE_MERLIN)
			SyncTime	1
			#CAM_TRACK	(_BRADWEN)
			#CAM_RETARGET	(1)
			#CAM_UNLOCK	()
		}
	}
	
	CTR
	{
		ID	_CTR_DEPART_CORWYN
		
		PROG
		{
			#CAM_ENABLE	(14)
			#OBJ_MOVETOBOX	(_BRADWEN, 53)
			#CAM_FORCE	(14, 0)
			#CAM_TRACK	(_CORWYN_CHATEAU)
			#CAM_RETARGET	(1)
			#OBJ_GOTOBOX	(_CORWYN_CHATEAU, 54, 0)
			SyncGoto	_CORWYN_CHATEAU
			#OBJ_GOTOBOX	(_CORWYN_CHATEAU, 3, 0)
			SyncGoto	_CORWYN_CHATEAU
			#CAM_TRACK	(_BRADWEN)
			#CAM_UNLOCK	()
			#OBJ_DISABLE	(_CORWYN_CHATEAU)
		}
	}

section END













