SCRIPT_CHAPTER

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

section DECLARE

// entites

	_PICTE				24
	_EPEE_VERITE			384
	_PAYSAN_CELTE			386
	_ENFANT_CELTE			387
	_PICTE_GARDE			396
	_LETTRE_GWEN			397
	_EPEE_BRADWEN_PALADIN		569
	_DUMMY_IDOLES			599
	_MORGANOR			749
	_PAYSANNE_CELTE			792
	_BALAYETTE			796
	_LETTRE_GWEN_2			1198

// items objet

	_IO_SCEAU			127
	_IO_HERBES			128
	_IO_LETTRE_GWEN			129

// items indice

	_II_GWEN			18

// items destinations

	_ID_LANDSCAPE_MAGO		102

// evenements

	// use

	_U_LETTRE_GWEN			5
	_U_LETTRE_GWEN_COL_DRA		28
	_U_LETTRE_GWEN_COL_GEO		29

	// pick

	_P_LETTRE_GWEN			1

	// explorer

	_E_PORTES_CHATEAU_UFF		2
	_E_EPEE_VERITE			3
	_E_SIGNE_DRAGON			4
	_E_IDOLES_CELTES		24

	// commentaires

	_C_APPELLE_PAYSANNE_CELTE	19
	_C_APPELLE_PAYSAN_CELTE		20
	_C_APPELLE_ENFANT_CELTE		21
	_C_DECOUV_PICTE			22
	_C_FIN_CHAPITRE			23

	// dialogues

	_D_PAYSANNE_CELTE		13
	_D_PAYSAN_CELTE			14
	_D_ENFANT_CELTE			15
	_D_MORGANOR			16
	_D_PICTE_GARDE			17
	_D_PICTE			18

	// CTR

	// generiques

	_G_PRIER_CROIX_1		11
	_G_PRIER_CROIX_2		12
	_G_BW_ENTREE_MAGO		25
	_G_ACT_PORTE_CHATEAU_UFF	26
	_CTR_PRIER			27

	// options cbts

	// cbts

section END


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

