コード例 #1
0
        /// <summary>
        /// Get a list of entities
        /// </summary>
        /// <returns></returns>
        public List <ActorItem> GetEntities()
        {
            Player = GameMemory.GetPlayer();

            List <ActorItem> entities = GameMemory.GetNpcsAroundPlayer();

            // remove junk
            for (var i = 0; i < entities.Count; i++)
            {
                ActorItem entity = entities[i];

                // check if we're ignoring this entity
                if (IsIgnored("ENPC", entity))
                {
                    entities.RemoveAt(i);
                    continue;
                }
            }

            return(entities);
        }
コード例 #2
0
        /// <summary>
        /// Scan for entities
        /// </summary>
        public void Scan()
        {
            Player = GameMemory.GetPlayer();

            // get npcs
            List <ActorItem> entities = GameMemory.GetNpcsAroundPlayer();

            if (entities.Count == 0)
            {
                return;
            }

            // loop through npcs
            foreach (var entity in entities)
            {
                // check if we're ignoring this entity
                if (IsIgnored("ENPC", entity))
                {
                    continue;
                }

                // check we havent already tracked it
                if (list.IndexOf(entity.NPCID2) == -1)
                {
                    total++;

                    // add to existing list
                    list.Add(entity.NPCID2);
                    LogEntity("ENPC", entity);

                    // add to map
                    App.Instance.MapViewer.AddNpcIcon(entity);
                    App.Instance.labelTotalNpcs.Text = total.ToString();

                    // save npc to file
                    Saver.SaveNpc(entity);
                }
            }
        }