public async Task DropsFromRelics([Remainder] string item)
        {
            var json      = File.ReadAllText("SystemLang/relics.json");
            var therelics = RelicsData.FromJson(json);
            var embed     = new EmbedBuilder();

            embed.WithTitle($"Drops from relic {item}");
            embed.WithFooter("warframe alert ver 1.0", "http://3rdshifters.org/headerLogo.png");
            embed.WithColor(new Color(188, 66, 244));
            foreach (var relic in therelics.Relics)
            {
                var relicname = relic.Tier + " " + relic.RelicName;
                if (item.ToLower() == relicname.ToLower())
                {
                    for (int i = 0; i < relic.Rewards.Count; i++)
                    {
                        embed.AddField($"Item {i + 1} : ", $"{relic.Rewards[i].ItemName}\nRarity: {relic.Rewards[i].Rarity}\nChance: {relic.Rewards[i].Chance}%");
                    }

                    await Context.Channel.SendMessageAsync("", false, embed.Build());

                    break;
                }
            }
        }
        public async Task WhichRelic([Remainder] string item)
        {
            bool isVaulted = false;

            var embedcount = 0;
            var vJson      = File.ReadAllText("Data/vaulted.json");
            // JArray a = JArray.Parse(vJson);

            var json      = File.ReadAllText("SystemLang/relics.json");
            var therelics = RelicsData.FromJson(json);
            var embed     = new EmbedBuilder();

            embed.WithTitle($"Relics found containing {item}.");
            embed.WithFooter("warframe alert ver 1.0", "http://3rdshifters.org/headerLogo.png");
            embed.WithColor(new Color(188, 66, 244));
            foreach (var relic in therelics.Relics)
            {
                var relicname = relic.Tier + " " + relic.RelicName;

                {
                    for (int i = 0; i < relic.Rewards.Count; i++)
                    {
                        var currelic = relic.Rewards[i].ItemName.ToLower();
                        if (currelic.Contains(item.ToLower()) && relic.State == State.Intact)
                        {
                            if (embedcount > 5)
                            {
                                await Context.Channel.SendMessageAsync(
                                    "More then 5 results found, first 5 listed next.");

                                goto sendme;
                            }
                            embed.AddField($"Relic {embedcount + 1}: ", $" {relic.Tier} {relic.RelicName}\nRarity: {relic.Rewards[i].Rarity}");
                            embedcount = embedcount + 1;
                        }
                    }
                }
            }
sendme:
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Esempio n. 3
0
 public static string ToJson(this RelicsData self) => JsonConvert.SerializeObject(self, RConverter.Settings);