SCRIPT_CHAPTER

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

section DECLARE

// entites
	_COURONNE_SAUL		546

	_BROCHE_LUTISSE		86
	_ETENDARD		879
	_DUMMY_CROIX_NEUVE	470
	_DUMMY_CROIX_VIEILLE	471
	_DUMMY_FORG		450

//garde entrée  	228 : garde marcus
//novelius		13	et pas 97


// items objet
	_IO_CHASTIEFOL		1
	_IO_BROCHE_LUTISSE	86	//ch 1 2 3
	_IO_ECU			209	//ch 1 2 3
	_IO_COURONNE_SAUL	203	//ch 1 2 3
// items indice
	_II_ARTHUR		29
	_II_LUTISSE		47
	_II_LANCELOT		11
	_II_COURONNE_SAUL	168

// items destinations
	_ID_MAGO		102

// evenements

	_C_CROIX_EST_VIEILLE	11
	_PRIE_NV_1		2
	_PRIE_NV_2		3
	_PRIE_V_1		4
	// use
	_DEBUT_QUETE		7
	_ARRIVEE_COUR		8
	// pick
	_P_COURONNE		1
	// explorer
	_E_ETENDARDS	6
	// commentaires

	// dialogues
	_D_LANCELOT	19
	_D_MENDIANT	18
	_D_NOVELIUS	17
	// CTR

	// generiques
	_IN_MAGO	40

	// options cbts

	// cbts
	$croixV
	$prierV

section END


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

