コード例 #1
0
ファイル: NPCMgr.cs プロジェクト: uvbs/Asda2-Server
        /// <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);
        }