section EVENTS

	USE
	{
		ID		_U_LETTRE_GWEN
		AREA		_CHATEAU_UFF

		ENTITE		_LETTRE_GWEN
		ITEM		(_IO_LETTRE_GWEN, _INV_OBJET)
		COMMENT		33
		SYNC		"" "lire"
		ANIM		"use paper" "lire - pause"
	}

	USE
	{
		ID		_U_LETTRE_GWEN_COL_DRA
		AREA		_COLLINE_DRAGON_ROUGE

		ENTITE		_LETTRE_GWEN
		ITEM		(_IO_LETTRE_GWEN, _INV_OBJET)
		COMMENT		33
		SYNC		"" "lire"
		ANIM		"use paper" "lire - pause"
	}

	USE
	{
		ID		_U_LETTRE_GWEN_COL_GEO
		AREA		_COLLINE_ST_GEORGES

		ENTITE		_LETTRE_GWEN
		ITEM		(_IO_LETTRE_GWEN, _INV_OBJET)
		COMMENT		33
		SYNC		"" "lire"
		ANIM		"use paper" "lire - pause"
	}


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

	PICK
	{
		ID		_P_LETTRE_GWEN
		AREA		_CHATEAU_UFF
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_LETTRE_GWEN_2
		}

		ENTITE		_LETTRE_GWEN_2
		ITEM		(_IO_LETTRE_GWEN, _INV_OBJET)
		COMMENT		32
		ACTION		1
	}

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

	EXPLORE
	{
		ID		_E_PORTES_CHATEAU_UFF
		AREA		_CHATEAU_UFF
		HEIGHT		"H2"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_PORTE_CHATEAU_UFF_N2
		}

		PERSIST		1
		COMMENT		700
		ACTION		1
	}

	EXPLORE
	{
		ID		_E_EPEE_VERITE
		AREA		_COLLINE_ST_GEORGES
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	500
			ORIENT	"TO"
			ENTITE	_EPEE_VERITE
		}

		DELAY		10
		PERSIST		1
		COMMENT		705
		ACTION		1
	}

	EXPLORE
	{
		ID		_E_SIGNE_DRAGON
		AREA		_COLLINE_DRAGON_ROUGE
		HEIGHT		"H0"

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		DELAY		10
		PERSIST		1
		COMMENT		701
		ACTION		1
	}

	EXPLORE
	{
		ID		_E_IDOLES_CELTES
		AREA		_CHATEAU_UFF
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_DUMMY_IDOLES
		}

		DELAY		10
		PERSIST		1
		COMMENT		40
		ACTION		1
	}

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

	COMMENT
	{
		ID		_C_APPELLE_PAYSANNE_CELTE
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	400
			ORIENT	"TO"
			ENTITE	_PAYSANNE_CELTE
		}

		DELAY		10
		PERSIST		1
		COMMENT		10
		ACTION		1
		STATUS		0
	}

	COMMENT
	{
		ID		_C_APPELLE_PAYSAN_CELTE
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	400
			ORIENT	"TO"
			ENTITE	_PAYSAN_CELTE
		}

		DELAY		10
		PERSIST		1
		COMMENT		11
		ACTION		1
		STATUS		0
	}

	COMMENT
	{
		ID		_C_APPELLE_ENFANT_CELTE
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	400
			ORIENT	"TO"
			ENTITE	_ENFANT_CELTE
		}

		DELAY		10
		PERSIST		1
		COMMENT		12
		ACTION		1
		STATUS		0
	}

	COMMENT
	{
		ID		_C_DECOUV_PICTE
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	800
			ORIENT	"NONE"
			ENTITE	_PICTE_GARDE
		}

		COMMENT		29
	}

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

	DIALOG
	{
		ID		_D_PAYSANNE_CELTE
		AREA		_CHATEAU_UFF
		ENTITE		_PAYSANNE_CELTE

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_PAYSANNE_CELTE
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_PAYSANNE_CELTE
		}

		STAND
		{
			ID	1
			TALK	(2, 3)
		}

		FIN
		{
			ID	1
			TALK	(4, 5)
		}
	}

	DIALOG
	{
		ID		_D_PAYSAN_CELTE
		AREA		_CHATEAU_UFF
		ENTITE		_PAYSAN_CELTE

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_PAYSAN_CELTE
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_PAYSAN_CELTE
		}

		STAND
		{
			ID	1
			TALK	(2, 6)
		}

		FIN
		{
			ID	1
			TALK	(4, 7)
		}
	}

	DIALOG
	{
		ID		_D_ENFANT_CELTE
		AREA		_CHATEAU_UFF
		ENTITE		_ENFANT_CELTE

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_ENFANT_CELTE
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_ENFANT_CELTE
		}

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

		FIN
		{
			ID	1
			TALK	(4, 9)
		}
	}

	DIALOG
	{
		ID		_D_MORGANOR
		AREA		_CHATEAU_UFF
		ENTITE		_MORGANOR

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_MORGANOR
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_MORGANOR
		}

		STAND
		{
			ID	1
			TALK	(13, 14) (15, 16) (17, 18) (19, 20, _II_GWEN, _INV_INDIC) (21, 22)
			BASEJEU	31
			BASEDOC	49
		}

		FIN
		{
			ID	1
			TALK	(23, 24)
		}

		RETOUR
		{
			ID	1
			TALK	(25, 26)
		}

		SUJET
		{
			ID	_II_GWEN
			TALK	(27, 28)
			BASEJEU	32
		}
	}

	DIALOG
	{
		ID		_D_PICTE_GARDE
		AREA		_CHATEAU_UFF
		ENTITE		_PICTE_GARDE

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_PICTE_GARDE
		}

		PRIMTRIG
		{
			DIST	350
			ORIENT	"NONE"
			ENTITE	_PICTE_GARDE
		}

		STAND
		{
			ID	1
			TALK	(34, 35)
			BASEJEU	29
		}

		FIN
		{
			ID	1
			TALK	(36, 37)
		}

		FIN
		{
			ID	2
			TALK	(34, 38)
			STATUS	0
		}

		RETOUR
		{
			ID	1
			TALK	(36, 37)
		}

		RETOUR
		{
			ID	2
			TALK	(34, 38)
		}
	}

	DIALOG
	{
		ID		_D_PICTE
		AREA		_CHATEAU_UFF
		ENTITE		_PICTE

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_PICTE
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_PICTE
		}

		STAND
		{
			ID	1
			TALK	(704, 31)
		}

		FIN
		{
			ID	1
			TALK	(703, 31)
		}

		RETOUR
		{
			ID	1
			TALK	(704, 31)
		}
	}

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

	ACTION
	{
		ID		_G_BW_ENTREE_MAGO
		AREA		_LANDSCAPE_MAGO

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		STATUS		0
	}

	ACTION
	{
		ID		_G_ACT_PORTE_CHATEAU_UFF
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	550
			ORIENT	"NONE"
			ENTITE	_PICTE_GARDE
		}

		STATUS		0
	}

	ACTION
	{
		ID		_G_PRIER_CROIX_1
		AREA		_COLLINE_ST_GEORGES

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		DELAY		10
		PERSIST		1
		COMMENT		702
		ACTION		1
		PAUSE		1	// LG
	}

	ACTION
	{
		ID		_G_PRIER_CROIX_2
		AREA		_COLLINE_ST_GEORGES

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		DELAY		10
		PERSIST		1
		COMMENT		1
		ACTION		1
		STATUS		0
		PAUSE		1	// LG
	}

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_ENABLEST		(1, _LANDSCAPE_UFF)
	#TRG_ENABLEST		(2, _LANDSCAPE_UFF)

