(09-03-2011, 07:02 AM)Your Computer Wrote: Post your code.
Alright.
void OnStart()
{
AddEntityCollideCallback("Player", "AreaFallDeath", "CollideFallDeath", false, 1); //Kill player instantly if he falls down when outside
AddEntityCollideCallback("Player", "Walk_Quest_Area", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "monster_1", "MonsterFunc1", true, 1);
AddEntityCollideCallback("Player", "Walk_Complete_Area", "FinishWalkQuest", true, 1);
//Add the Lantern and 10 Tinderboxes, always good to have light!
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<20;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}
void OnLeave()
{
}
void OnEnter()
{
PlayMusic("Kammarheit_1", true, 0.7, 5, 0, true);
}
///////////////////////
//BEGIN FALL TO DEATH//
void CollideFallDeath(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("fallaaaaaah", "11_fall", "Player", 0, false);
PlaySoundAtEntity("fallaaaaaah2", "scare_male_terrified5", "Player", 0, false);
FadeOut(0.3);
AddTimer("death1", 0.5f, "TimerFallDeath");
AddTimer("death2", 1, "TimerFallDeath");
}
void TimerFallDeath(string &in asTimer)
{
if(asTimer == "death1"){
PlaySoundAtEntity("bump1", "player_bodyfall", "Player", 0, false);
return;
}
DisableDeathStartSound();
AddPlayerHealth(-200);
PlaySoundAtEntity("pain", "player_falldamage_max", "Player", 0, false);
PlaySoundAtEntity("bump2", "player_bodyfall", "Player", 0, false);
}
////
/////////////////////
//////BEGIN MONSTER SPAWN
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity ("", "10_close_door", "Player", 0, false);
SetEntityActive("servant_grunt", true);
}
void MonsterFunc2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt", false);
}
///////END MONSTER SPAWN
////////PLAYER WRITES NOTE
void GetWalkQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest", "WalkQuest");
}
void FinishWalkQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("walkquest", "WalkQuest");
}
///////////////////