//*******************************
//*        TALES              ***
//* Quete 2 chapitre 3       ****
//*     Voie Celte          *****
//*      Last modif        ******
//*	23/06/2000        *******
//*******************************
//*******************************


//**Entete fichier**
SCRIPT_CHAPTER


//- -----------------------------------------------  -
//- Déclaration constantes et variables  -
//- ----------------------------------------------   -

section DECLARE

_BRADWEN_FAUX	821
_SANGLIER 180
_CORWYN 1
_DUMMY 572
_FEEAQUA 173
_CHAMPIGNON 47

//

_PIERREFLEUR1 184
_PIERREFLEUR2 185
_PIERREFLEUR3 186
_GWEN 9
_LOUP 195

//
_FEEAIR 66
_PIERREPAP 380
_PIERRENUAGE 237
_PIERRENEIGE 379
_PIERREARC 378


//
_FOULQUE 1216
_PRINCE  425


$test
$flag

section END

// Section des évènements

section EVENTS

SAVE
{
	ID	1000
	AREA	20

	PRIMTRIG
	{
		ORIENT	"NONE"
		TRIGGER	1
	}

	PERSIST		1
}

ACTION
{
	ID	99
	AREA	103
	STATUS	0
}

ACTION
{
	ID	999
	AREA	19
}

ACTION
{
	ID	9999
	AREA	21
}

PICK
	{
		ID		3
		AREA	21
		HEIGHT	"H0"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_PIERREPAP

		}

		STATUS	1
		ENTITE	_PIERREPAP
		ITEM	(119, _INV_OBJET)
		ACTION	1
	}



PICK
{
		ID		4
		AREA	21
		HEIGHT	"H0"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_PIERRENUAGE
		}

		STATUS	1
		ENTITE	_PIERRENUAGE
		ITEM	(120, _INV_OBJET)
		ACTION	1
}

PICK
{
		ID		5
		AREA	21
		HEIGHT	"H0"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_PIERRENEIGE

		}

		STATUS	1
		ENTITE	_PIERRENEIGE
		ITEM	(122, _INV_OBJET)
		ACTION	1
}

PICK
{
		ID		6
		AREA	21
		HEIGHT	"H0"

		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	_PIERREARC

		}

		STATUS	1
		ENTITE	_PIERREARC
		ITEM	(121, _INV_OBJET)
		ACTION	1
}


// Evènements de types explore
EXPLORE
	{
		ID		11
		AREA	19
		HEIGHT	"H0"

		PRIMTRIG
		{
			DIST	400
			ORIENT	"TO"
			ENTITE	_DUMMY
		}
		FX	_FX_CYCLIF_POLLEN
		FXFRAME	"mainD"
		ENTITE _DUMMY
		ITEM (53,_INV_OBJET)
		ACTION	1
		//COMMENT	50
		PERSIST	1
		DELAY	10
		STATUS 1
	}


EXPLORE
	{
		ID		12
		AREA	20

		PRIMTRIG
		{
			DIST	400
			ORIENT	"TO"
			ENTITE	_LOUP
		}

		ACTION	1
		COMMENT	1
		PERSIST	1
		DELAY	10
		STATUS 1
	}


EXPLORE
	{
		ID		15
		AREA	20

		PRIMTRIG
		{
			DIST	300
			ORIENT	"TO"
			ENTITE	_LOUP
		}

		ITEM (44,_INV_INDIC)
		ACTION	1
		COMMENT	2
		PERSIST	1
		DELAY	10
		STATUS 0

	}

// Evenements fights
FIGHT
{
	ID 1
	AREA	20
	LIST		(0,569,1)
}
// Evenements use

//Use multiple sur le loup
USEM
	{
		ID		7
		AREA	20
		PRIMTRIG
		{
			DIST	200
			ORIENT	"TO"
			ENTITE	195
		}

	USE
		{
		ID 1
		ANIM	"use cup" "brandir pierre - pause"
		//		ENTITE	380
		ITEM	(119, _INV_OBJET)
		COMMENT	3
		STATUS	1
		}

	USE
	{
		ID		2
		ANIM	"use cup" "brandir pierre - pause"
		//ENTITE	237
		ITEM	(120, _INV_OBJET)
		COMMENT	3
		STATUS	1
	}

	USE
	{
		ID		3
		ANIM	"use cup" "brandir pierre - pause"
		//ENTITE	379
		ITEM	(122, _INV_OBJET)
		COMMENT	3
		STATUS	1
	}

	USE
	{
		ID		4
		ANIM	"use cup" "brandir pierre - pause"
		//ENTITE	378
		ITEM	(121, _INV_OBJET)
		COMMENT	3
		STATUS	1
	}
}

