Пример #1
0
        /// <summary>
        /// Spawns the pool to which the NPCSpawnEntry belongs which is closest to the given location
        /// </summary>
        public static NPCSpawnPoint SpawnClosestSpawnEntry(IWorldLocation pos)
        {
            NPCSpawnEntry closestSpawnEntry = NPCMgr.GetClosestSpawnEntry(pos);

            if (closestSpawnEntry != null)
            {
                NPCSpawnPool npcSpawnPool = pos.Map.AddNPCSpawnPoolNow(closestSpawnEntry.PoolTemplate);
                if (npcSpawnPool != null)
                {
                    return(npcSpawnPool.GetSpawnPoint(closestSpawnEntry));
                }
            }

            return((NPCSpawnPoint)null);
        }