public static async Task OpenUncommonBox(SocketUser user, ITextChannel channel) { var config = GlobalUserAccounts.GetUserAccount(user); var configg = GlobalWasagotchiUserAccounts.GetWasagotchiAccount(user); var embed = new EmbedBuilder() .WithColor(26, 252, 10) .WithImageUrl("https://i.imgur.com/MHpJetn.png"); embed.Title = "Uncommon Lootbox"; embed.Description = $"**{user.Username}** opened an **UNCOMMON** Lootbox!"; config.LootBoxCommon = config.LootBoxUncommon - 1; int potatoes = Global.Rng.Next(150, 300); config.Money += (ulong)potatoes; embed.AddField("Potatoes", potatoes); int wasagotchiBool = Global.Rng.Next(1, 3); if (wasagotchiBool == 1 || wasagotchiBool == 2) { if (configg.Have != true) { int wasagotchiValue = Global.Rng.Next(1, 64); Tuple <string, string> wasagotchi = WasagotchiInteractive.GetWasagotchiRarity(wasagotchiValue); embed.AddField("Wasagotchi", wasagotchi.Item2); configg.Have = true; configg.Breed = wasagotchi.Item1; GlobalWasagotchiUserAccounts.SaveAccounts(); } else { configg.CommonCapsule += 1; embed.AddField("Wasagotchi Item", "Common Wasagotchi Capsule (Open it with `w!openCapsule`!)"); } GlobalWasagotchiUserAccounts.SaveAccounts(); } int duelBool = Global.Rng.Next(1, 3); if (duelBool == 1 || duelBool == 2) { int duelValue = Global.Rng.Next(29, 56); string item = GetDuelItem(user, duelValue); embed.AddField("Duels Item", $"{item} (x1)"); } await channel.SendMessageAsync("", embed : embed.Build()); }
public static string GetDuelItem(SocketUser user, int value) { var config = GlobalUserAccounts.GetUserAccount(user); string item = string.Empty; var wasagotchi = WasagotchiInteractive.GetWasagotchi(value); switch (value) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: item = "Strength Potion"; if (config.Items.ContainsKey("Strength Potion")) { config.Items["Strength Potion"] += 1; } else { config.Items.Add("Strength Potion", 1); } break; case 13: case 8: case 9: case 10: case 11: case 12: case 14: item = "Speed Potion"; if (config.Items.ContainsKey("Speed Potion")) { config.Items["Speed Potion"] += 1; } else { config.Items.Add("Speed Potion", 1); } break; case 19: case 20: case 15: case 16: case 17: case 18: case 21: item = "Debuff Potion"; if (config.Items.ContainsKey("Debuff Potion")) { config.Items["Debuff Potion"] += 1; } else { config.Items.Add("Debuff Potion", 1); } break; case 25: case 26: case 27: case 22: case 23: case 24: case 28: item = "Equalizer Potion"; if (config.Items.ContainsKey("Equalizer Potion")) { config.Items["Equalizer Potion"] += 1; } else { config.Items.Add("Equalizer Potion", 1); } break; case 44: case 45: case 46: case 47: case 48: item = "Vile of Poison"; if (config.Items.ContainsKey("Vile Of Poison")) { config.Items["Vile Of Poison"] += 1; } else { config.Items.Add("Vile Of Poison", 1); } break; case 29: case 30: case 31: case 32: case 33: item = "Metallic Acid"; if (config.Items.ContainsKey("Metallic Acid")) { config.Items["Metallic Acid"] += 1; } else { config.Items.Add("Metallic Acid", 1); } break; case 34: case 35: case 36: case 37: case 38: item = "Weapon Liquifier"; if (config.Items.ContainsKey("Weapon Liquifier")) { config.Items["Weapon Liquifier"] += 1; } else { config.Items.Add("Weapon Liquifier", 1); } break; case 39: case 40: case 41: case 42: case 43: item = "Basic Treatment"; if (config.Items.ContainsKey("Basic Treatment")) { config.Items["Basic Treatment"] += 1; } else { config.Items.Add("Basic Treatment", 1); } break; case 49: case 50: case 51: case 52: item = "Divine Shield"; if (config.Items.ContainsKey("Divine Shield")) { config.Items["Divine Shield"] += 1; } else { config.Items.Add("Divine Shield", 1); } break; case 53: if (config.blessingProtection != true) { item = "Blessing of Protection"; config.blessingProtection = true; } else { item = "Blessing of Protection [DUPLICATE] (+2000 Potatoes)"; config.Money = config.Money + 2000; } break; case 54: if (config.blessingSwiftness != true) { item = "Blessing of Swiftness"; config.blessingSwiftness = true; } else { item = "Blessing of Swiftness [DUPLICATE] (+2000 Potatoes)"; config.Money = config.Money + 2000; } break; case 55: if (config.blessingStrength != true) { item = "Blessing of Stength"; config.blessingStrength = true; } else { item = "Blessing of Stength [DUPLICATE] (+2000 Potatoes)"; config.Money = config.Money + 2000; } break; case 56: if (config.blessingWar != true) { item = "Blessing of War"; config.blessingWar = true; } else { item = "Blessing of War [DUPLICATE] (+2000 Potatoes)"; config.Money = config.Money + 2000; } break; } GlobalUserAccounts.SaveAccounts(); return(item); } //1-56