void OnEnter()
{
//
}
void OnStart()
{
SetEntityPlayerLookAtCallback("weepingangel", "Callback", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "dreamarea", true, 0);
AddEntityCollideCallback("Player", "Area_2", "boo1", true, 0);
AddEntityCollideCallback("Player", "Area_3", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_4", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_5", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_6", "CheckAreas", false, 0);
}
void Callback(string &in asEntity, int alState)
{
AddEntityCollideCallback("Player", "Area", "surprisemotherfucker", true, 0);
}
void surprisemotherfucker(string &in asParent, string &in asChild, int alState)
{
SetEntityPlayerLookAtCallback("weepingangel_1", "Callback1", true);
SetEntityActive("weepingangel", false);
SetEntityActive("weepingangel_1", true);
SetEntityActive("Area_3", true);
SetEntityActive("Area_4", true);
SetEntityActive("Area_5", true);
SetEntityActive("Area_6", true);
}
void boo1(string &in asParent, string &in asChild, int alState)
{
SetEntityPlayerLookAtCallback("weepingangel_1", "Callback2", true);
}
void Callback1(string &in asEntity, int alState)
{
GiveSanityDamage(20.00, true);
AddUseItemCallback("", "Hammer", "weepingangel_1", "lolno", false);
AddUseItemCallback("", "Hammer", "weepingangel_3", "lolno", false);
AddUseItemCallback("", "Hammer", "weepingangel_4", "lolno", false);
AddUseItemCallback("", "Hammer", "weepingangel_5", "lolno", false);
AddUseItemCallback("", "Hammer", "weepingangel_6", "lolno", false);
}
void CheckAreas(string &in asParent, string &in asChild, int alState)
{
if (alState == 1)
{
SetLocalVarInt("InsideArea", 1);
SetLocalVarInt(asChild, 1);
}
else if (alState == -1)
{
SetLocalVarInt("InsideArea", 0);
SetLocalVarInt(asChild, 0);
}
}
void Callback2(string &in asEntity, int alState)
{
if (GetLocalVarInt("InsideArea") == 1)
{
if (alState == 1)
{
//
}
else if (alState == -1)
{
int suffix = 0;
for (int i = 3; i < 7; ++i)
{
if (GetLocalVarInt("Area_"+i) == 1)
{
suffix = i;
break;
}
}
if (suffix != 0)
{
FadeOut(0.50);
FadeIn(1.50);
GiveSanityDamage(5, true);
SetEntityActive("WeepingAngel_1", false);
SetEntityActive("WeepingAngel_3", false);
SetEntityActive("WeepingAngel_4", false);
SetEntityActive("WeepingAngel_5", false);
SetEntityActive("WeepingAngel_6", false);
SetEntityActive("WeepingAngel_"+suffix, true);
}
}
}
}