public async Task IncomingPlayerBuffaloLeatherCollectingRequest()
            {
                if (CharactersData.GetCharacterHuntingSkill(Context.User.Id) >= 35)
                {
                    //Checking commands
                    if (CharactersData.GetCharacterBuffaloCarcass(Context.User.Id) < 1)
                    {
                        LeatherEmbed.WithColor(Color.Blue);
                        LeatherEmbed.AddField("<:Knife:607575664987734026>```You don't have enough buffalo carcasses to collect leather from them!```", "```At least 1 buffalo 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.GetCharacterBuffaloCarcass(Context.User.Id); i >= 1; i -= 1)
                    {
                        ChanceToGetBonusLeather = random.Next(0, 10);
                        if (ChanceToGetBonusLeather > (7 - CharactersData.GetCharacterHuntingSkill(Context.User.Id) / 24))
                        {
                            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 buffalo leather!```");
                    await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build());

                    //Save data
                    await CharactersData.SaveCharacterBuffaloLeather(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: [35]\n" +
                                          $"Your current skill level is: [{CharactersData.GetCharacterHuntingSkill(Context.User.Id)}]```");
                    await Context.Channel.SendMessageAsync("", false, LeatherEmbed.Build());

                    return;
                }
            }
Ejemplo n.º 2
0
            public async Task IncomingPlayerBuffaloMeatCollectingRequest()
            {
                if (CharactersData.GetCharacterCookingSkill(Context.User.Id) >= 35)
                {
                    //Checking commands
                    if (CharactersData.GetCharacterBuffaloCarcass(Context.User.Id) < 1)
                    {
                        CookingEmbed.WithColor(Color.Blue);
                        CookingEmbed.AddField("<:Meat:607579880569307146>```You don't have enough buffalo carcasses to collect meat from them!```", "```At least 1 buffalo 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.GetCharacterBuffaloCarcass(Context.User.Id); i >= 1; i -= 1)
                    {
                        ChanceToGetBonusMeat = random.Next(0, 10);
                        if (ChanceToGetBonusMeat > (7 - CharactersData.GetCharacterCookingSkill(Context.User.Id) / 24))
                        {
                            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 buffalo meat!```");
                    await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                    //Save data
                    await CharactersData.SaveCharacterBuffaloMeat(Context.User.Id, TotalMeatToGive, 0.3f / CharactersData.GetCharacterCookingSkill(Context.User.Id), TotalCarcassesToTook);;
                    return;
                }
                else
                {
                    CookingEmbed.WithColor(Color.Blue);
                    CookingEmbed.AddField($"<:Meat:607579880569307146>```Cooking skill comes with time, {CharactersData.GetCharacterName(Context.User.Id)}```",
                                          "```Required level of skill is: [35]\n" +
                                          $"Your current skill level is: [{CharactersData.GetCharacterCookingSkill(Context.User.Id)}]```");
                    await Context.Channel.SendMessageAsync("", false, CookingEmbed.Build());

                    return;
                }
            }