ACR_CreatureBehavior.CreatureObject.OnPerceptionLostHearingObject C# (CSharp) Method

OnPerceptionLostHearingObject() private method

Called when an object loses hearing of another object.
private OnPerceptionLostHearingObject ( uint PerceivedObjectId, bool LastDetection ) : void
PerceivedObjectId uint Supplies the perceived object id. ///
LastDetection bool True if this is the last detection /// method for the perceived object. ///
return void
        private void OnPerceptionLostHearingObject(uint PerceivedObjectId,
            bool LastDetection)
        {
            CreatureObject SeenObject = Server.ObjectManager.GetCreatureObject(PerceivedObjectId, true);

            //===== If we've actually lost this creature, we need to populate missing lists. ====//
            if (LastDetection)
            {
                int nReputation = Script.GetReputation(this.ObjectId, PerceivedObjectId);

                if (nReputation < 11)
                {
                    if (!Party.EnemiesLost.Contains(SeenObject))
                    {
                        if (!Party.CanPartyHear(SeenObject) && !Party.CanPartySee(SeenObject))
                        {
                            Party.RemovePartyEnemy(SeenObject);
                            Party.EnemiesLost.Add(SeenObject);
                        }
                    }
                }
            }        
        }