//::///////////////////////////////////////////////
//:: 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
    {
        CreateObject(OBJECT_TYPE_PLACEABLE, "jhr_bloodstain01", GetLocation(OBJECT_SELF));

        //Respawn if goblin hero encounter not exhausted
        if (GetLocalInt(GetModule(), "nGoblinHeroesExhaustedFlag") == 0){
            CreateObject(OBJECT_TYPE_CREATURE, "goblina010", GetLocation(GetObjectByTag("WP_INVASION_SPAWN")));
            // Also stop respawns after 100
            int nKilled = GetLocalInt(GetArea(OBJECT_SELF), "nTotalKilled") + 1;
            SetLocalInt(GetArea(OBJECT_SELF), "nTotalKilled", nKilled);
            if (nKilled >=100)
            {
                SetLocalInt(GetModule(), "nGoblinHeroesExhaustedFlag", 1);
            }
        }
    }
    else if(nUser == 1008) // DISTURBED
    {

    }

}

