minor feexes

fish and general store fixe
master
Lan 4 years ago
parent 5f9ebe48a4
commit 9564f54f55
  1. 77
      Kehyeedra3/Commands/Economy.cs
  2. 20
      Kehyeedra3/Commands/Interactive.cs

@ -231,50 +231,51 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\narrrrr-right, ye scurby bastard, I know yer eager t' scour the seven seas but ye needs t' wait till the next minute t' pillage the booty'o'the depths, savvy?");
return;
}
items = guser.GetGenInve(); //
int[] subtract = { 0 };
subtract[0] = -1;
if (items.TryGetValue(Items.SpecialBait, out int[] SpecB))
if (guser.GeneralInventory != null|| guser.GeneralInventory != "{}")
{
SpecialBait = SpecB[0];
BigBait = SpecB[0];
RareBait = SpecB[0];
if (SpecialBait > 0)
{
SpecB[0] -= 1;
}
else
items = guser.GetGenInve(); //
int[] subtract = { 0 };
subtract[0] = -1;
if (items.TryGetValue(Items.SpecialBait, out int[] SpecB))
{
if (items.TryGetValue(Items.BigBait, out int[] BigB))
SpecialBait = SpecB[0];
BigBait = SpecB[0];
RareBait = SpecB[0];
if (SpecialBait > 0)
{
BigBait = BigB[0];
if (BigBait > 0)
{
BigB[0] -= 1;
}
SpecB[0] -= 1;
}
if (items.TryGetValue(Items.RareBait, out int[] RareB))
else
{
RareBait = RareB[0];
if (RareBait > 0)
if (items.TryGetValue(Items.BigBait, out int[] BigB))
{
RareB[0] -= 1;
BigBait = BigB[0];
if (BigBait > 0)
{
BigB[0] -= 1;
}
}
if (items.TryGetValue(Items.RareBait, out int[] RareB))
{
RareBait = RareB[0];
if (RareBait > 0)
{
RareB[0] -= 1;
}
}
}
}
}
if (items.TryGetValue(Items.Lettuce, out int[] Lettu))
{
Lettuce = Lettu[0];
if (Lettuce > 0)
if (items.TryGetValue(Items.Lettuce, out int[] Lettu))
{
Lettu[0] -= 1;
Lettuce = Lettu[0];
if (Lettuce > 0)
{
Lettu[0] -= 1;
}
}
}
guser.SetGenInve(items);
guser.SetGenInve(items);
}
level = user.Lvl;
totalXp = user.TXp;
@ -287,7 +288,7 @@ namespace Kehyeedra3.Commands
int rari = SRandom.Next(0, 2001);
int weigh = SRandom.Next(10, 1501+prestige*500);
int tierRoll = SRandom.Next(0, 20*rod+10*prestige+1);
int tierRoll = SRandom.Next(0, 20*rod+10*prestige+11);
int dCatchRoll = SRandom.Next(0, 1000+prestige*20);
int dcatch = 1;
@ -527,7 +528,7 @@ namespace Kehyeedra3.Commands
if (bLet)
{
xp = Convert.ToUInt64(Math.Round(xp * 1.1, 0, MidpointRounding.ToEven)) * (ulong)dcatch;
xp = Convert.ToUInt64(Math.Round(xp * 1.1, 0, MidpointRounding.ToEven));
}
string lvlUp = "";
@ -795,7 +796,7 @@ namespace Kehyeedra3.Commands
return;
}
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nProcess 1 **Lucky Catfish** for **0.1000%**? \n(Owned: {fish})\n");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nProcess 1 **Lucky Catfish** for **0.1000%**? \n(Owned: {fish})\nType 'yes' to continue.");
var inp = await NextMessageAsync();
if (inp.Content.ToLowerInvariant().Contains("yes"))
{
@ -810,6 +811,10 @@ namespace Kehyeedra3.Commands
await Database.SaveChangesAsync();
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have obtained **Lucky Paste**");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nok retard.");
}
}
else
{
@ -821,7 +826,7 @@ namespace Kehyeedra3.Commands
if (T2Up[0] != 0 && Rod[0] != 0)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nDo you want to craft the **Reinforced Fishing Rod**?\nThis will use 1 **Lucky Paste** and 1 **Incomplete Rod**.");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nDo you want to craft the **Reinforced Fishing Rod**?\nThis will use 1 **Lucky Paste** and 1 **Incomplete Rod**.\nType 'yes' to continue.");
var inp = await NextMessageAsync();
if (inp.Content != null && inp.Content.ToLowerInvariant().Contains("yes"))
{

@ -566,7 +566,7 @@ namespace Kehyeedra3.Commands
}
[Command("gstore", RunMode = RunMode.Async),Alias("gs")]
[Command("gstore", RunMode = RunMode.Async),Alias("gs"),Summary("General store: gstore or gs. Secondary variables s/sell to sell, b/buy to buy.")]
public async Task GeneralStore(string input = null)
{
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
@ -624,12 +624,12 @@ namespace Kehyeedra3.Commands
}
else if (input == "b" || input == "buy")
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWhich item?\n{itemtxt}");
var inp = await NextMessageAsync();
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the item and amount (ID num)\n{itemtxt}");
var inp = await NextMessageAsync(timeout: TimeSpan.FromMinutes(2));
item = itemlist.FirstOrDefault(i => (int)i.Id == int.Parse(inp.Content));
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nHow many?");
inp = await NextMessageAsync();
var inpsep = inp.Content.Split(" ");
item = itemlist.FirstOrDefault(i => (int)i.Id == int.Parse(inpsep[0]));
items = user.GetGenInve();
@ -641,12 +641,12 @@ namespace Kehyeedra3.Commands
items.Add(item.Id, amount);
}
if (int.Parse(inp.Content) * item.Price <= user.Money)
if (int.Parse(inpsep[1]) * item.Price <= user.Money)
{
amount[0] += int.Parse(inp.Content);
int count = int.Parse(inp.Content);
amount[0] += int.Parse(inpsep[1]);
int count = int.Parse(inpsep[1]);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThis will cost you {count * item.Price}.\nType 'ok' to confirm.");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThis will cost you {((long)(count * item.Price)).ToYeedraDisplay()}.\nType 'ok' to confirm.");
inp = await NextMessageAsync();
if (inp.Content.ToLowerInvariant() == "ok")

Loading…
Cancel
Save