public async Task IncomingPlayerBoarLeatherCollectingRequest() { if (CharactersData.GetCharacterHuntingSkill(Context.User.Id) >= 20) { //Checking commands if (CharactersData.GetCharacterBoarCarcass(Context.User.Id) < 1) { LeatherEmbed.WithColor(Color.Blue); LeatherEmbed.AddField("<:Knife:607575664987734026>```You don't have enough boar carcasses to collect leather from them!```", "```At least 1 boar carcass required```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); return; } //Execution of command LeatherEmbed.WithColor(Color.Blue); int TotalLeatherToGive = 0, TotalCarcassesToTook = 0, ChanceToGetBonusLeather, LeatherToGive; for (int i = CharactersData.GetCharacterBoarCarcass(Context.User.Id); i >= 1; i -= 1) { ChanceToGetBonusLeather = random.Next(0, 10); if (ChanceToGetBonusLeather > (7 - CharactersData.GetCharacterHuntingSkill(Context.User.Id) / 18)) { LeatherToGive = random.Next(3, 4); } else { LeatherToGive = random.Next(1, 2); } TotalLeatherToGive += LeatherToGive; TotalCarcassesToTook += 1; } LeatherEmbed.AddField("<:Knife:607575664987734026>```Success!```", $"```You have received {TotalLeatherToGive} units of boar leather!```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); //Save data await CharactersData.SaveCharacterBoarLeather(Context.User.Id, TotalLeatherToGive, 0.3f / CharactersData.GetCharacterHuntingSkill(Context.User.Id), TotalCarcassesToTook);; return; } else { LeatherEmbed.WithColor(Color.Blue); LeatherEmbed.AddField($"<:Knife:607575664987734026>```Hunting skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```", "```Required level of skill is: [20]\n" + $"Your current skill level is: [{CharactersData.GetCharacterHuntingSkill(Context.User.Id)}]```"); await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build()); return; } }
public async Task IncomingPlayerBoarMeatCollectingRequest() { if (CharactersData.GetCharacterCookingSkill(Context.User.Id) >= 20) { //Checking commands if (CharactersData.GetCharacterBoarCarcass(Context.User.Id) < 1) { CookingEmbed.WithColor(Color.Blue); CookingEmbed.AddField("<:Meat:607579880569307146>```You don't have enough boar carcasses to collect meat from them!```", "```At least 1 boar carcass required```"); await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build()); return; } //Execution of command CookingEmbed.WithColor(Color.Blue); int TotalMeatToGive = 0, TotalCarcassesToTook = 0, ChanceToGetBonusMeat, MeatToGive; for (int i = CharactersData.GetCharacterBoarCarcass(Context.User.Id); i >= 1; i -= 1) { ChanceToGetBonusMeat = random.Next(0, 10); if (ChanceToGetBonusMeat > (7 - CharactersData.GetCharacterCookingSkill(Context.User.Id) / 18)) { MeatToGive = random.Next(3, 6); } else { MeatToGive = random.Next(2, 4); } TotalMeatToGive += MeatToGive; TotalCarcassesToTook += 1; } CookingEmbed.AddField("<:Meat:607579880569307146>```Success!```", $"```You have received {TotalMeatToGive} units of boar meat!```"); await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build()); //Save data await CharactersData.SaveCharacterBoarMeat(Context.User.Id, TotalMeatToGive, 0.3f / CharactersData.GetCharacterCookingSkill(Context.User.Id), TotalCarcassesToTook);; return; } else { CookingEmbed.WithColor(Color.Blue); CookingEmbed.AddField($"<:Meat:607579880569307146>```Hunting skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```", "```Required level of skill is: [20]\n" + $"Your current skill level is: [{CharactersData.GetCharacterCookingSkill(Context.User.Id)}]```"); await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build()); return; } }