////////////////////////////
// Run when starting game
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);
for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
}
SetSanityDrainDisabled(true);
SetPlayerCrouching(true);
SetPlayerActive(false);
FadeOut(0);
AddTimer("StartGame", 6.0f, "IntroSequence");
}
void IntroSequence(string &in asTimer)
{
AddLocalVarInt("iIntroPart", 1);
float partSpeed = 0.5f;
switch(GetLocalVarInt("iIntroPart")) {
case 1:
PlayGuiSound("", 1.0f);
FadeIn(6.0f);
StartPlayerLookAt("AreaIntroLook_2", 1.0f, 1.0f, "");
FadePlayerRollTo(-45, 0.8, 8);
partSpeed = 1.0f;
break;
case 2:
StartPlayerLookAt("AreaIntroLook_4", 1.0f, 1.0f, "");
partSpeed = 1.0f;
break;
case 3:
StartPlayerLookAt("AreaIntroLook_3", 1.0f, 1.0f, "");
PlayGuiSound("", 0.7f);
FadeOut(3.0f);
partSpeed = 1.0f;
break;
case 4:
FadeIn(6.0f);
SetPlayerLookSpeedMul(0.06f);
StartPlayerLookAt("AreaIntroLook_1", 1.0f, 1.0f, "");
partSpeed = 1.0f;
break;
case 5:
StartPlayerLookAt("AreaIntroLook_2", 1.0f, 1.0f, "");
FadeOut(8.0f);
PlayGuiSound("", 0.8f);
partSpeed = 1.0f;
break;
}
if(GetLocalVarInt("iIntroPart") < 6) AddTimer("tmrIntro", partSpeed, "introSequence");
}
void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("engineer_1", true);
AddEnemyPatrolNode("engineer_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("engineer_1", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("engineer_1", "PathNodeArea_3", 0, "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
SetLocalVarInt("iIntroPart", 0);
}