Exemplo n.º 1
0
        public static void CreateInstances()
        {
            UpdateLogger updateLogger = new UpdateLogger();

            int num = 0;

            foreach (var record in Maps)
            {
                record.InteractiveElements = InteractiveElementRecord.GetActiveElementsOnMap(record.Id);

                record.Position = MapPositionRecord.GetMapPosition(record.Id);

                record.MonsterSpawnsSubArea = MonsterSpawnRecord.GetSpawns(record.SubAreaId).ToArray();

                record.NpcsRecord = NpcSpawnRecord.GetMapNpcs(record.Id).ToArray();

                record.Instance = new MapInstance(record);

                NpcSpawnsManager.Instance.SpawnAtStartup(record);

                if (record.AbleToSpawn)
                {
                    MonsterSpawnManager.Instance.SpawnMonsters(record);
                }

                updateLogger.Update(num.Percentage(Maps.Count));
                num++;
            }
        }
Exemplo n.º 2
0
        public void Reload()
        {
            this.Record.InteractiveElements = InteractiveElementRecord.GetActiveElementsOnMap(Record.Id);
            this.m_interactiveElements      = Record.InteractiveElements.ConvertAll(x => x.GetMapInteractiveElement(this));
            this.OnElementsUpdated();

            foreach (var character in GetEntities <Character>())
            {
                character.Client.Send(GetMapComplementaryInformationsDataMessage(character));
            }
        }