//::///////////////////////////////////////////////
//:: Custom User Defined Event
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*

*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////

void main()
{
    int nUser = GetUserDefinedEventNumber();

    if(nUser == 1001) //HEARTBEAT
    {

    }
    else if(nUser == 1002) // PERCEIVE
    {

    }
    else if(nUser == 1003) // END OF COMBAT
    {

    }
    else if(nUser == 1004) // ON DIALOGUE
    {

    }
    else if(nUser == 1005) // ATTACKED
    {

    }
    else if(nUser == 1006) // DAMAGED
    {

    }
    else if(nUser == 1007) // DEATH
    {
        int nKilled = GetLocalInt(GetModule(), "nBeetlesKilled");
        SetLocalInt(GetModule(), "nBeetlesKilled", nKilled + 1);
        int nSpawned = GetLocalInt(GetModule(), "nBeetlesSpawned");
        int nEncSpawned = GetLocalInt(GetModule(), "nBeetleEncountersSpawned");
        //DEBUG
        //SendMessageToPC(GetFirstPC(), "Beetles spawned/killed: " + IntToString(nSpawned) + "/" + IntToString(nKilled + 1));
        if ((nEncSpawned == 5) && (nKilled + 1 == nSpawned))
        {
            object oPC = GetFirstPC();
            if (GetLocalInt(GetModule(), "nTookBeetleQuest") == 1)
            {
                AddJournalQuestEntry("je_beetleproblem", 20, oPC, TRUE, TRUE);
            }
        }
    }
    else if(nUser == 1008) // DISTURBED
    {

    }

}

