SCRIPT_CHAPTER

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

section DECLARE

// entites

	_GARDE_CELTE_1			7
	_CADFANNAN			8
	_GWEN				9
	_MADOG				11
	_MORGANOR			16
	_PAYSAN_CHRETIEN		89
	_PAYSAN_CELTE			386
	_ENFANT_CELTE			387
	_PAYSANNE_CHRETIENNE		388
	_GARDE_CELTE_2			415
	_POUPEE				443
	_DUMMY_CRIS_MADOG		572
	_DUMMY_IDOLE			599
	_PAYSANNE_CELTE			792
	_BALAYETTE			796
	_CORWYN_CHATEAU			1195

// items objet

	_IO_COFFRET			27
	_IO_EPEE_ELAD			123
	_IO_POUPEE			154

// items indice

	_II_SAXONS			2
	_II_ROI				75
	_II_HONNEUR			76


// items destinations



// evenements

	// use

	_U_POUPEE			14

	// pick

	_P_POUPEE			1

	// explorer

	_E_IDOLE_CELTE			2
	_E_MADOG			22

	// commentaires

	_C_CHATEAU_UFF			8
	_C_HALL				9
	_C_MAISON			10
	_C_RENCONTRE_CORWYN		11
	_C_PARLER_CORWYN		24
	_C_PARLER_CORWYN_2		27
	_C_PICK_COFFRET			23

	// dialogues

	_D_CADFANNAN			12
	_D_GWEN				13
	_D_CORWYN			15
	_D_PAYSANNE_CELTE		16
	_D_GARDE_CELTE_2		17
	_D_PAYSAN_CELTE			18
	_D_GARDE_CELTE_1		19
	_D_ENFANT_CELTE			20
	_D_PAYSAN_CHRETIEN		21

	// CTR

	// generiques

	_G_BW_LANDSCAPE_CHATEAU		25

	// options cbts

	// cbts

	// audio

	_A_CRIS_MADOG			26

section END


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