section EVENTS

	PICK
	{
		ID		_P_COURONNE
		AREA		_COUR_CAMELOT
		HEIGHT		"H0"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_COURONNE_SAUL
		}
		ENTITE		_COURONNE_SAUL
		ACTION		1
		ITEM		(_IO_COURONNE_SAUL, _INV_OBJET)
		COMMENT		8
		STATUS		1
	}

	EXPLORE
	{
		ID		_E_ETENDARDS
		AREA		_COUR_CAMELOT

		PRIMTRIG
		{

			ORIENT "NONE"
			TRIGGER	6
		}
		ITEM		(_II_LANCELOT, _INV_INDIC)
		DELAY		0

		COMMENT		5
		ACTION		1

	}

	ACTION
	{
		ID	_PRIE_NV_1
		AREA	_COUR_CAMELOT
		PRIMTRIG
		{
			DIST	300
			ENTITE	_DUMMY_CROIX_NEUVE
			ORIENT	"TO"
		}
		ACTION		1
		DELAY		10
		PERSIST		1
		PAUSE		1	// LG
	}
	ACTION
	{
		ID	_PRIE_NV_2
		AREA	_COUR_CAMELOT
		PRIMTRIG
		{
			DIST	300
			ENTITE	_DUMMY_CROIX_NEUVE
			ORIENT	"TO"
		}
		ACTION		1
		STATUS		0
		DELAY		10
		PERSIST		1
		PAUSE		1	// LG
	}
	ACTION
	{
		ID	_PRIE_V_1
		AREA	_COUR_CAMELOT
		PRIMTRIG
		{
			DIST	300
			ENTITE	_DUMMY_CROIX_VIEILLE
			ORIENT	"TO"
		}
		ACTION		1
		BASEJEU		12
		STATUS		0
		PAUSE		1	// LG
	}
	EXPLORE
	{
		ID		_C_CROIX_EST_VIEILLE
		AREA		_COUR_CAMELOT

		PRIMTRIG
		{
			DIST	300
			ENTITE	_DUMMY_CROIX_VIEILLE
			ORIENT	"TO"
		}

		DELAY		0

		COMMENT		6
		ACTION		1

	}

	COMMENT
	{
		ID		_DEBUT_QUETE
		AREA		_LANDSCAPE_CAMELOT

		PRIMTRIG
		{
			TRIGGER 3
		}

		COMMENT		1

		BASEDOC		155
		BASEDOC		156
		BASEDOC		157
		BASEDOC		158
		BASEDOC		159
		BASEDOC		160
		BASEDOC		88
	}
	COMMENT
	{
		ID		_ARRIVEE_COUR
		AREA		_COUR_CAMELOT

		PRIMTRIG
		{
			TRIGGER 7
		}
		COMMENT		2
		BASEDOC		82
	}
	COMMENT
	{
		ID		9
		AREA		28

		PRIMTRIG
		{
			DIST	800
			ENTITE	396
		}

		COMMENT		3

	}
	COMMENT
	{
		ID		10
		AREA		26

		PRIMTRIG
		{
			DIST	800
			ENTITE	2
		}

		COMMENT		4

	}
	ACTION
	{
		ID		_IN_MAGO
		AREA		102

		PRIMTRIG
		{
			TRIGGER 2
		}
	}


	DIALOG
	{
		ID		12
		AREA		_CAMP_SAXON
		ENTITE		_GARDE_SAXON

		//CAMERA		8

		PRIMTRIG
		{
			DIST	400
			ORIENT	"NONE"
			ENTITE	_GARDE_SAXON
			////TRIGGER		2
		}

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_GARDE_SAXON
		}
		STAND
		{
			ID	1
			TALK	(11,12)

		}

		FIN
		{
			ID	1
			TALK	(13 , 14 )
		}

		RETOUR
		{
			ID	1
			TALK	(13 , 14 )
		}

		SUJET
		{
			ID	_II_LANCELOT
			TALK	( 17,14)
		}

		SUJET
		{
			ID	_II_ARTHUR
			TALK	( 15,16)
			BASEJEU 1
		}

	}

	DIALOG
	{
		ID		13
		AREA		_CAMP_SAGRAMOR
		ENTITE		_GARDE_ROMAIN

		PRIMTRIG
		{
			DIST	250
			//ORIENT	"NONE"
			ENTITE	_GARDE_ROMAIN
		}

		SECTRIG
		{
			DIST	200
			ORIENT	"FACE"
			ENTITE	_GARDE_ROMAIN
		}
		STAND
		{
			ID	1
			TALK	( 11, 705)

		}

		FIN
		{
			ID	1
			TALK	( 13, 19 )
		}
		FIN
		{
			ID	2
			TALK	( 13, 21 )
			STATUS 	0
		}

		RETOUR
		{
			ID	1
			TALK	( 13, 19 )
		}

		RETOUR
		{
			ID	2
			TALK	( 13, 21 )
			STATUS 	0
		}
		SUJET
		{
			ID	_II_LANCELOT
			TALK	( 17, 21 )
		}
		SUJET
		{
			ID	_II_ARTHUR
			TALK	( 15, 20 )
			BASEJEU 3
		}
	}

	DIALOG
	{
		ID		14
		AREA		_CAMP_MARCUS
		ENTITE		_GARDE_MARCUS


		PRIMTRIG
		{
			DIST	500
			//ORIENT	"NONE"
			ENTITE	_GARDE_MARCUS
		}

		SECTRIG
		{
			DIST	400
			ORIENT	"FACE"
			ENTITE	_GARDE_MARCUS
		}
		STAND
		{
			ID	1
			TALK	( 11, 704)
		}

		FIN
		{
			ID	1
			TALK	(13, 23)
		}

		RETOUR
		{
			ID	1
			TALK	(13, 23)

		}
		SUJET
		{
			ID	_II_LANCELOT
			TALK	( 17, 25 )
		}
		SUJET
		{
			ID	_II_ARTHUR
			TALK	( 15, 24 )
			BASEJEU 2
		}
	}

	DIALOG
	{
		ID		15
		AREA		_CAMP_ATREBATES
		ENTITE		_GARDE_PICTE

		PRIMTRIG
		{
			DIST	400
			ORIENT	"NONE"
			ENTITE	_GARDE_PICTE
			////TRIGGER		3
		}

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_GARDE_PICTE
		}

		STAND
		{
			ID	1
			TALK	(11 ,31  )
			BASEJEU	4
		}

		FIN
		{
			ID	1
			TALK	(13 ,32  )
			//FIGHT	_OPTION_COMBAT_PICTE
		}

		RETOUR
		{
			ID	1
			TALK	( 13, 32 )
			//FIGHT	_OPTION_COMBAT_PICTE
		}

	}

	DIALOG
	{
		ID		16
		AREA		_COUR_CAMELOT
		ENTITE		_GARDE_ENTREE

		PRIMTRIG
		{
			DIST	350
			ORIENT	"NONE"
			ENTITE	_GARDE_ENTREE
		}

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_GARDE_ENTREE
		}

		STAND
		{
			ID	1
			TALK	(11, 26 )
		}

		FIN
		{
			ID	1
			TALK	(13,27 )
			BASEJEU	5
		}

		FIN
		{
			ID	2
			TALK	(13, 30)
			STATUS  0
		}

		RETOUR
		{
			ID	1
			TALK	(13, 27)
		}

		RETOUR
		{
			ID	2
			TALK	(13, 30)
			STATUS	0
		}
		GIVE
		{
			ID 	_IO_ECU
			TALK	(58, 30)
		}
		SUJET
		{
			ID	_II_LANCELOT
			TALK	(17, 29)
			BASEJEU	6
		}
		SUJET
		{
			ID	_II_ARTHUR
			TALK	(57, 28)
		}
	}

	DIALOG
	{
		ID		_D_NOVELIUS
		AREA		_COUR_CAMELOT
		ENTITE		_NOVELIUS
		CAMERA		3

		PRIMTRIG
		{
			DIST	500
			//ORIENT	"NONE"
			ENTITE	_NOVELIUS
		}

		SECTRIG
		{
			DIST	400
			ORIENT	"FACE"
			ENTITE	_NOVELIUS
		}

		STAND
		{
			ID	1
			TALK	( 43 , 44)(45, 46)
			BASEJEU	9
		}

		FIN
		{
			ID	1
			TALK	(47, 48)
		}

		RETOUR
		{
			ID	1
			TALK	(700,701)
		}
		SUJET
		{
			ID	_II_COURONNE_SAUL
			TALK	( 53, 54, _ID_MAGO, _INV_DESTI)
			BASEJEU	13
		}
		SUJET
		{
			ID	_II_LUTISSE
			TALK	( 49,50)(51, 52)
			BASEJEU	11
		}

	}
	COMMENT
	{
		ID		150
		AREA		_COUR_CAMELOT
		ENTITE		_MENDIANT
		PRIMTRIG
		{
			DIST	600
			//ORIENT	"NONE"
			ENTITE	_MENDIANT
		}
		COMMENT		55
		ACTION		0

	}

	DIALOG
	{
		ID		_D_MENDIANT
		AREA		_COUR_CAMELOT
		ENTITE		_MENDIANT
		CAMERA	11
		PRIMTRIG
		{
			DIST	400
			//ORIENT	"NONE"
			ENTITE	_MENDIANT
		}

		SECTRIG
		{
			DIST	300
			ORIENT	"FACE"
			ENTITE	_MENDIANT
		}



		FIN
		{
			ID	1
			TALK	( 706 , 56)
		}

		RETOUR
		{
			ID	1
			TALK	( 706 , 56)
		}

	}
	DIALOG
	{
		ID		_D_LANCELOT
		AREA		25
		ENTITE		_LANCELOT
		CAMERA 		6

		PRIMTRIG
		{
			DIST	500
			//ORIENT	"NONE"
			ENTITE	_LANCELOT
		}

		SECTRIG
		{
			DIST	400
			ORIENT	"FACE"
			ENTITE	_LANCELOT
		}

		STAND
		{
			ID	1
			TALK	(33, 34)
			BASEJEU	7
			BASEDOC	84
		}

		FIN
		{
			ID	1
			TALK	(35, 36)
		}

		RETOUR
		{
			ID	1
			TALK	(35, 36) // ??
		}
		SUJET
		{
			ID	_II_ARTHUR
			TALK	( 37,38)(39, 40, _IO_ECU, _INV_OBJET)
			BASEJEU	8
			BASEDOC	83
		}
		SUJET
		{
			ID	_II_LUTISSE
			TALK	( 41, 42)
			BASEJEU 10
		}

	}