// objets de collision

	#OBJ_DISABLEDECF	(5, _LANDSCAPE_UFF)
	#OBJ_DISABLEDECF	(2, _LANDSCAPE_UFF)
	#OBJ_DISABLEDECF	(7, _LANDSCAPE_UFF)
	#OBJ_DISABLEDECF	(3, _LANDSCAPE_UFF)
	#COL_ENABLE		(4, _LANDSCAPE_UFF)

// Colline St Georges

	#OBJ_LOAD		(_EPEE_VERITE,		 3, _COLLINE_ST_GEORGES, 1, 1, 0)

// Chateau

	#OBJ_LOAD		(_PICTE_GARDE,		42, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_DUMMY_IDOLES,		25, _CHATEAU_UFF, 1, 0, 0)
	#OBJ_LOAD		(_PICTE,		13, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_LETTRE_GWEN_2,	31, _CHATEAU_UFF, 1, 1, 0)
	#OBJ_LOADMAIND		(_PAYSANNE_CELTE,	20, _CHATEAU_UFF, _BALAYETTE, 1, 1, 1)
	#OBJ_LOAD		(_PAYSAN_CELTE,		 9, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_ENFANT_CELTE,		10, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_MORGANOR,		22, _CHATEAU_UFF, 1, 1, 1)

// verouillage portes

	#DOO_LOCK		(_PORTE_CHATEAU_UFF_N1, _CHATEAU_UFF)
	#DOO_LOCK		(_PORTE_MAISON_BW_N1, _CHATEAU_UFF)

// entites flottantes

	#OBJ_LOADACCESS		(_EPEE_BRADWEN_PALADIN, 1)
	#OBJ_LOADACCESS		(_LETTRE_GWEN, 1)

// colli dummy

	#OBJ_DISABLECOLLIOBJ	(_DUMMY_IDOLES)

// 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)

section END

