//::///////////////////////////////////////////////
//:: Name x2_def_ondamage
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Default OnDamaged script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
#include "nw_i0_plot"
void main()
{
    //--------------------------------------------------------------------------
    // GZ: 2003-10-16
    // Make Plot Creatures Ignore Attacks
    //--------------------------------------------------------------------------
    if (GetPlotFlag(OBJECT_SELF))
    {
        return;
    }

    //--------------------------------------------------------------------------
    // Execute old NWN default AI code
    //--------------------------------------------------------------------------
    ExecuteScript("nw_c2_default6", OBJECT_SELF);

        int nMaxHP = GetMaxHitPoints();
        int nCurrHP = GetCurrentHitPoints();

        if (GetLocalInt(OBJECT_SELF,"NW_L_DOTHISONCE") == 0)
        if((nCurrHP * 2) <= nMaxHP && GetLocalInt(OBJECT_SELF,"Generic_Surrender") == 0)
        {
        SpeakString("That will suffice. The benefit of existing for over eight centuries is learning the virtue of patience.");


        effect eVFX;
        object oSelf = OBJECT_SELF;


    // Destroy an object (not fully effective until this script ends).

    eVFX = EffectVisualEffect(472);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSelf);
    DestroyObject(oSelf, 1.5);
ExecuteScript("prc_npc_damaged", OBJECT_SELF);


        }
        }

