//::///////////////////////////////////////////////
//:: Default: On User Defined
//:: NW_C2_DEFAULTD
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Determines the course of action to be taken
    on a user defined event.
*/
//:://////////////////////////////////////////////
//:: Created By: Don Moar
//:: Created On: April 28, 2002
//:://////////////////////////////////////////////
void main()
{
int nMaxHP = GetMaxHitPoints();
        int nCurrHP = GetCurrentHitPoints();
         // * generic surrender should only fire once
          // * generic surrender should only fire once
        if (GetLocalInt(OBJECT_SELF,"NW_L_DOTHISONCE") == 0)
        if((nCurrHP * 2) <= nMaxHP && GetLocalInt(OBJECT_SELF,"Generic_Surrender") == 0)
        {
            //SpeakString("Wait! I yield...");
           // ClearAllActions();
            SurrenderToEnemies();
            //AssignCommand(GetLastAttacker(), ClearAllActions());
            // * SHOULDN'T HAVE TO DO THIS
           //SetIsTemporaryEnemy(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC));
            SetLocalInt(OBJECT_SELF,"Generic_Surrender",1)   ;
            SpeakOneLinerConversation();
            SetLocalInt(OBJECT_SELF,"NW_L_DOTHISONCE",1);
        }
        }