section END


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

section COMBATS



section END

/////////////////////////////////////////////////////////////////
// Programme
/////////////////////////////////////////////////////////////////
section INIT

// desactivation sorties non permises

////Camelot
// atrebates
				//id, 		boite, lieu, actif, visible, coll decor
	#OBJ_LOAD		(_GARDE_PICTE,		 1, _CAMP_ATREBATES, 1, 1, 1)

	//pas de porte : dummy_face

//sagramor
	#OBJ_LOAD		(_GARDE_ROMAIN, 	1,   _CAMP_SAGRAMOR, 1, 1, 1)
	#OBJ_LOAD		(_LANCELOT, 		3,   _CAMP_SAGRAMOR, 1, 1, 1) // POO5
//camp saxon

	#OBJ_LOAD		(_GARDE_SAXON, 		1,   _CAMP_SAXON, 1, 1, 1)
	//pas de porte : dummy_face

//camp Marcus
	#OBJ_LOAD		(_GARDE_MARCUS, 	1 ,  _CAMP_MARCUS, 1, 1, 1)

//cour camelot
	#OBJ_LOAD		(_ETENDARD, 		2,   _COUR_CAMELOT, 1, 1, 0)
	#OBJ_ENABLECOLLIBOX(_ETENDARD)
	#OBJ_LOAD		(_GARDE_ENTREE, 	1 ,  _COUR_CAMELOT, 1, 1, 1)
	#OBJ_LOAD		(_GARDE_CHATEAU, 	7,   _COUR_CAMELOT, 1, 1, 1)
	#OBJ_LOAD		(_NOVELIUS, 		5,   _COUR_CAMELOT, 1, 1, 1)
	#OBJ_LOAD		(_COURONNE_SAUL, 	13,  _COUR_CAMELOT, 0, 1, 1)
	#OBJ_LOAD		(_MENDIANT, 		8,   _COUR_CAMELOT, 0, 1, 0)
	#OBJ_LOAD		(_DUMMY_CROIX_NEUVE, 		12,   _COUR_CAMELOT, 1, 0, 0)
	#OBJ_LOAD		(_DUMMY_CROIX_VIEILLE, 		13,   _COUR_CAMELOT, 1, 0, 0)
	#OBJ_DISABLECOLLIOBJ	(_DUMMY_CROIX_NEUVE)
	#OBJ_DISABLECOLLIOBJ	(_DUMMY_CROIX_VIEILLE)

	set $croixV , 0
	set $prierV, 0

// verouillage portes

	#DOO_LOCK		(_PORTE_CAMELOT_VERSTABLERONDE_N1, 	 _COUR_CAMELOT)
	#DOO_LOCK		(_PORTE_CAMELOT_ENCEINTE_N1, _COUR_CAMELOT)
	#DOO_LOCK		(_PORTE_SAGRAMOR_N1, 	 _CAMP_SAGRAMOR)

	#COL_ENABLE		(1, _CAMP_MARCUS) //porte marcus
	#COL_ENABLE		(2, _CAMP_MARCUS) // tente marcus
	#COL_ENABLE		(1, _CAMP_SAXON)
	#COL_ENABLE		(1, _CAMP_ATREBATES)

// inventaire

	#INV_PUTPLQ		(_IO_EPEE_BRADWEN, 	_INV_OBJET) //epee
  	#INV_PUTPLQ		(_II_ARTHUR, 		_INV_INDIC)
	#INV_PUTPLQ		(_II_LUTISSE, 		_INV_INDIC)
  	#INV_PUTPLQ		(_IO_BROCHE_LUTISSE, 	_INV_OBJET)

	#OBJ_LOADACCESS		(_EPEE_BRADWEN_PALADIN, 1)

	//#INV_PUTPL		(_ID_MAGO, 		_INV_DESTI) //test
	//#INV_PUTPL		(_II_LANCELOT, 		_INV_INDIC) //test
	//#EVT_ENABLE		(_PRIE_V_1) //test

	#BDC_ENABLE		(175)

	#OBJ_LOAD		(_DUMMY_FORG,	_BOITE_DUMMY_FORG, _COUR_CAMELOT, 1, 0, 0)
	#OBJ_DISABLECOLLIOBJ 	(_DUMMY_FORG)

	#OBJ_LOAD		(_FORGERON, 	 3, 	 _COUR_CAMELOT, 1, 1, 1)
	#OBJ_AATARGET		(_FORGERON,	_DUMMY_FORG)

	#VFX_LOADLINK		(_FX_APPAR_COURONNE_ENT2_LK,	 _COURONNE_SAUL, "courrs", 0)
	#VFX_LOAD		(_FX_APPAR_COURONNE_ENT2,	 _COURONNE_SAUL, 0)
	#VFX_LOADBOX		(_FX_RAYOND, 13, _COUR_CAMELOT, 0)

section END

section LOOP

OnDialog 13 sujet _II_LANCELOT
{
	#DOO_UNLOCK	(_PORTE_SAGRAMOR_N1, _CAMP_SAGRAMOR)
	#DLG_DISABLEFIN	(13, _CAMP_SAGRAMOR, 1)
	#DLG_ENABLEFIN	(13, _CAMP_SAGRAMOR, 2)
	#DLG_DISABLERET	(13, _CAMP_SAGRAMOR, 1)
	#DLG_ENABLERET	(13, _CAMP_SAGRAMOR, 2)
}
OnDialog 16 give _IO_ECU
{
	#DOO_UNLOCK	(_PORTE_CAMELOT_ENCEINTE_N1, _COUR_CAMELOT)
	if @INV_OWNPL(_IO_ECU, _INV_OBJET) = 0
	{
		#INV_PUTPLQ	(_IO_ECU, _INV_OBJET)
	}
	#DLG_DISABLEFIN	(16, _COUR_CAMELOT, 1)
	#DLG_ENABLEFIN	(16, _COUR_CAMELOT, 2)
	#DLG_DISABLERET	(16, _COUR_CAMELOT, 1)
	#DLG_ENABLERET	(16, _COUR_CAMELOT, 2)

}
OnEvent _PRIE_NV_2 perm
{
	#EVT_DISABLE	(_PRIE_NV_2)
	run 		93
	#EVT_ENABLE	(_PRIE_NV_2)
	#OBJ_ENABLE	(_MENDIANT)
}
OnDialog _D_MENDIANT fin 1
{
	//#EVT_DISABLE	(_PRIE_NV_2)
	set $prierV, 1
	if $croixV = 1 & $prierV =1
	{
	    #EVT_ENABLE	(_PRIE_V_1)
	}
}

