public static void GetAllNpcs(this NpcCollection npcs, bool isHD, bool includePath)
        {
            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;

            uint npcCount = _wowDatabase.NpcCount;

            npcs.Clear();

            for (uint i = 0; i < npcCount; ++i)
            {
                SNpc?r = _wowDatabase.GetNpc(i);
                if (r != null && r.Value.modelId != -1)
                {
                    if (includePath)
                    {
                        string path = _wowDatabase.GetNpcPath(r.Value.modelDisplayId, isHD);
                        if (path == "")
                        {
                            continue;
                        }

                        if (!Engine.Instance.WowEnvironment.IsFileExist(path) && isHD)
                        {
                            path = _wowDatabase.GetNpcPath(r.Value.modelDisplayId, false);
                        }

                        npcs.Add(new Npc()
                        {
                            Name           = r.Value.name,
                            Type           = r.Value.type,
                            ModelDisplayId = r.Value.modelDisplayId,
                            ModelId        = r.Value.modelId,
                            Path           = path
                        });
                    }
                    else
                    {
                        npcs.Add(new Npc()
                        {
                            Name           = r.Value.name,
                            Type           = r.Value.type,
                            ModelDisplayId = r.Value.modelDisplayId,
                            ModelId        = r.Value.modelId
                        });
                    }
                }
            }
        }
Exemple #2
0
        public static void GetAllNpcs(this NpcCollection npcs)
        {
            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;

            uint npcCount = _wowDatabase.NpcCount;

            npcs.Clear();

            for (uint i = 0; i < npcCount; ++i)
            {
                SNpc?r = _wowDatabase.GetNpc(i);
                if (r != null && r.Value.modelId != -1)
                {
                    npcs.Add(new Npc()
                    {
                        Name = r.Value.name, Type = r.Value.type, ModelDisplayId = r.Value.modelDisplayId, ModelId = r.Value.modelId
                    });
                }
            }
        }