// Evenements de types dialogues
//fee air
DIALOG
	{
		ID		1
		AREA	21
		ENTITE	_FEEAIR
		STATUS	1

		PRIMTRIG
		{
			DIST	300
			ORIENT	"NONE"
			ENTITE	_FEEAIR
		}

		SECTRIG
		{
			DIST	400
			ORIENT	"FACE"
			ENTITE	_FEEAIR
		}

		STAND
		{
			ID		1
			TALK	(14,15)
			BASEJEU	21
		}
		FIN
		{
			ID		1
			TALK	(16,17)
		}
		RETOUR
		{
			ID		1
			TALK	(16,17)
		}
		SUJET
		{
			ID 44
			TALK (18,19)
			BASEJEU	22
		}
}


DIALOG
	{
		ID		2
		AREA	19
		ENTITE	_FEEAQUA
		STATUS	1

		PRIMTRIG
		{
			DIST	300
			ORIENT	"NONE"
			ENTITE	_FEEAQUA
		}

		SECTRIG
		{
			DIST	400
			ORIENT	"FACE"
			ENTITE	_FEEAQUA
		}

		STAND
		{
			ID		1
			TALK	(4,5) (6,7) (8,9)
		}
		FIN
		{
			ID		1
			TALK	(10,11)
		}
		RETOUR
		{
			ID		1
			TALK	(10,11)
		}
		SUJET
		{
			ID 44
			TALK (12,13)
			BASEJEU	23
		}
}



section END
// Section FIGHT

section COMBATS

	FIGHT
	{
		ID		1
		AREA	20
		CAMERA	12
		TARGET	470
//		WIN		0

		OPPONENT
		{
			ENTITE	1
			BOX	2
			ANIM	"combat 32" "combat 32"
			LWEAPON	569
			DEAD	1
		}

		OPPONENT
		{
			ENTITE _LOUP
			BOX		4
			ANIM	"combat 25" "combat 25"
			//LWEAPON	675
			SOUND	"cb25_Cor" 100
		}
	}
section END


// Gestion des évènements
section LOOP

OnEvent		9999
{
	#VFX_START	(_FX_CYCLIPF_FEE_AIR_3)
}


OnEvent		3
{
	#NAR_COMMENT	(25)
	#COL_DISABLE	(15, 21)
}

OnEvent		4
{
	#NAR_COMMENT	(21)
	#COL_DISABLE	(13, 21)
}

OnEvent		5
{
	#NAR_COMMENT	(22)
	#COL_DISABLE	(5, 21)
}

OnEvent		6
{
	#NAR_COMMENT	(23)
	#COL_DISABLE	(7, 21)
}

OnEvent	99
{
	ENDC
}

// Le joueur Donne une pierre au loup
OnEvent 7
{
	if @EVT_SUBSEL(7)=1
	{
		run 14
		#BDC_ENABLE	(67)
		#BDC_ENABLE	(69)
		#EVT_ENABLE	(99)
		set $pub3,1
		#OBJ_HIDE	(1999)
//		set		$pub0, 1998
		set		$pub0, _BRADWEN_FAUX		// faux bradwen pour retour landscape
		set		$pub1, _CORWYN_LAND			// à priori pas nécessaire
		#INT_GOLAND	(103, 3)
		#CAM_TRACK (_BRADWEN_FAUX)
		#CAM_RETARGET(0)

//		endc

	}



	if @EVT_SUBSEL(7)>1
	{
	fight 1,1
	}
}


Onfight 1
{
over 4
}

OnDialog 2 stand 1
{
	#EVT_DISABLE(12)
	#EVT_ENABLE(15)
}

Ondialog 1 sujet 44
{
	#OBJ_ENABLE(380)
	#COL_ENABLE(15, 21)
	#OBJ_ENABLE(237)
	#COL_ENABLE(13, 21)
	#OBJ_ENABLE(378)
	#COL_ENABLE(5, 21)
	#OBJ_ENABLE(379)
	#COL_ENABLE(7, 21)
	#VFX_START (_FX_CYCLIF_PIERRE_R_1)
	#VFX_START (_FX_CYCLIF_PIERRE_R_2)
	#VFX_START (_FX_CYCLIF_PIERRE_R_3)
	#VFX_START (_FX_CYCLIF_PIERRE_R_4)
}

OnEvent		999
{
	RUN	111
}

section END


//-----------------------
//--- Section Init --
//-----------------------

section INIT

