(02-26-2012, 10:26 AM)flamez3 Wrote: Post script again please.
okay
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key 1", "door", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_tower_1", "door2", "UsedKeyOnDoor1", true);
SetEntityCallbackFunc("key_tower_1", "OnPickup");
AddEntityCollideCallback("Player", "sec", "sec", true, 1);
AddEntityCollideCallback("Player", "scary", "scary", true, 1);
AddEntityCollideCallback("table", "tablescript", "tablescript", true, 1);
AddEntityCollideCallback("enemy_suitor_1", "run", "run", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0.0f, false);
RemoveItem("key 1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0.0f, false);
RemoveItem("key_tower_1");
}
void OnPickup(string &in asItem, string &in asEntity)
{
SetEntityActive("character_dog_1",true);
}
void sec(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 20.f, "running");
AddQuest("quest1","quest1");
}
void scary(string &in asTimer)
{
PlayMusic("horror1.ogg", true, 1, 1, 1, true);
SetEntityActive("deformed_man_1", true);
SetEntityActive("candlestick_floor_red_1", true);
GiveSanityDamage(5.0f, true);
AddTimer("", 2.f, "scare1");
}
void scare1(string &in asTimer)
{
SetEntityActive("deformed_man_2", true);
SetEntityActive("candlestick_floor_red_2", true);
SetEntityActive("deformed_man_1", false);
SetEntityActive("candlestick_floor_red_1", false);
GiveSanityDamage(5.0f, true);
AddTimer("", 2.f, "scare2");
}
void scare2(string &in asTimer)
{
SetEntityActive("deformed_man_3", true);
SetEntityActive("candlestick_floor_red_3", true);
SetEntityActive("deformed_man_2", false);
SetEntityActive("candlestick_floor_red_2", false);
GiveSanityDamage(5.0f, true);
AddTimer("", 3.f, "scare3");
}
void scare3(string &in asTimer)
{
SetEntityActive("deformed_man_3", false);
SetEntityActive("candlestick_floor_red_3", false);
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
void tablescript(string &in asTimer)
{
SetEntityActive("run", true);
}
void run(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", false);
}
void running(string &in asTimer)
{
SetEntityActive("enemy_suitor_1", true);
ShowEnemyPlayerPosition("enemy_suitor_1");
GiveSanityDamage(5.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}