private void OnPerceptionLostSightObject(uint PerceivedObjectId,
bool LastDetection)
{
if (Party == null) return; // Creature hasn't initialized as spawned yet; thus, there's nothing
// tracked as already existing.
if (Script.GetObjectType(PerceivedObjectId) != CLRScriptBase.OBJECT_TYPE_CREATURE) return;
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);
}
}
}
}
}