////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("","monsterdoorkey_1","monsterdoor", "UsedKeyOnDoor",true);
AddUseItemCallback("","secretkey_1","sala", "UsedKeyOnDoor2",true);
AddUseItemCallback("","avainhihi_1","alex", "UsedKeyOnDoor3",true);
AddEntityCollideCallback("Player", "jeesus_1", "HolyJesus", true, 1);
AddEntityCollideCallback("jeesusfly_1", "jeesus_1", "Sound", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "jumalautakohta", "Sound2", true, -1);
SetEntityCallbackFunc("monsterdoorkey_1", "OnPickup");
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddEntityCollideCallback("Player", "kolaa", "Sound4", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem("monsterdoorkey_1");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("sala", false, true);
PlaySoundAtEntity("", "unlock_door", "sala", 0, false);
RemoveItem("secretkey_1");
}
void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("jeesusfly_1", true);
AddPropForce("jeesusfly_1", 0, 0, 30000, "World");
}
void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "pystyy.ogg", "jeesus_1", 0, false);
}
void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("alex", false, true);
PlaySoundAtEntity("", "unlock_door", "alex", 0, false);
RemoveItem("avainhihi_1");
}
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", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
}
void Sound2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "jumalauta.ogg", "jumalautakohta", 0, false);
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("veijo", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "monsterdoorkey_1", 0, false);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 0);
}
void Sound4(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "troll.ogg", "kolaa", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}