[code]////////////////////////////
// Run first time starting map
void OnStart()
{
    //Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
    if(ScriptDebugOn())
    {
        GiveItemFromFile("lantern", "lantern.ent");
 
        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
    }
    
    SetEntityPlayerInteractCallback("Key_1", "HammerScare", true);
    AddUseItemCallback("", "Key_1", "mansion_1", "UsedKeyOnDoor", true);
    AddEntityCollideCallback("Player","script_chairscare","ChairScare", false, 1);
    for (int x = 1; x < 23; x++) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, "");
        }
    AddEntityCollideCallback("servant_grunt_1", "ScriptArea_1", "Reverse", false, 1);
}
void Reverse() {
    for (int x = 23; x > 1; x--) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, "");
        }
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked(asEntity,false,true);
    PlaySoundAtEntity("","unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
}
void HammerScare(string &in entity, string &in type)
{
  AddPropForce("sledge_1", 9900, 0, 0, "world");
}
void ChairScare(string &in entity, string &in type)
{
  SetEntityActive("chairscare",true);
  AddPropImpulse("chairscare", 0, 0, -9990, "world");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 
}