////////////////////////////
// Run when the map starts
void OnStart()
{
AddEntityCollideCallback("Player", "event", "lol", true, 1);
PlayMusic("02_amb_safe.ogg", true, 1.0f, 0.0f, 1, true);
}


void lol(string &in asParent, string &in asChild, int alState)
{
		 
		SetMessage("sleep", "sleeper", 6.0f);
		SetPlayerActive(false);
		SetPlayerCrouching(true);
		AddTimer("", 5.0f, "gucken");
		AddTimer("", 2.0f, "fenster");
		
}
void fenster(string &in asTimer)	
{
StartPlayerLookAt("human_bone_1", 2.0f, 1.0f, "");
}


void gucken(string &in asTimer)	
{
		StartPlayerLookAt("bonfire_1", 2.0f, 1.0f, "");
		AddTimer("", 5.0f, "schlafen");
}
	
void schlafen(string &in asTimer)	
	
{			
		FadeOut(3.0f);
		FadePlayerRollTo(90, 150, 20);	
		StopPlayerLookAt();
		AddTimer("", 4.0f, "port");
}

void port(string &in asTimer)	
{
ChangeMap("map.map", "PlayerStartArea_1", "", "");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
