Beispiel #1
0
        private static bool ShouldSell(string sellName)
        {
            try
            {
                foreach (PItem item in Inventory.GetItemsInBags)
                {
                    try
                    {
                        string str3;
                        if (ItemDatabase.GetItem(item.EntryId.ToString()) == null)
                        {
                            continue;
                        }
                        string str  = ItemDatabase.GetItem(item.EntryId.ToString())["item_name"].ToString();
                        string str2 = ItemDatabase.GetItem(item.EntryId.ToString())["item_quality"].ToString();
                        if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2))
                        {
                            goto Label_0185;
                        }
                        if ((((str != sellName) && (sellName.Replace(str, "").Length == sellName.Length)) || MailList.ShouldMail(str)) || (!ProtectedList.ShouldVendor(str) || ((str3 = str2) == null)))
                        {
                            continue;
                        }
                        if (!(str3 == "Poor"))
                        {
                            if (str3 == "Common")
                            {
                                goto Label_013D;
                            }
                            if (str3 == "UnCommon")
                            {
                                goto Label_014C;
                            }
                            if (str3 == "Низкий")
                            {
                                goto Label_015B;
                            }
                            if (str3 == "Обычный")
                            {
                                goto Label_016A;
                            }
                            if (str3 == "Необычный")
                            {
                                goto Label_0179;
                            }
                            continue;
                        }
                        if (!LazySettings.SellPoor)
                        {
                            continue;
                        }
                        return(true);

Label_013D:
                        if (!LazySettings.SellCommon)
                        {
                            continue;
                        }
                        return(true);

Label_014C:
                        if (!LazySettings.SellUncommon)
                        {
                            continue;
                        }
                        return(true);

Label_015B:
                        if (!LazySettings.SellPoor)
                        {
                            continue;
                        }
                        return(true);

Label_016A:
                        if (!LazySettings.SellCommon)
                        {
                            continue;
                        }
                        return(true);

Label_0179:
                        if (!LazySettings.SellUncommon)
                        {
                            continue;
                        }
                        return(true);

Label_0185:
                        Logging.Write(string.Format("[Vendor]Could not detect the name of: {0} is wowhead down?", item.EntryId), new object[0]);
                    }
                    catch (Exception exception)
                    {
                        Logging.Debug("Exception in ShouldSell (Loop): {0}", new object[] { exception });
                    }
                }
            }
            catch (Exception exception2)
            {
                Logging.Debug("Exception in ShouldSell: {0}", new object[] { exception2 });
            }
            return(false);
        }
Beispiel #2
0
        private static bool ShouldSell(string sellName)
        {
            try
            {
                foreach (PItem item in Inventory.GetItemsInBags)
                {
                    try
                    {
                        if (ItemDatabase.GetItem(item.EntryId.ToString()) != null)
                        {
                            string name    = ItemDatabase.GetItem(item.EntryId.ToString())["item_name"].ToString();
                            string quality = ItemDatabase.GetItem(item.EntryId.ToString())["item_quality"].ToString();
                            if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(quality))
                            {
                                if (name != sellName)
                                {
                                    continue;
                                }
                                if (MailList.ShouldMail(name))
                                {
                                    continue;
                                }
                                if (ProtectedList.ShouldVendor(name))
                                {
                                    switch (quality)
                                    {
                                    case "Poor":
                                        if (LazySettings.SellPoor)
                                        {
                                            return(true);
                                        }
                                        break;

                                    case "Common":
                                        if (LazySettings.SellCommon)
                                        {
                                            return(true);
                                        }
                                        break;

                                    case "UnCommon":
                                        if (LazySettings.SellUncommon)
                                        {
                                            return(true);
                                        }
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                Logging.Write(string.Format("[Vendor]Could not detect the name of: {0} is wowhead down?", item.EntryId));
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Logging.Debug("Exception in ShouldSell (Loop): {0}", e);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.Debug("Exception in ShouldSell: {0}", e);
            }
            return(false);
        }