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

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

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


    if(nUser == 10) //Follow Nearest PC
    {
        //ActionForceFollowObject(GetPCSpeaker());
    }
    else if(nUser == 1001) //HEARTBEAT
    {

    }
    else if(nUser == 1002) // PERCEIVE
    {
        object oChicken = OBJECT_SELF;
        object oPC = GetLastPerceived();
        // clucky follows owner PC
        if (GetLocalInt(GetModule(), "nCluckyActiveFlag") == 1)
        {
            if ((GetIsObjectValid(oPC)) && (oPC == GetLocalObject(oChicken, "oOwner")))
            {
                AssignCommand(oChicken, ClearAllActions());
                AssignCommand(oChicken, ActionForceFollowObject(oPC));
            }
        }
    }
    else if(nUser == 1003) // END OF COMBAT
    {

    }
    else if(nUser == 1004) // ON DIALOGUE
    {
        object oChicken = OBJECT_SELF;
        object oPC = GetLastSpeaker();
        // clucky follows owner PC
        if (GetLocalInt(GetModule(), "nCluckyActiveFlag") == 1)
        {
            if ((GetIsObjectValid(oPC)) && (oPC == GetLocalObject(oChicken, "oOwner")))
            {
                AssignCommand(oChicken, ClearAllActions());
                AssignCommand(oChicken, ActionForceFollowObject(oPC));
            }
        }
    }
    else if(nUser == 1005) // ATTACKED
    {

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

    }
    else if(nUser == 1007) // DEATH
    {

    }
    else if(nUser == 1008) // DISTURBED
    {

    }

}