//mem:obj_load entite,boite,lieu,actif,visible,collisions décors
#OBJ_LOAD(_SANGLIER,8,19,1,1,1)
#OBJ_LOAD(_DUMMY,58,19,1,0,0)
#OBJ_DISABLECOLLIOBJ(_DUMMY)
#OBJ_LOAD(_FEEAQUA,11,19,1,1,0)

#OBJ_DISABLE(_BRADWEN)
#OBJ_LOAD (_CHAMPIGNON, 10,19,1,1,0)

//zone 20
#OBJ_LOAD(_PIERREFLEUR1,8,20,1,1,0)
#OBJ_LOAD(_PIERREFLEUR2,9,20,1,1,0)
#OBJ_LOAD(_PIERREFLEUR3,10,20,1,1,0)
#OBJ_LOAD(_GWEN,4,20,0,1,1)
#OBJ_LOAD(_LOUP,2,20,1,1,1)
// #OBJ_LOAD(821,2,20,0,1,1)
#OBJ_LOAD(84,4,20,0,1,0)
#OBJ_LOAD(599,22,20,1,0,0)
#OBJ_DISABLECOLLIOBJ (599)

//zone 21
#OBJ_LOAD(_FEEAIR,3,21,1,1,1)
#OBJ_LOAD(_PIERREPAP,6,21,0,1,0)
#OBJ_LOAD(_PIERRENUAGE,8,21,0,1,0)
#OBJ_LOAD(_PIERRENEIGE,16,21,0,1,0)
#OBJ_LOAD(_PIERREARC,14,21,0,1,0)

// Zi tour de Foulque
#OBJ_LOAD(_FOULQUE,2,0,1,1,0)
#OBJ_LOAD(_PRINCE,7,0,1,1,0)

// Dummy combat (target)
#OBJ_LOAD(470,22,20,1,0,0)
#OBJ_DISABLECOLLIOBJ(470)


//	#OBJ_LOAD (1999,    1, 19, 1, 1, 1)
	#OBJ_LOAD (1999,    222, 19, 0, 1, 1)

	// Inventaire Corwyn
	#INV_ADD (1999, _INV_OBJET)
	#INV_ADD (1999, _INV_INDIC)
	#INV_ADD (1999, _INV_DESTI)

	// On prends le contrôle de corwyn
	#INT_CONTROL (1999)
	#CAM_TRACK   (1999)


set $pub3,2
#INV_PUTPLQ(0, _INV_OBJET)

	// ---------------------------------------------------------------
	// Objets Coll interactifs
	// ---------------------------------------------------------------

	#COL_ENABLE		(110, 103)

	#COL_ENABLE		(24, 21)

	// ---------------------------------------------------------------
	// FXs
	// ---------------------------------------------------------------

	#VFX_LOAD		(_FX_METAMF1_CHAMPIGNON, _CHAMPIGNON, 0)
	#VFX_LOADLINK		(_FX_METAMF2_CHAMPIGNON, _CHAMPIGNON, "CHAMPI", 0)
	#VFX_LOAD		(_FX_METAMF3_CORWYN, 1999, 0)

	#VFX_LOADLINK		(_FX_CYCLIF_PIERRE_R_1, _PIERREPAP, "Box01", 0)
	#VFX_LOADLINK		(_FX_CYCLIF_PIERRE_R_2, _PIERRENUAGE, "Hedra01", 0)
	#VFX_LOADLINK		(_FX_CYCLIF_PIERRE_R_3, _PIERRENEIGE, "Hedra01", 0)
	#VFX_LOADLINK		(_FX_CYCLIF_PIERRE_R_4, _PIERREARC, "GeoSphere01", 0)

	#VFX_LOADLINK		(_FX_CYCLIF_PAP_GWEN, 84, "Pap-corps", 0)
	#VFX_LOADLINK		(_FX_APPARF1_PAP_GWEN, 84, "Pap-corps", 0)
	#VFX_LOAD		(_FX_APPARF2_PAP_GWEN, 84, 0)

//	#VFX_LOAD		(_FX_METAMF1_PAP, 84, 0)
	#VFX_LOADLINK		(_FX_METAMF2_PAP, 84, "Pap-corps", 0)
	#VFX_LOAD		(_FX_METAMF3_GWEN, _GWEN, 0)

	#VFX_LOADLINK		(_FX_DISPARF1_GWEN, _GWEN, "bassin", 0)