section EVENTS

	PICK
	{
		ID		_P_POUPEE
		AREA		_CHATEAU_UFF
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_POUPEE
		}

		ENTITE		_POUPEE
		ITEM		(_IO_POUPEE, _INV_OBJET)
		ACTION		1
	}

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

	USE
	{
		ID		_U_POUPEE
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_MADOG
		}

		ENTITE		_POUPEE
		ITEM		(_IO_POUPEE, _INV_OBJET)
		COMMENT		77
		SYNC		"" "pause - give 2"
		ANIM		"give 2" "give 2 - pause"

	}

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

	EXPLORE
	{
		ID		_E_IDOLE_CELTE
		AREA		_CHATEAU_UFF
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_DUMMY_IDOLE
		}

		DELAY		10
		PERSIST		1
		COMMENT		1
		ACTION		1
	}

	EXPLORE
	{
		ID		_E_MADOG
		AREA		_CHATEAU_UFF
		HEIGHT		"H1"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_MADOG
		}

		DELAY		10
		PERSIST		1
		COMMENT		76
		ACTION		1
	}

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

	COMMENT
	{
		ID		_C_CHATEAU_UFF
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	1000
			ORIENT	"NONE"
			ENTITE	_MORGANOR
		}

		COMMENT		2
	}

	COMMENT
	{
		ID		_C_HALL
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	1200
			ORIENT	"NONE"
			ENTITE	_CADFANNAN
		}

		COMMENT		3
	}

	COMMENT
	{
		ID		_C_MAISON
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	700
			ORIENT	"NONE"
			ENTITE	_GWEN
		}

		COMMENT		4
	}

	COMMENT
	{
		ID		_C_RENCONTRE_CORWYN
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	700
			ORIENT	"NONE"
			ENTITE	_CORWYN_CHATEAU
		}

		COMMENT		5
		STATUS		0
	}

	COMMENT
	{
		ID		_C_PARLER_CORWYN
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			TRIGGER 6
			ORIENT	"NONE"
		}

		DELAY		10
		PERSIST		1
		COMMENT		80
		STATUS		0
	}

	COMMENT
	{
		ID		_C_PARLER_CORWYN_2
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			TRIGGER 6
			ORIENT	"NONE"
		}

		COMMENT		80
		STATUS		0
	}

	COMMENT
	{
		ID		_C_PICK_COFFRET
		AREA		_CHATEAU_UFF

		PRIMTRIG
		{
			TRIGGER	6
			ORIENT	"NONE"
		}

		DELAY		10
		PERSIST		1
		COMMENT		75
		STATUS		0
	}

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

	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	(49, 50) (51, 52) (53, 54) (55, 56) (57, 58)
			BASEJEU	17
			BASEDOC	32
		}

		FIN
		{
			ID	1
			TALK	(59, 60)
		}

		RETOUR
		{
			ID	1
			TALK	(61, 62)
		}

		SUJET
		{
			ID	_II_SAXONS
			TALK	(65, 66) (67, 68) (69, 70)
			BASEJEU	12
			BASEDOC	179
		}

		SUJET
		{
			ID	_II_HONNEUR
			TALK	(71, 72) (73, 74)
		}

		GIVE
		{
			ID	_IO_EPEE_ELAD
			TALK	(63, 64)
			STATUS	0
		}
	}

	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	(31, 32) (33, 34) (35, 36) (37, 38) (39, 40) (41, 42)
			BASEJEU	13
		}

		FIN
		{
			ID	1
			TALK	(43, 44)
		}

		RETOUR
		{
			ID	1
			TALK	(45, 46)
		}

		SUJET
		{
			ID	_II_ROI
			TALK	(47, 48, _IO_COFFRET, _INV_OBJET)
			BASEJEU	15
		}
	}

	DIALOG
	{
		ID		_D_CORWYN
		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	(24, 25) (26, 27)
			BASEJEU	16
			BASEDOC	14
		}

		FIN
		{
			ID	1
			TALK	(28, 29)
		}

		RETOUR
		{
			ID	1
			TALK	(30, 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	(6, 7)
			BASEJEU	11
		}

		FIN
		{
			ID	1
			TALK	(8, 9)
		}

		RETOUR
		{
			ID	1
			TALK	(6, 7)
		}
	}

	DIALOG
	{
		ID		_D_GARDE_CELTE_2
		AREA		_CHATEAU_UFF
		ENTITE		_GARDE_CELTE_2

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_GARDE_CELTE_2
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_GARDE_CELTE_2
		}

		STAND
		{
			ID	1
			TALK	(700, 11)
		}

		FIN
		{
			ID	1
			TALK	(12, 11)
		}

		RETOUR
		{
			ID	1
			TALK	(700, 11)
		}
	}

	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	(14, 15)
		}

		FIN
		{
			ID	1
			TALK	(78, 79)
		}

		RETOUR
		{
			ID	1
			TALK	(14, 15)
		}
	}

	DIALOG
	{
		ID		_D_GARDE_CELTE_1
		AREA		_CHATEAU_UFF
		ENTITE		_GARDE_CELTE_1

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_GARDE_CELTE_1
		}

		PRIMTRIG
		{
			DIST	250
			ORIENT	"NONE"
			ENTITE	_GARDE_CELTE_1
		}

		STAND
		{
			ID	1
			TALK	(10, 11)
		}

		FIN
		{
			ID	1
			TALK	(12, 11)
		}

		RETOUR
		{
			ID	1
			TALK	(10, 11)
		}
	}

	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	(16, 17)
		}

		FIN
		{
			ID	1
			TALK	(18, 19)
		}

		RETOUR
		{
			ID	1
			TALK	(16, 17)
		}
	}

	DIALOG
	{
		ID		_D_PAYSAN_CHRETIEN
		AREA		_CHATEAU_UFF
		ENTITE		_PAYSAN_CHRETIEN

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_PAYSAN_CHRETIEN
		}

		PRIMTRIG
		{
			DIST	400
			ORIENT	"NONE"
			ENTITE	_PAYSAN_CHRETIEN
		}

		STAND
		{
			ID	1
			TALK	(20, 21)
		}

		FIN
		{
			ID	1
			TALK	(22, 23)
		}

		RETOUR
		{
			ID	1
			TALK	(22, 23)
		}
	}

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

	ACTION
	{
		ID	_G_BW_LANDSCAPE_CHATEAU
		AREA	_LANDSCAPE_UFF

		PRIMTRIG
		{
			ORIENT	"NONE"
			TRIGGER	1
		}

		STATUS		0
	}

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

	SOUND
	{
		ID	_A_CRIS_MADOG
		AREA	_CHATEAU_UFF

		PRIMTRIG
		{
			DIST	600
			ORIENT	"NONE"
			ENTITE	_DUMMY_CRIS_MADOG
		}

		SOUND	"N_crimad" 100 ""

		PERSIST	1

		STATUS	0
	}

