public static void GetItemsByType(this ItemCollection items, E_ITEM_TYPE type) { WowDatabase _wowDatabase = Engine.Instance.WowDatabase; uint itemCount = _wowDatabase.ItemCount; items.Clear(); for (uint i = 0; i < itemCount; ++i) { SItem?r = _wowDatabase.GetItem(i); if (r != null) { if (r.Value.type == (int)type) { if (r.Value.name.IndexOf("deprecated", StringComparison.CurrentCultureIgnoreCase) == -1) { items.Add(new Item() { Name = r.Value.name, Type = (E_ITEM_TYPE)r.Value.type, Id = r.Value.id, ModelId = r.Value.modelId, SubClassName = r.Value.subclassname }); } } } } }
public static void GetM2ItemsBySlot(this M2ItemCollection items, E_CHAR_SLOTS slot) { WowDatabase _wowDatabase = Engine.Instance.WowDatabase; uint itemCount = _wowDatabase.ItemCount; items.Clear(); for (uint i = 0; i < itemCount; ++i) { SItem?r = _wowDatabase.GetItem(i); if (r != null && r.Value.IsMatchSlot(slot) && (r.Value.name.IndexOf("deprecated", StringComparison.CurrentCultureIgnoreCase) == -1)) { int itemid = r.Value.id; string modelpath; string texturepath; modelpath = _wowDatabase.GetItemPath(itemid, out texturepath); items.Add(new M2Item() { Name = r.Value.name, Type = (E_ITEM_TYPE)r.Value.type, Id = r.Value.id, SubClassName = r.Value.subclassname, ModelPath = modelpath, TexturePath = texturepath }); } } }
private static int[] GetItemIdsByName(string name, E_CHAR_SLOTS slot, int id) { WowDatabase _wowDatabase = Engine.Instance.WowDatabase; uint itemCount = _wowDatabase.ItemCount; List <int> idList = new List <int>(); for (uint i = 0; i < itemCount; ++i) { SItem?r = _wowDatabase.GetItem(i); if (r.HasValue && r.Value.id != id && r.Value.name == name) { if (r.Value.IsMatchSlot(slot) && (r.Value.name.IndexOf("deprecated", StringComparison.CurrentCultureIgnoreCase) == -1)) { idList.Add(r.Value.id); } } } return(idList.ToArray()); }