Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2012 20:55
Show Gist options
  • Save anonymous/2648752 to your computer and use it in GitHub Desktop.
Save anonymous/2648752 to your computer and use it in GitHub Desktop.
void OnStart()
{
AddUseItemCallback("", "staircasekey", "staircasedoor", "UsedKeyOnDoor", true);
SetEntityConnectionStateChangeCallback("secret_lever_1", "func_shelf");
SetEntityConnectionStateChangeCallback("secret_lever_2", "func_shelf");
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void UsedKeyOnDoor(string &in staircasekey, string &in staircasedoor)
{
SetSwingDoorLocked(staircasedoor, false, true);
PlaySoundAtEntity("", "unlock_door", "staircasedoor", 0, false);
RemoveItem(staircasekey);
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_shelf_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_shelf_2",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_2", 0, false);
return;
}
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 4, "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment