private static void OnCreatureDeath() { NWCreature self = OBJECT_SELF; // Remove any custom object data from the cache. if (AppCache.CustomObjectData.ContainsKey(self.GlobalID)) { AppCache.CustomObjectData.Remove(self.GlobalID); } string script = GetBehaviourScript(OBJECT_SELF); if (string.IsNullOrWhiteSpace(script)) { return; } IAIBehaviour behaviour = GetAIBehaviour(script); behaviour.OnDeath(OBJECT_SELF); }