section END


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

section COMBATS



section END

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

section INIT

//  corwyn

	set $pub3, 1

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

// Chateau

	#OBJ_LOAD		(_CADFANNAN,			22, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_GWEN,				17, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_MADOG,			18, _CHATEAU_UFF, 1, 1, 0)
	#OBJ_LOAD		(_POUPEE,			16, _CHATEAU_UFF, 1, 1, 0)
	#OBJ_LOAD		(_CORWYN_CHATEAU,		13, _CHATEAU_UFF, 0, 1, 1)
	#OBJ_LOAD		(_DUMMY_IDOLE,			25, _CHATEAU_UFF, 1, 0, 0)
	#OBJ_LOADMAIND		(_PAYSANNE_CELTE,		20, _CHATEAU_UFF, _BALAYETTE, 1, 1, 1)
	#OBJ_LOAD		(_GARDE_CELTE_2,		44, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_PAYSAN_CELTE,			 9, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_GARDE_CELTE_1,		13, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_ENFANT_CELTE,			10, _CHATEAU_UFF, 1, 1, 1)
	#OBJ_LOAD		(_PAYSAN_CHRETIEN,		11, _CHATEAU_UFF, 1, 1, 0)
//	#OBJ_LOAD		(_PAYSANNE_CHRETIENNE,		30, _CHATEAU_UFF, 1, 1, 0)		// LG
	#OBJ_LOAD		(_DUMMY_CRIS_MADOG,		 4, _CHATEAU_UFF, 1, 0, 0)

// desactivation de triggers

	#TRG_DISABLESL		(2, _CHATEAU_UFF)

// Portes

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

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

// colli dummy

	#OBJ_DISABLECOLLIOBJ	(_DUMMY_CRIS_MADOG)
	#OBJ_DISABLECOLLIOBJ	(_DUMMY_IDOLE)

//	#OBJ_DISABLECOLLIOBJ	(_PAYSANNE_CHRETIENNE)		// LG

section END

section LOOP

	OnDialog _D_GWEN sujet _II_ROI
	{
		#EVT_ENABLE	(_C_PARLER_CORWYN_2)
		#EVT_ENABLE	(_C_RENCONTRE_CORWYN)
		#OBJ_ENABLE	(_CORWYN_CHATEAU)
		#EVT_DISABLE	(_C_PICK_COFFRET)
	}

	OnDialog _D_CADFANNAN stand 1
	{
		#DOO_UNLOCK	(_PORTE_CHATEAU_UFF_N1, _CHATEAU_UFF)
		#DOO_UNLOCK	(_PORTE_MAISON_BW_N1, _CHATEAU_UFF)
		#OBJ_DISABLE	(_GARDE_CELTE_1)
		#OBJ_DISABLE	(_GARDE_CELTE_2)
		#EVT_ENABLE	(_C_PICK_COFFRET)
	}

	OnDialog _D_CORWYN stand 1
	{
		#EVT_DISABLE	(_C_PARLER_CORWYN_2)
		#TRG_ENABLESL	(2, _CHATEAU_UFF)
		#EVT_ENABLE	(_G_BW_LANDSCAPE_CHATEAU)
	}

	OnEvent		_C_PARLER_CORWYN_2
	{
		#EVT_ENABLE	(_C_PARLER_CORWYN)
	}

	OnEvent 	_U_POUPEE
	{
		#BJE_EVENT	(14, _U_POUPEE)
	}

	OnEvent 	_G_BW_LANDSCAPE_CHATEAU
	{
		if @INV_OWNPL	(_II_HONNEUR, _INV_INDIC) = 1
		{
			#INV_REMPL	(_II_HONNEUR, _INV_INDIC)
		}

		if @INV_OWNPL	(_II_SAXONS, _INV_INDIC) = 1
		{
			#INV_REMPL	(_II_SAXONS, _INV_INDIC)
		}

		if @INV_OWNPL	(_IO_POUPEE, _INV_OBJET) = 1
		{
			#INV_REMPL	(_IO_POUPEE, _INV_OBJET)
		}

		ENDC
	}

section END

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

section CTR



section END