ACR_CreatureBehavior.CreatureObject.GetAlliesInMelee C# (CSharp) Method

GetAlliesInMelee() public method

This returns the number of allies who are near hostile opponents.
public GetAlliesInMelee ( ) : int
return int
        public int GetAlliesInMelee()
        {
            int returnVal = 0;
            foreach (CreatureObject partymember in Party.PartyMembers)
            {
                foreach(uint target in Script.GetObjectsInShape(CLRScriptBase.SHAPE_SPHERE, 5.0f, Script.GetLocation(partymember.ObjectId), true, CLRScriptBase.OBJECT_TYPE_CREATURE, Script.Vector(0.0f, 0.0f, 0.0f)))
                {
                    int add = 0;
                    if(Script.GetReputation(partymember.ObjectId, target) < 10)
                    {
                        add = 1;
                    }
                    returnVal += add;
                }
            }
            return returnVal;
        }