//::///////////////////////////////////////////////
//:: NW_C2_DIMDOOR.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
     Creature randomly hops around
     to enemies during combat.
*/
//:://////////////////////////////////////////////
//:: Created By:  Brent
//:: Created On:  January 2002
//::///////////////////////////////////////////////

void JumpToWeakestEnemy(object oTarget)
{
    object oTargetVictim = GetFactionMostDamagedMember(oTarget);
    // * won't jump if closer than 4 meters to victim
    if ((GetObjectSeen(oTargetVictim) == TRUE))
    {

       ActionAttack(oTargetVictim);
    }
}
void main()
{
	ExecuteScript("prc_npc_userdef", OBJECT_SELF);
	
    // * During Combat try teleporting around
    if (GetUserDefinedEventNumber() == 1003)
    {

          // JumpToWeakestEnemy(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY));

    }
}