//::///////////////////////////////////////////////
//:: Default: End of Combat Round
//:: NW_C2_DEFAULT3
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Calls the end of combat script every round
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 16, 2001
//:://////////////////////////////////////////////

#include "NW_I0_GENERIC"
void main()
{
    if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
    {
        DetermineSpecialBehavior();
    }
    else if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
    {
       DetermineCombatRound();
    }
    if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(1003));
    }

// Modified By: Dalantriel Jul 22, 2002
// If not in combat, recapture or return to designated Outpost
    if(!GetIsInCombat(OBJECT_SELF))
    {
        if(GetCurrentHitPoints(GetObjectByTag("pcbanner010")) > 0)
        {
            ActionAttack(GetObjectByTag("pcbanner010"));
        }

        else if (GetDistanceToObject(GetObjectByTag("ai_horde010b")) < 3.0f)
        {
            ClearAllActions();
        }

        else
        {
            ActionMoveToObject(GetObjectByTag("ai_horde010a"));
            ActionMoveToObject(GetObjectByTag("ai_horde010b"));
        }
    }
}


