public async Task DestroyItem([Summary("Item to be destroyed. This action cannot be undone.")] int num) { var userinfo = Context.Message.Author; if (num > 20 || num < 1) { await userinfo.SendMessageAsync($"**There isn't any Item to Destroy in the chosen slot.**"); return; } string[] Inv = PLDatabase.getInventoryOf(userinfo.Id.ToString()); await userinfo.SendMessageAsync($"**Item __{Inv[num-1]}__ has been destroyed. This action cannot be undone :(**"); PLDatabase.DestroyItemXOf(num, userinfo.Id.ToString()); try{ await Context.Message.DeleteAsync(); }catch (Exception e) { } //DELETE USER REQUEST MSG }
public async Task PrintInventory() { var m = Context.Message; var userinfo = Context.Message.Author; string[] Inv = PLDatabase.getInventoryOf(userinfo.Id.ToString()); var eb = new EmbedBuilder(); eb.Title = $"**Inventory Menu**"; eb.Description = $":: {userinfo.Username} ::"; eb.Color = Color.Gold; //Console.WriteLine("AAA"); //Add Indexes int j = 1; //string invprint = ""; foreach (string s in Inv) { if (s.Split('#')[3] != "0") //NOT EMPTY { if (s.Split('#')[5] != "0") //Armor { eb.AddInlineField($"{j.ToString()}: {s.Split('#')[1]} LVL: {s.Split('#')[3]}", $"Description:\n{s.Split('#')[2]}\nDefense = {s.Split('#')[5]} | SpecialAttributes = {s.Split('#')[4]}"); } else if (s.Split('#')[6] != "0")//weapon { eb.AddInlineField($"{j.ToString()}: {s.Split('#')[1]} LVL: {s.Split('#')[3]}", $"Description:\n{s.Split('#')[2]}\nDamage = {s.Split('#')[6]} | Accuracy = {s.Split('#')[6]} | SpecialAttributes = {s.Split('#')[4]}"); } } else //EMPTY SPACE { eb.AddInlineField($"{j.ToString()}: {s.Split('#')[1]}", "Empty Space"); } //HA#BareFist#ITEM_DESC#1#0#0#10*1D2#30## j++; } await userinfo.SendMessageAsync("", false, eb); try{ await Context.Message.DeleteAsync(); }catch (Exception e) { } //DELETE USER REQUEST MSG }
public async Task EquipItem([Summary("Inventory Item index")] int num) { var userinfo = Context.Message.Author; if (num > 20 || num < 1) { await userinfo.SendMessageAsync($"**he Chosen Item is not Equipable.**"); return; } string[] Inv = PLDatabase.getInventoryOf(userinfo.Id.ToString()); if (PLDatabase.EquipItemXOf(num, Context.Message.Author.Id.ToString())) { await userinfo.SendMessageAsync($"**Item __{Inv[num - 1]}__ Equiped.**"); } else { await userinfo.SendMessageAsync($"**The Chosen Item is not Equipable __OR__ Your hands are Full.**"); } try{ await Context.Message.DeleteAsync(); }catch (Exception e) { } //DELETE USER REQUEST MSG }