//	#VFX_LOAD		(_FX_DISPARF2_GWEN, _GWEN, 0)

	#VFX_LOAD		(_FX_METAMF1_LOUP, _LOUP, 0)
        #VFX_LOADLINK		(_FX_METAMF2_LOUP, _LOUP, "bassin", 0)
	#VFX_LOAD		(_FX_METAMF3_BW, 821, 0)

	#VFX_LOADLINK		(_FX_CYCLIPF_FEE_AIR_3, _FEEAIR, "bassin", 0)
	#VFX_LOADLINK		(_FX_CYCLIPF_FEE_AQUA_3, _FEEAQUA, "bassin", 0)

	#VFX_LOADBOX		(_FX_FEUMOF_1, 5, 103, 0)
	#VFX_LOADBOX		(_FX_FEUMOF_2, 18, 21, 0)

	#VFX_START		(_FX_FEUMOF_1)
	#VFX_START		(_FX_FEUMOF_2)

	#VFX_START		(_FX_CYCLIPF_FEE_AQUA_3)

section END



section CTR

CTR
{
	ID 14
	prog
		{
			#CAM_ENABLE	(7)
			#CAM_FORCE	(7, 0)
			#CAM_TRACK	(599)
			#OBJ_MOVETOBOX	(1999, 12)
			#OBJ_ENABLE	(84)
			#VFX_START	(_FX_APPARF1_PAP_GWEN)
			#VFX_START	(_FX_APPARF2_PAP_GWEN)
			SyncFx		_FX_APPARF1_PAP_GWEN 0
			#VFX_START	(_FX_CYCLIF_PAP_GWEN)
			#OBJ_SENDEVENT	(84, "aspec 1")
			SyncState	84 "pause 2"
			#VFX_UNLOAD	(_FX_APPARF2_PAP_GWEN)
			#VFX_LOAD	(_FX_METAMF1_PAP, 84, 0)
			Synctime 	3
			#VFX_START	(_FX_METAMF1_PAP)
			#VFX_START	(_FX_METAMF2_PAP)
			SyncFx		_FX_METAMF1_PAP 0
			#VFX_STOP	(_FX_CYCLIF_PAP_GWEN)
			#OBJ_DISABLE	(84)
			#OBJ_ENABLE	(_GWEN)
			#VFX_START	(_FX_METAMF3_GWEN)
			SyncFx		_FX_METAMF3_GWEN 0
			#OBJ_SENDEVENT	(_GWEN,"break")
			SyncState	_GWEN	"pause"
			#OBJ_SENDEVENT	(_GWEN,"dlg nor")
			#NAR_COMMENT	(20)
			#VFX_UNLOAD	(_FX_METAMF3_GWEN)
			#VFX_LOAD	(_FX_DISPARF2_GWEN, _GWEN, 0)
			Synccomm
			#VFX_START	(_FX_DISPARF1_GWEN)
			#VFX_START	(_FX_DISPARF2_GWEN)
			SyncFx		_FX_DISPARF1_GWEN 0
			#OBJ_DISABLE	(_GWEN)
			#VFX_START	(_FX_METAMF1_LOUP)
			#VFX_START	(_FX_METAMF2_LOUP)
			SyncFx		_FX_METAMF1_LOUP 0
			#OBJ_DISABLE	(_LOUP)
			#OBJ_ENABLE	(_BRADWEN_FAUX)
			#OBJ_LOCK	(_BRADWEN_FAUX)		// sera unlocké en fin de ctr parce que devenu joueur à la place de Corwyn
			#VFX_START	(_FX_METAMF3_BW)
			SyncFx		_FX_METAMF3_BW 0
			Synctime 	1
			#CAM_UNLOCK	()
			#CAM_TRACK	(821)
//			#INV_ADD	(_BRADWEN_FAUX, 0)	// -> dans entête de quête (c'est mieux pour les restores !)
//			#INV_ADD	(_BRADWEN_FAUX, 1)
//			#INV_ADD	(_BRADWEN_FAUX, 2)
			#INT_CONTROL	(_BRADWEN_FAUX)
			#OBJ_UNLOCK	(1999)				// vire le lock posé en début de ctr (pas unlocké en fin de ctr parce que plus joueur !)
			#CAM_RETARGET	(1)
			#OBJ_GOTOIBOX	(821,2,0)
			#INV_PUTPLQ	(0, _INV_OBJET)
			Syncgoto 821
			#BJE_CTR	(24, 14)

		}
}

CTR
{
	ID	111

	PROG
	{
		#VFX_START	(_FX_METAMF1_CHAMPIGNON)
		#VFX_START	(_FX_METAMF2_CHAMPIGNON)
		SyncFx		_FX_METAMF1_CHAMPIGNON 0
		#OBJ_DISABLE	(_CHAMPIGNON)
		#OBJ_ENABLE	(1999)
		#VFX_START	(_FX_METAMF3_CORWYN)
		SyncFx		_FX_METAMF3_CORWYN 0
	}
}

CTR
{
ID 16
prog
{
// Epilogue de Foulque
}
}

section END