OnEvent _C_CROIX_EST_VIEILLE
{
	set $croixV, 1
	if $croixV = 1 & $prierV =1
	{
	    #EVT_ENABLE	(_PRIE_V_1)
	}
}


OnDialog _D_NOVELIUS sujet _II_LUTISSE
{
	#EVT_DISABLE	(_PRIE_NV_1)
	#EVT_ENABLE	(_PRIE_NV_2)
}



OnEvent _PRIE_V_1
{
	#EVT_DISABLE(_PRIE_V_1)
	run 94


}

OnDialog _D_LANCELOT stand 1
{
	#DLG_DISABLESUJ(12, _CAMP_SAXON, 	_II_LANCELOT)
	#DLG_DISABLESUJ(13, _CAMP_SAGRAMOR, 	_II_LANCELOT)
	#DLG_DISABLESUJ(14, _CAMP_MARCUS, 	_II_LANCELOT)
	#DLG_DISABLESUJ(16, _COUR_CAMELOT, 	_II_LANCELOT)

}


OnEvent _IN_MAGO
{
	#INV_REMPL(	_ID_MAGO, _INV_DESTI)
	endc
}

OnEvent _PRIE_NV_1 perm
{
	#EVT_DISABLE	(_PRIE_NV_1)
	run 92
	#EVT_ENABLE	(_PRIE_NV_1)
}

OnEvent _P_COURONNE
{
	#INV_PUTPLQ	(_II_COURONNE_SAUL, _INV_INDIC)
}


section END

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

section CTR

CTR
{
	ID	92
	PROG
	{
	SyncState	_BRADWEN "pause"	WIDE
		//anim prier
			#OBJ_SENDEVENT	(_BRADWEN, "aspec 16")
			SyncState	_BRADWEN "pause - degainer 2"
			#OBJ_ENMAIND	(_BRADWEN, _EPEE_BRADWEN_PALADIN)
		#NAR_COMMENT(9)

			SyncState	_BRADWEN "prier chretien - rengainer 2"
			#OBJ_SUPMAIND	(_BRADWEN)
			SyncState	_BRADWEN "rengainer - pause 2"
		SYNCCOMM
	}
}
CTR
{
	ID	93
	PROG
	{
	SyncState	_BRADWEN "pause"	WIDE
		//anim prier
			#OBJ_SENDEVENT	(_BRADWEN, "aspec 16")
			SyncState	_BRADWEN "pause - degainer 2"
			#OBJ_ENMAIND	(_BRADWEN, _EPEE_BRADWEN_PALADIN)
		#NAR_COMMENT(10)

			SyncState	_BRADWEN "prier chretien - rengainer 2"
			#OBJ_SUPMAIND	(_BRADWEN)
			SyncState	_BRADWEN "rengainer - pause 2"
		SYNCCOMM

	}
}
CTR
{
	ID	94
	PROG
	{
	SyncState	_BRADWEN "pause"	WIDE
		//anim prier
			#OBJ_SENDEVENT	(_BRADWEN, "aspec 16")
			SyncState	_BRADWEN "pause - degainer 2"
			#OBJ_ENMAIND	(_BRADWEN, _EPEE_BRADWEN_PALADIN)
		#NAR_COMMENT(10)

			SyncState	_BRADWEN "prier chretien - rengainer 2"
			#OBJ_SUPMAIND	(_BRADWEN)
			SyncState	_BRADWEN "rengainer - pause 2"
		SYNCCOMM
		//
		// fx sur entite _COURONNE_SAUL
		//

		#VFX_START	(_FX_APPAR_COURONNE_ENT2_LK)
		#VFX_START	(_FX_APPAR_COURONNE_ENT2)
		//SyncFx		_FX_APPAR_COURONNE_ENT2 0
		#OBJ_ENABLE	(_COURONNE_SAUL)
		#OBJ_SENDEVENT	(_BRADWEN, "aspec 13")

		//#VFX_START	(_FX_RAYOND)
		//SyncFx		_FX_RAYOND 0

		#NAR_COMMENT(7)

		// message divin, considere comme event 20	// son "miracle"
		SYNCCOMM

	}
}

section END