slight changes
changed some stuff to be more accurate since gambling has been gone for months and also made fish stuff more efficient
This commit is contained in:
@@ -138,7 +138,7 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{user.Money.ToYeedraDisplay()}%**.");
|
||||
@@ -156,7 +156,7 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount - user.Money))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{((long)amount).ToYeedraDisplay()}%**.");
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace Kehyeedra3.Commands
|
||||
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), end))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ namespace Kehyeedra3.Commands
|
||||
public async Task FishCommand()
|
||||
{
|
||||
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
|
||||
ulong totalXp;
|
||||
ulong xp;
|
||||
ulong level;
|
||||
ulong lvlXp;
|
||||
int prestige;
|
||||
int rod;
|
||||
ulong totalXp = 0;
|
||||
ulong xp = 0;
|
||||
ulong level = 0;
|
||||
ulong lvlXp = 0;
|
||||
int prestige = 0;
|
||||
int rod = 0;
|
||||
int BigBait = 0;
|
||||
int RareBait = 0;
|
||||
int SpecialBait = 0;
|
||||
@@ -350,132 +350,159 @@ namespace Kehyeedra3.Commands
|
||||
}
|
||||
|
||||
Fish fish;
|
||||
List<Fish> fishTiers;
|
||||
List<Fish> fishRarities = fishes.ToList();
|
||||
FishTier ftier;
|
||||
if (tierRoll > 60 && rod >= 3)
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
|
||||
ftier = FishTier.T4;
|
||||
}
|
||||
else if (tierRoll > 40 && rod >= 2)
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
|
||||
ftier = FishTier.T3;
|
||||
}
|
||||
else if (tierRoll > 20 && rod >= 1)
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
|
||||
ftier = FishTier.T2;
|
||||
}
|
||||
else
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
|
||||
ftier = FishTier.T1;
|
||||
}
|
||||
|
||||
if (rarity == 777 || (rarity > 2060 && rarity <= 2070) || rarity == 2777 || rarity > 2500 && rarity < 2510 && bRar ||rarity > 2510 && rarity < 2520 && bSpe)
|
||||
{
|
||||
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
int wRoll = SRandom.Next(0, 101);
|
||||
|
||||
switch (ftier)
|
||||
{
|
||||
case FishTier.T1:
|
||||
{
|
||||
xp = 10;
|
||||
}
|
||||
break;
|
||||
case FishTier.T2:
|
||||
{
|
||||
xp = 15;
|
||||
}
|
||||
break;
|
||||
case FishTier.T3:
|
||||
{
|
||||
xp = 20;
|
||||
}
|
||||
break;
|
||||
case FishTier.T4:
|
||||
{
|
||||
xp = 25;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (rarity == 777 || rarity == 2777)
|
||||
{
|
||||
xp = 77 + Convert.ToUInt64(77 * rod / 2);
|
||||
}
|
||||
|
||||
if (wRoll == 77 && bSpe)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 7777;
|
||||
}
|
||||
else if (rod >= 3 && tierRoll > 60)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 25;
|
||||
}
|
||||
else if (rod >= 2 && tierRoll > 40)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 20;
|
||||
}
|
||||
else if (rod >= 1 && tierRoll > 20)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 10;
|
||||
}
|
||||
if (rarity == 777 || rarity == 2777)
|
||||
{
|
||||
xp = 77+ Convert.ToUInt64(77*rod/2);
|
||||
}
|
||||
}
|
||||
else if (rarity > 1700)
|
||||
{
|
||||
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
switch (ftier)
|
||||
{
|
||||
case FishTier.T1:
|
||||
{
|
||||
xp = 10;
|
||||
}
|
||||
break;
|
||||
case FishTier.T2:
|
||||
{
|
||||
xp = 13;
|
||||
}
|
||||
break;
|
||||
case FishTier.T3:
|
||||
{
|
||||
xp = 16;
|
||||
}
|
||||
break;
|
||||
case FishTier.T4:
|
||||
{
|
||||
xp = 20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
rarity = SRandom.Next(1700, 2801);
|
||||
if (bRar || bSpe)
|
||||
{
|
||||
rarity += 200;
|
||||
}
|
||||
if (rod >= 3 && tierRoll > 60)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 20;
|
||||
}
|
||||
else if (rod >= 2 && tierRoll > 40)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 16;
|
||||
}
|
||||
else if (rod >= 1 && tierRoll > 20)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 10;
|
||||
}
|
||||
if (rarity > 2600)
|
||||
{
|
||||
if (rod >= 3 && tierRoll > 60)
|
||||
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
switch (ftier)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 35;
|
||||
case FishTier.T1:
|
||||
{
|
||||
xp = 20;
|
||||
}
|
||||
break;
|
||||
case FishTier.T2:
|
||||
{
|
||||
xp = 25;
|
||||
}
|
||||
break;
|
||||
case FishTier.T3:
|
||||
{
|
||||
xp = 30;
|
||||
}
|
||||
break;
|
||||
case FishTier.T4:
|
||||
{
|
||||
xp = 35;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (rod >= 2 && tierRoll > 40)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 30;
|
||||
}
|
||||
else if (rod >= 1 && tierRoll > 20)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 25;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 20;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rod >= 3 && tierRoll > 60)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 10;
|
||||
}
|
||||
else if (rod >= 2 && tierRoll > 40)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 8;
|
||||
}
|
||||
else if (rod >= 1 && tierRoll > 20)
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
|
||||
xp = 5;
|
||||
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
switch (ftier)
|
||||
{
|
||||
case FishTier.T1:
|
||||
{
|
||||
xp = 5;
|
||||
}
|
||||
break;
|
||||
case FishTier.T2:
|
||||
{
|
||||
xp = 7;
|
||||
}
|
||||
break;
|
||||
case FishTier.T3:
|
||||
{
|
||||
xp = 9;
|
||||
}
|
||||
break;
|
||||
case FishTier.T4:
|
||||
{
|
||||
xp = 11;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fish = fishRarities[SRandom.Next(fishRarities.Count)];
|
||||
|
||||
|
||||
FishSize size;
|
||||
|
||||
@@ -484,19 +511,19 @@ namespace Kehyeedra3.Commands
|
||||
weight = SRandom.Next(100, 2001) + Convert.ToInt32(level * 5 + (Convert.ToUInt64(prestige * 500)));
|
||||
}
|
||||
|
||||
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary)
|
||||
if (fish.Rarity == FishRarity.Legendary)
|
||||
{
|
||||
weight = SRandom.Next(2000 + Convert.ToInt32(level * 20), 40001 + prestige * 10000);
|
||||
}
|
||||
if (bBig)
|
||||
{
|
||||
weight += 1000;
|
||||
}
|
||||
if (fish.Rarity == FishRarity.Unreasonable)
|
||||
{
|
||||
weight = SRandom.Next(4000, 6000);
|
||||
}
|
||||
|
||||
if (bBig)
|
||||
{
|
||||
weight += 1000;
|
||||
}
|
||||
|
||||
|
||||
if (weight >= 1000)
|
||||
{
|
||||
@@ -513,7 +540,7 @@ namespace Kehyeedra3.Commands
|
||||
double w = Convert.ToDouble(weight);
|
||||
xp = Convert.ToUInt64(Math.Round(xp * w / 1000, 0, MidpointRounding.ToEven))*(ulong)dcatch;
|
||||
|
||||
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary)
|
||||
if (fish.Rarity == FishRarity.Legendary)
|
||||
{
|
||||
if (xp < 100)
|
||||
{
|
||||
@@ -901,39 +928,30 @@ namespace Kehyeedra3.Commands
|
||||
Dictionary<FishSpecies, int> large = new Dictionary<FishSpecies, int>();
|
||||
|
||||
List<Fish> fishes = Fishing.GetFishList();
|
||||
List<Fish> fishTiers = Fishing.GetFishList();
|
||||
|
||||
List<Fish> unrfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
|
||||
List<Fish> legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
List<Fish> rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
List<Fish> uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
List<Fish> comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
|
||||
if (tier > 1 && tier < 5)
|
||||
if (tier >= 1 && tier < 5)
|
||||
{
|
||||
switch (tier)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -944,6 +962,13 @@ namespace Kehyeedra3.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
List<Fish> unrfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
|
||||
|
||||
List<Fish> legfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
List<Fish> rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
List<Fish> uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
List<Fish> comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
|
||||
string unreasonable = "";
|
||||
string legendary = "";
|
||||
string rare = "";
|
||||
|
||||
@@ -436,7 +436,7 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -500))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -575,9 +575,14 @@ namespace Kehyeedra3.Commands
|
||||
Dictionary<FishSpecies, int[]> fishinv = new Dictionary<FishSpecies, int[]>();
|
||||
List<User.Item> itemlist = User.ListItems();
|
||||
List<Fish> fishes = Fishing.GetFishList();
|
||||
List<Fish> legfish = fishes.ToList();
|
||||
List<Fish> rarfish = fishes.ToList();
|
||||
List<Fish> uncfish = fishes.ToList();
|
||||
List<Fish> comfish = fishes.ToList();
|
||||
|
||||
User.Item item;
|
||||
Fish fish;
|
||||
List<Fish> fishTiers = fishes.ToList();
|
||||
|
||||
var fuser = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
@@ -653,7 +658,7 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -(count * item.Price)))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
user.SetGenInve(items);
|
||||
@@ -685,39 +690,36 @@ namespace Kehyeedra3.Commands
|
||||
var inp = await NextMessageAsync();
|
||||
int tier = int.Parse(inp.Content);
|
||||
|
||||
List<Fish> legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
List<Fish> rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
List<Fish> uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
List<Fish> comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
if (tier > 1 && tier < 5)
|
||||
|
||||
if (tier > 0 && tier < 5)
|
||||
{
|
||||
switch (tier)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList();
|
||||
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList();
|
||||
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList();
|
||||
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList();
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
legfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
|
||||
rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
}
|
||||
else if (tier < 1 || tier > 4)
|
||||
{
|
||||
@@ -820,90 +822,31 @@ namespace Kehyeedra3.Commands
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have that many.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
siz += 1;
|
||||
switch (fish.Rarity)
|
||||
{
|
||||
case FishRarity.Legendary:
|
||||
case FishRarity.Common:
|
||||
{
|
||||
value = 700;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Rare:
|
||||
{
|
||||
value = 6 * (int)(size+1);
|
||||
value = (int)fish.Tier * siz * 1;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Uncommon:
|
||||
{
|
||||
value = 2 * (int)(size+1);
|
||||
value = (int)fish.Tier * siz * 3;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Common:
|
||||
case FishRarity.Rare:
|
||||
{
|
||||
value = (int)(size+1);
|
||||
value = (int)fish.Tier * siz * 6;
|
||||
}
|
||||
break;
|
||||
case FishRarity.T2Legendary:
|
||||
case FishRarity.Legendary:
|
||||
{
|
||||
value = 750;
|
||||
}
|
||||
break;
|
||||
case FishRarity.T2Rare:
|
||||
{
|
||||
value = 12 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T2Uncommon:
|
||||
{
|
||||
value = 4 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T2Common:
|
||||
{
|
||||
value = 2 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T3Legendary:
|
||||
{
|
||||
value = 800;
|
||||
}
|
||||
break;
|
||||
case FishRarity.T3Rare:
|
||||
{
|
||||
value = 18 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T3Uncommon:
|
||||
{
|
||||
value = 6 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T3Common:
|
||||
{
|
||||
value = 3 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T4Legendary:
|
||||
{
|
||||
value = 850;
|
||||
}
|
||||
break;
|
||||
case FishRarity.T4Rare:
|
||||
{
|
||||
value = 32 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T4Uncommon:
|
||||
{
|
||||
value = 8 * (int)(size+1);
|
||||
}
|
||||
break;
|
||||
case FishRarity.T4Common:
|
||||
{
|
||||
value = 4 * (int)(size+1);
|
||||
value = (int)fish.Tier * 100 + 600;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
value *= amount;
|
||||
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou're about to sell **{amount} {fish.Name}** for **{((long)value).ToYeedraDisplay()}**.\nType 'ok' to confirm.");
|
||||
@@ -925,7 +868,7 @@ namespace Kehyeedra3.Commands
|
||||
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
await Database.SaveChangesAsync();
|
||||
@@ -937,7 +880,157 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :[");
|
||||
}
|
||||
}
|
||||
}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
else if (input == "bulksell")
|
||||
{
|
||||
int value = 0;
|
||||
int count = 0;
|
||||
|
||||
FishSize size;
|
||||
if (fuser.Inventory.Length < 3)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"Your inventory is empty. Try fishing more.");
|
||||
return;
|
||||
}
|
||||
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the tier.\n");
|
||||
var inp = await NextMessageAsync();
|
||||
int tier = int.Parse(inp.Content);
|
||||
|
||||
if (tier > 0 && tier < 5)
|
||||
{
|
||||
switch (tier)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
|
||||
uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
|
||||
comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
|
||||
}
|
||||
else if (tier < 1 || tier > 4)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nTier not available.");
|
||||
return;
|
||||
}
|
||||
foreach (var f in fishinv)
|
||||
{
|
||||
int[] amounts;
|
||||
if (!fishinv.TryGetValue(f.Key, out amounts))
|
||||
{
|
||||
amounts = new int[] { 0, 0, 0 };
|
||||
fishinv.Add(f.Key, amounts);
|
||||
}
|
||||
|
||||
|
||||
fish = fishes.FirstOrDefault(i => i.Id == f.Key);
|
||||
if (fish.Rarity != FishRarity.Legendary)
|
||||
{
|
||||
count += f.Value[0] + f.Value[1] + f.Value[2];
|
||||
|
||||
switch (fish.Rarity) //small
|
||||
{
|
||||
case FishRarity.Common:
|
||||
{
|
||||
value += (int)fish.Tier * 1 * 1;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Uncommon:
|
||||
{
|
||||
value += (int)fish.Tier * 1 * 3;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Rare:
|
||||
{
|
||||
value += (int)fish.Tier * 1 * 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
////
|
||||
switch (fish.Rarity) //med
|
||||
{
|
||||
case FishRarity.Common:
|
||||
{
|
||||
value += (int)fish.Tier * 2 * 1;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Uncommon:
|
||||
{
|
||||
value += (int)fish.Tier * 2 * 3;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Rare:
|
||||
{
|
||||
value += (int)fish.Tier * 2 * 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
////
|
||||
switch (fish.Rarity) //large
|
||||
{
|
||||
case FishRarity.Common:
|
||||
{
|
||||
value += (int)fish.Tier * 3 * 1;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Uncommon:
|
||||
{
|
||||
value += (int)fish.Tier * 3 * 3;
|
||||
}
|
||||
break;
|
||||
case FishRarity.Rare:
|
||||
{
|
||||
value += (int)fish.Tier * 3 * 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou're about to sell **{count} Fish** for **{((long)value).ToYeedraDisplay()}**.\nType 'ok' to confirm.");
|
||||
inp = await NextMessageAsync();
|
||||
if (inp.Content.ToLowerInvariant() == "ok")
|
||||
{
|
||||
|
||||
fuser.SetInventory(fishinv);
|
||||
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
|
||||
return;
|
||||
}
|
||||
await Database.SaveChangesAsync();
|
||||
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThanks, seaman, enjoy your moolah.");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :[");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user