//#include "Cutscene32_dlg.h"
#include "cutscene_common.cs"
 
// global variables
int ce01, ce04, ce11, player;
 
void main()
{
 
	LoadScene("se01");
 
	//fade in
	Fade(0, 0, 0, 1, 0, 0, 0, 0, 1, 1);
 
	//show movie border
 
	ShowMovieBorder("movie", 120);
 
	// spawn chara and set initial position
 
	ce01= SpawnMale(14, 131.6, 2.5);
	SetCharaWeapon(ce01, 30);
 
	ce04= SpawnFemale(-12.7, 114.4, 2.5);
	SetCharaWeapon(ce04, 20);
 
	ce11= SpawnChara("CE11", 1.5, 238, 2.5);//�ਭ�첾1.5, 248, 2.5
	SetCharaWeapon(ce11, 0);
 
 
	// Set chara initial direction
	SetEntityDir(ce01, 0, 1, 0);
	SetEntityDir(ce04, 0, 1, 0);
	SetEntityDir(ce11, 0, -1, 0);
 
	// get player and hide acZaras
 
	player = GetPlayerChara();
	ShowEntity(ce01, 1);
	ShowEntity(ce04, 1);
	ShowEntity(ce11, 1);
 
	// delete acZaras and resZarae player after end cutscene
	ActorList(ce01);
	ActorList(ce04);
	ActorList(ce11);
 
	SetCharaStyle(ce11, 1);
	UnLook(ce11);
	
	//two walk to Qi 
	LookChara(ce01, ce11);
	LookChara(ce04, ce11);
	
	SetCharaStyle(ce01, 1);
	SetCharaStyle(ce04, 1);
	CharaWalkTo(ce01, 13, 200.3, 2.5);//13, 196.3, 2.5//0.2,1,0
	Sleep(0.5);
	CharaWalkTo(ce04, -7.7, 200.4, 2.5);//-7.7, 196.4, 2.5//0.5,0.8,0
		
	WaitCamUntil();
	//Set Cam initial
	SetCamPos(32.86, 263.6, 41.3);
	SetCamDir(240.4, 347.5, 0);
 	
 	
	WaitCharaUntil(ce01);
	SetCharaStyle(ce01, 0);
 	PlayPose(ce01, 0156, 1);
 	
 	WaitCharaUntil(ce04); 
 	SetCharaStyle(ce04, 0);
	PlayPose(ce04, 0158, 1.2);
	
	Sleep(2);
	//------------------------//
	//SetCamPos(10.2, 207.8, 39.8);
	//SetCamDir(120.3, 358.5, 0);
	//CharaFaceTo(ce11, 0, -1, 0);
	
	//PlayPose(ce11, 1097, 1.5);
	//WaitCharaUntil(ce11);	
	//Sleep(1);
	
	
	//----------------------------
	//SetCamPos(35.35, 184.5, 28.5);
	//SetCamDir(149.6, 4.7, 0);
	SetCamPos(36.8, 187, 32.6);
	SetCamDir(142.3, 357.3, 0);
	Sleep(0.5);
	
	//Q1a One final thing, my students
	BeginFadeImg("cs_ce11", 30, 30, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_Q1a, 210, 60, 1.5);
			PlayVoice("32_qi_032_1");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_Q1a, 0.5);
	EndFadeImg("cs_ce11", 0.5);
	Sleep(0.5);
 
	LookChara(ce11, ce04);
	Sleep(0.5);
	
	SetCharaStyle(ce11, 0);
	//CharaMoveTo(ce11, -6.3, 213.4, 2.6, 0.2);//-6.3, 217.4, 2.6//-0.1,-0.9,0
	CharaWalkTo(ce11, -6.3, 213.4, 2.6);
	WaitCharaUntil(ce11);
	SetCharaStyle(ce11, 1);
	Sleep(1);
	
	
	
	//Q1b Take this.
	BeginFadeImg("cs_ce11", 30, 30, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_Q1b, 210, 60, 1.5);
			PlayVoice("32_qi_032_2");
	
			Sleep(0.3);
			PlayPose(ce11, 1099, 2.2);
	
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_Q1b, 0.5);
	EndFadeImg("cs_ce11", 0.5);
	Sleep(0.5);
	
	//-------------//
	//SetCamPos(2.2, 198.4, 27);
	//SetCamDir(205.3, 19.8, 0);
	PlayPose(ce04, 1100, 2.5);
	Sleep(1);
			
	//M2 A map?
	BeginFadeImg(PhotoFemale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_M2, 210, 510, 1.5);
			PlayVoice("32_mia_033");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_M2, 0.5);
	EndFadeImg(PhotoFemale, 0.5);
	WaitCharaUntil(ce04);
	Sleep(1);
 
	//--------------------//
	SetCamPos(14.2, 176.7, 18.9);
	SetCamDir(120.1, 14.9, 0);
	Sleep(0.5);
	
	//Q3a These past years I have been deep in study and
	//Q3b meditation.
	BeginFadeImg("cs_ce11", 30, 30, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_Q3a, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q3b, 210, 70, 1.5);
			PlayVoice("32_qi_034");
			Sleep(4); 
		EndText(CUTSCENE32_Q3a, 0.5);
		EndText(CUTSCENE32_Q3b, 0.5);
	
	Sleep(0.5);
 	
	
	//Q3c I have searched for information on warriors 
	//Q3d who are skilled enough to wield the Phoenix 
	//Q3e weapons.
	
		BeginText(CUTSCENE32_Q3c, 210, 40, 1.5);
		BeginText(CUTSCENE32_Q3d, 210, 60, 1.5);
		BeginText(CUTSCENE32_Q3e, 210, 80, 1.5);
			
			Sleep(5.5); 
		EndText(CUTSCENE32_Q3c, 0.5);
		EndText(CUTSCENE32_Q3d, 0.5);
		EndText(CUTSCENE32_Q3e, 0.5);
	
	Sleep(0.5);
 
	
	//-------------------------
	SetCamPos(5.9, 200.9, 18.9);
	SetCamDir(125.7, 39.4, 0);
	Sleep(0.5);
	//Q3f I have marked the locations of where these
	//Q3g warriors may be found.
	
		BeginText(CUTSCENE32_Q3f, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q3g, 210, 70, 1.5);
			
			Sleep(4); 
		EndText(CUTSCENE32_Q3f, 0.5);
		EndText(CUTSCENE32_Q3g, 0.5);
	
	Sleep(0.5);
 
	//Q3h I hope you find them in possession of the 
	//Q3i weapons.

		BeginText(CUTSCENE32_Q3h, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q3i, 210, 70, 1.5);
			
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_Q3h, 0.5);
		EndText(CUTSCENE32_Q3i, 0.5);
	EndFadeImg("cs_ce11", 0.5);
	Sleep(0.5);
 
	
	//-------------------//
	SetCamPos(0.4, 206.3, 27.9);
	SetCamDir(225.6, 19, 0);
	CharaFaceTo(ce11, 0.12, -0.9, 0);
	Sleep(0.5);
	
	
	//M4 We will follow the map faithfully.
	BeginFadeImg(PhotoFemale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_M4, 210, 510, 1.5);
			PlayVoice("32_mia_035");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_M4, 0.5);
	EndFadeImg(PhotoFemale, 0.5);
	Sleep(0.5);
 
	//--------------------//
	SetCamPos(9.13, 205.6, 30);
	SetCamDir(142.5, 18.7, 0);
	
	CharaFaceTo(ce01, -0.3, 0.9, 0);
	CharaFaceTo(ce04, 0.5, 0.8, 0);
	
	Sleep(0.5);
	
	//Q5a Remember to return here immediately after
	//Q5b collecting the remaining weapons.
	BeginFadeImg("cs_ce11", 30, 30, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_Q5a, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q5b, 210, 70, 1.5);
			PlayVoice("32_qi_036");
			Sleep(4.5); 
		EndText(CUTSCENE32_Q5a, 0.5);
		EndText(CUTSCENE32_Q5b, 0.5);
	
	Sleep(0.5);
 
	//Q5c I fear that if the others searching for the
	//Q5d weapons discover your quest, they will hunt

		BeginText(CUTSCENE32_Q5c, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q5d, 210, 70, 1.5);
			
			Sleep(5);
		EndText(CUTSCENE32_Q5c, 0.5);
		EndText(CUTSCENE32_Q5d, 0.5);
	
	Sleep(0.5);
 
	//Q5e you down for them.

		BeginText(CUTSCENE32_Q5e, 210, 60, 1.5);
			
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_Q5e, 0.5);
	EndFadeImg("cs_ce11", 0.5);
	Sleep(0.5);
 
	
	//----------------------//
	//SetCamPos(12.14, 228.5, 52.6);
	//SetCamDir(246.6, 321.9, 0);
	SetCamPos(11, 230.2, 32.8);
	SetCamDir(251.8, 4.4, 0);
	
	//K6 Don't worry, I'm always ready for a fight.
	BeginFadeImg(PhotoMale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_K6, 210, 510, 1.5);
			PlayVoice("32_kai_037");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_K6, 0.5);
	EndFadeImg(PhotoMale, 0.5);
	
	LookChara(ce04, ce01);
	Sleep(0.5);
 	//M7 We know.
	BeginFadeImg(PhotoFemale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_M7, 210, 510, 1.5);
			PlayVoice("32_mia_038");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_M7, 0.5);
	EndFadeImg(PhotoFemale, 0.5);
	Sleep(0.5);
 
	LookChara(ce04, ce11);
	//-----------------//
	SetCamPos(20.2, 174.7, 41.3);
	SetCamDir(120.9, 342.4, 0);
	
	//MoveCamLineTo(37.8, 164.8, 67.5, 12, 0);
	LookChara(ce11, ce04);
		
	//Q8 You two are to me as my own children.
	BeginFadeImg("cs_ce11", 30, 30, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_Q8, 210, 60, 1.5);
			PlayVoice("32_qi_039");
			
			//------------
			Sleep(1);
			LookChara(ce11, ce01);
			//--------------
			
			Sleep(3.5); 
		EndText(CUTSCENE32_Q8, 0.5);

	Sleep(0.5);
 
	//Q9a Stay together and aid each other if you
	//Q9b want to succeed.

		BeginText(CUTSCENE32_Q9a, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q9b, 210, 70, 1.5);
			LookChara(ce11, ce04);
			Sleep(4);
		EndText(CUTSCENE32_Q9a, 0.5);
		EndText(CUTSCENE32_Q9b, 0.5);

	Sleep(0.5);
 
	//Q10a And remember, the Phoenix Weapons twist men's
	//Q10b minds.

		BeginText(CUTSCENE32_Q10a, 210, 50, 1.5);
		BeginText(CUTSCENE32_Q10b, 210, 70, 1.5);
			
			
			Sleep(4.5); 
		EndText(CUTSCENE32_Q10a, 0.5);
		EndText(CUTSCENE32_Q10b, 0.5);

	Sleep(0.5);
 
	//Q10c Do not trust anyone you meet along the way.
	
		BeginText(CUTSCENE32_Q10c, 210, 60, 1.5);
			
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_Q10c, 0.5);
	EndFadeImg("cs_ce11", 0.5);
	WaitCamUntil();
	//Sleep(0.5);
 
	
	//-------------------//
	//SetCamPos(63.6, 216, 117);
	//SetCamDir(206.6, 303.7, 0);
	UnLook(ce11);
	//CharaFaceTo(ce01, -0.2, 0.9, 0);
	//CharaFaceTo(ce04, 0.3, 0.9, 0);
	SetCamPos(22.3, 246.6, 31.4);
	SetCamDir(246.9, 356.2, 0);
	
	//K11 Don't worry, Master-I'll keep my eyes open.
	BeginFadeImg(PhotoMale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_K11, 210, 510, 1.5);
			PlayVoice("32_kai_040a");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_K11, 0.5);
	EndFadeImg(PhotoMale, 0.5);
	Sleep(0.5);
 	
 	
	//M12 We will not fail you, Master.
	BeginFadeImg(PhotoFemale, 30, 485, 180, 90, 1, 1, 0.5);
		BeginText(CUTSCENE32_M12, 210, 510, 1.5);
			PlayVoice("32_mia_041");
			WaitVoiceUntil(); 
		EndText(CUTSCENE32_M12, 0.5);
	EndFadeImg(PhotoFemale, 0.5);
	Sleep(0.5);
 
	
	
	//---------------------------
	PlayPose(ce04, 0158, -1);
	Sleep(0.5);
	PlayPose(ce01, 0156, -1);
	WaitCharaUntil(ce01);
	Sleep(1.2);
	
	PlayPose(ce04, 1708, 0.8);
	Sleep(0.3);
	PlayPose(ce01, 1097, 0.8);
	
	WaitCharaUntil(ce04);	
	SetCharaStyle(ce04, 1);
	UnLook(ce04);
	CharaWalkTo(ce04, -19.7, -75.6, 2.5);
	
	WaitCharaUntil(ce01);
	SetCharaStyle(ce01, 1);
	UnLook(ce01);
	CharaWalkTo(ce01, 13.8, -72.6, 2.5);
	
	//two walk away
		
	
	
	Sleep(1.5);
		
	
	Fade(0, 0, 0, 0, 0, 0, 0, 1, 2, 1);
	Sleep(2);
 
	//fade out
 

 
	//end
 
	TheEnd();
 
}