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 static void NpcsInfo(WorldClient client, string[] args)
        {
            List <NpcSpawnRecord> spawnRecords = NpcSpawnRecord.GetMapNpcs(client.Character.Map.Id);

            client.Character.Reply("Npcs on map:");
            foreach (NpcSpawnRecord spawnRecord in spawnRecords)
            {
                client.Character.Reply($" - {spawnRecord.Template.Name}: Id={spawnRecord.TemplateId}, SpawnId={spawnRecord.Id}");
            }
        }
 public MapInstance(MapRecord record)
 {
     this.Record       = record;
     this.Npcs         = NpcSpawnRecord.GetMapNpcs(Record.Id);
     this.Interactives = InteractiveRecord.GetInteractivesOnMap(Record.Id);
 }