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
    {
        object oZendril = GetObjectByTag("jhr_zendril_battle");
        SetLocalObject(oZendril, "oHealTarget", OBJECT_SELF);
        SignalEvent(oZendril, EventUserDefined(2000));
    }
    else if(nUser == 1007) // DEATH
    {
        object oZendril = GetObjectByTag("jhr_zendril_battle");
        SetLocalObject(oZendril, "oHealTarget", OBJECT_SELF);
        SignalEvent(oZendril, EventUserDefined(2001));
    }
    else if(nUser == 1008) // DISTURBED
    {

    }
    else if(nUser == 100) //
    {
        SpeakString("By the gods!", TALKVOLUME_SHOUT);
        SignalEvent(OBJECT_SELF, EventUserDefined(110));
    }
    else if(nUser == 110) //
    {
        DelayCommand(5.0, SpeakString("Attack the goblin heroes--perhaps we can demoralize them!", TALKVOLUME_SHOUT));
    }
}

