////////////////////////////
// Run when entering map
void OnStart()
{
	AddEntityCollideCallback("Player", "FlashBackArea_1", "FlashBack_1", true, 1);
	AddEntityCollideCallback("Player", "FlashBackArea_2", "FlashBack_A", true, 1);
	AddEntityCollideCallback("Player", "ScriptArea_1", "Transit", true, 1);

}

void Transit(string &in asParent, string &in asChild, int alState)
{
	ChangeMap("tomb.map", "PlayerStartArea_1", "29_hole_open.snt", "");
}

void FlashBack_1(string &in asParent, string &in asChild, int alState)
{StartEffectFlash(1, 1.0, 1); PlaySoundAtEntity("", "flashback_flash.snt", "Player", 0.1f, false); FadeImageTrailTo(1, 0.1f); FadeSepiaColorTo(5, 0.1f); SetPlayerMoveSpeedMul(0.1); AddTimer("", 2, "FlashBack_2"); SetEntityInteractionDisabled("", true);}
void FlashBack_2(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_01", 2); AddTimer("", 2, "FlashBack_3"); SetEntityActive("alexander_1", true); SetNPCFollowPlayer("alexander_1", true);}
void FlashBack_3(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_02", 2.5); AddTimer("", 2.5, "FlashBack_4");}
void FlashBack_4(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_03", 4); AddTimer("", 4, "FlashBack_5");}
void FlashBack_5(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_04", 4); AddTimer("", 4, "FlashBack_6");}
void FlashBack_6(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_05", 5); AddTimer("", 5, "FlashBack_7");}
void FlashBack_7(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_06", 2.5); AddTimer("", 2.5, "FlashBack_8");}
void FlashBack_8(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_07", 3); AddTimer("", 3, "FlashBack_9");}
void FlashBack_9(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_08", 4); AddTimer("", 4, "FlashBack_10");}
void FlashBack_10(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_09", 3); AddTimer("", 3, "FlashBack_11");}
void FlashBack_11(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_10", 3); AddTimer("", 3, "FlashBack_12");}
void FlashBack_12(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_11", 5); AddTimer("", 5, "FlashBack_13");}
void FlashBack_13(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_12", 2.5); AddTimer("", 2.5, "FlashBack_14");}
void FlashBack_14(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_13", 4); AddTimer("", 4, "FlashBack_15");}
void FlashBack_15(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_14", 4); AddTimer("", 4, "FlashBack_16");}
void FlashBack_16(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_15", 2.5); AddTimer("", 2.5, "FlashBack_17");}
void FlashBack_17(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_16", 3); AddTimer("", 3, "FlashBack_EndA");}
void FlashBack_EndA(string &in asTimer)
{StartEffectFlash(1, 1.0, 1); PlaySoundAtEntity("", "flashback_flash.snt", "Player", 0.1f, false); FadeImageTrailTo(0, 1.0f); FadeSepiaColorTo(0, 1.0f); SetPlayerMoveSpeedMul(1); SetEntityInteractionDisabled("", false); SetEntityActive("alexander_1", false); SetEntityActive("block_box_5", false);}

void FlashBack_A(string &in asParent, string &in asChild, int alState)
{StartEffectFlash(1, 1.0, 1); PlaySoundAtEntity("", "flashback_flash.snt", "Player", 0.1f, false); FadeImageTrailTo(1, 0.1f); FadeSepiaColorTo(5, 0.1f); SetPlayerMoveSpeedMul(0.1); AddTimer("", 2, "FlashBack_B"); SetEntityInteractionDisabled("", true);}
void FlashBack_B(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_A", 2); AddTimer("", 2, "FlashBack_C"); SetEntityActive("alexander_1", true); SetNPCFollowPlayer("alexander_1", true); TeleportPlayer("PlayerStartArea_2"); SetPlayerActive(false); StartPlayerLookAt("ScriptArea_2", 1, 1, ""); }
void FlashBack_C(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_B", 3); AddTimer("", 3, "FlashBack_D");}
void FlashBack_D(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_C", 4); AddTimer("", 4, "FlashBack_E"); SetEntityActive("Poison", true); SetEntityActive("Amnesiac", true); SetEntityActive("Vitae", true);}
void FlashBack_E(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_D", 6); AddTimer("", 6, "FlashBack_F"); StartPlayerLookAt("Amnesiac", 1, 1, "");}
void FlashBack_F(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_E", 3); AddTimer("", 3, "FlashBack_G");}
void FlashBack_G(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_F", 4); AddTimer("", 4, "FlashBack_H");}
void FlashBack_H(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_G", 4); AddTimer("", 4, "FlashBack_I");}
void FlashBack_I(string &in asTimer)
{SetMessage("Flashbacks", "FlashbackChapel_H", 3); AddTimer("", 3, "FlashBack_EndB");}
void FlashBack_EndB(string &in asTimer)
{AddTimer("", 0.5, "Squadalaa"); StartEffectFlash(1, 1.0, 1); PlaySoundAtEntity("", "flashback_flash.snt", "Player", 0.1f, false); FadeImageTrailTo(0, 1.0f); FadeSepiaColorTo(0, 1.0f); SetPlayerMoveSpeedMul(1); SetEntityInteractionDisabled("", false); SetEntityActive("alexander_1", false); SetEntityActive("block_box_5", false); SetPlayerActive(true); StopPlayerLookAt(); AutoSave();}

void Squadalaa(string &in asTimer)
{
SetEntityActive("block_box_1", true);
SetEntityActive("ScriptArea_1", true);
CreateParticleSystemAtEntity("", "ps_orb_room_portal_open.ps", "ScriptArea_1", true);
}

void OnEnter()
{
	PlayMusic("Mask of the Priest and the Bell of the Chapel.ogg", true, 0.75, 3, 1, false);

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
	StopMusic(3, 1);

}