section LOOP

	OnDialog _D_PICTE_GARDE stand 1
	{
		#EVT_DISABLE	(_E_PORTES_CHATEAU_UFF)
		#DOO_UNLOCK	(_PORTE_CHATEAU_UFF_N1, _CHATEAU_UFF)
	}

	OnDialog _D_MORGANOR stand 1
	{
		#OBJ_DISABLE	(_PICTE)
		#DOO_UNLOCK	(_PORTE_MAISON_BW_N1, _CHATEAU_UFF)
		#EVT_DISABLE	(_G_PRIER_CROIX_1)
		#EVT_ENABLE	(_G_PRIER_CROIX_2)
	}

	OnDialog _D_PAYSANNE_CELTE fin 1
	{
		#EVT_DISABLE	(_D_PAYSANNE_CELTE)
		#EVT_ENABLE	(_C_APPELLE_PAYSANNE_CELTE)
	}

	OnDialog _D_PAYSAN_CELTE fin 1
	{
		#EVT_DISABLE	(_D_PAYSAN_CELTE)
		#EVT_ENABLE	(_C_APPELLE_PAYSAN_CELTE)
	}

	OnDialog _D_ENFANT_CELTE fin 1
	{
		#EVT_DISABLE	(_D_ENFANT_CELTE)
		#EVT_ENABLE	(_C_APPELLE_ENFANT_CELTE)
	}

	OnEvent		_P_LETTRE_GWEN
	{
		#EVT_ENABLE	(_G_ACT_PORTE_CHATEAU_UFF)
	}

	OnEvent		_U_LETTRE_GWEN
	{
		if @INV_OWNPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI) = 0
		{
			#INV_PUTPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI)
		}
		#EVT_ENABLE	(_G_BW_ENTREE_MAGO)
		#BJE_EVENT	(33, _U_LETTRE_GWEN)
		#EVT_DISABLE	(_U_LETTRE_GWEN_COL_DRA)
		#EVT_DISABLE	(_U_LETTRE_GWEN_COL_GEO)
	}

	OnEvent		_U_LETTRE_GWEN_COL_DRA
	{
		if @INV_OWNPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI) = 0
		{
			#INV_PUTPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI)
		}
		#EVT_ENABLE	(_G_BW_ENTREE_MAGO)
		#BJE_EVENT	(33, _U_LETTRE_GWEN)
		#EVT_DISABLE	(_U_LETTRE_GWEN)
		#EVT_DISABLE	(_U_LETTRE_GWEN_COL_GEO)
	}

	OnEvent		_U_LETTRE_GWEN_COL_GEO
	{
		if @INV_OWNPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI) = 0
		{
			#INV_PUTPL	(_ID_LANDSCAPE_MAGO, _INV_DESTI)
		}
		#EVT_ENABLE	(_G_BW_ENTREE_MAGO)
		#BJE_EVENT	(33, _U_LETTRE_GWEN)
		#EVT_DISABLE	(_U_LETTRE_GWEN_COL_DRA)
		#EVT_DISABLE	(_U_LETTRE_GWEN)
	}

	OnEvent		_C_DECOUV_PICTE
	{
		#BDC_ENABLE	(15)
	}

	OnEvent		_G_ACT_PORTE_CHATEAU_UFF
	{
		#DOO_LOCK	(_PORTE_CHATEAU_UFF_N1, _CHATEAU_UFF)
	}

	OnEvent		_G_BW_ENTREE_MAGO
	{
		#INT_GOZI		(0, 2)
		ENDC
	}

	OnEvent		_G_PRIER_CROIX_1
	{
		RUN		27
	}

	OnEvent		_G_PRIER_CROIX_2
	{
		RUN		27
	}

section END

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

section CTR

	CTR
	{
		ID	_CTR_PRIER

		PROG
		{
			#OBJ_SENDEVENT	(_BRADWEN, "aspec 3")
			SyncState	_BRADWEN "pause - degainer"
			#OBJ_ENMAIND	(_BRADWEN, _EPEE_BRADWEN_PALADIN)
			SyncState	_BRADWEN "prier chretien - rengainer"
			#OBJ_SUPMAIND	(_BRADWEN)
			SyncState	_BRADWEN "rengainer - pause"
		}
	}

section END