public async Task View(CommandContext ctx, int ID) { var Issue = await ManageCharacter.GetAlls(new ManageCharacter.Suggestions() { Entry = ID }); if (Issue == null) { await ctx.RespondAsync("ID not found..."); return; } string Solved = "Not Added"; if (Issue.Done == ManageCharacter.Done.yes) { Solved = "Done"; } var Emmy = new DiscordEmbedBuilder() { Description = $"`{Issue.Title}`\n\n{Issue.Desc}" }; Emmy = Emmy.WithFooter("Issue #" + ID + $" [{Solved}]"); await ctx.RespondAsync(embed : Emmy); }
public async Task View(CommandContext ctx, int ID) { var count = await ManageCharacter.GetCountAsync(Tables.Issues); if (ID > count) { await ctx.RespondAsync("I don't have that many errors asshole-"); return; } var Issue = await ManageCharacter.GetAll(new ManageCharacter.Issues() { Entry = ID }); if (Issue == null) { await ctx.RespondAsync("ID not found..."); return; } string Solved = "Unsolved"; if (Issue.Solved == ManageCharacter.Solved.yes) { Solved = "Solved"; } var Emmy = new DiscordEmbedBuilder() { Description = $"`{Issue.Title}`\n\n{Issue.Desc}" }; Emmy = Emmy.WithFooter("Issue #" + ID + $" [{Solved}]"); await ctx.RespondAsync(embed : Emmy); }
public async Task HealAsync(CommandContext ctx, [RemainingText, Description("Target")] string target) { var Chr = await ManageCharacter.GetChrByName(target); if (Chr == null) { await ctx.RespondAsync("Does not exist."); return; } if (Chr.HPC > 0 && await Helpers.Owners.CheckAsync(ctx.User.Id)) { Chr.HPC = Chr.HPM; Chr.ENC = Chr.ENM; await ManageCharacter.UpdateAsync(Chr); await ctx.RespondAsync($"**{Chr.Name} has been healed**"); return; } else if (Chr.HPC < 1 && await Helpers.Owners.CheckAsync(ctx.User.Id)) { Chr.HPC = Chr.HPM; Chr.ENC = Chr.ENM; await ManageCharacter.UpdateAsync(Chr); await ctx.RespondAsync($"**{Chr.Name} has been healed**"); return; } else { await ctx.RespondAsync("You can't use this cmd"); } }
public async Task Suicide(CommandContext ctx) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); await ctx.RespondAsync($"**{Chr.Name}** *Kills themself*"); }
public async Task View(CommandContext ctx) { var count = await ManageCharacter.GetCountAsync(Tables.Suggest); Console.WriteLine(count); string Text = "`Suggestions`"; while (count > 0) { var IssueGet = new ManageCharacter.Suggestions() { Entry = count - 1 }; var Issue = await ManageCharacter.GetAlls(IssueGet); if (Issue != null) { string Solved = "Not Added"; if (Issue.Done == ManageCharacter.Done.yes) { Solved = "Done"; } Text += $"\n`→ [{Issue.Entry}] - {Issue.Title} - [{Solved}]`"; } count--; } var embed = new DiscordEmbedBuilder(); var inter = ctx.Client.GetInteractivity(); var pages = inter.GeneratePagesInEmbed(Text, SplitType.Line, embed); await inter.SendPaginatedMessageAsync(ctx.Channel, ctx.Member, pages); }
public async Task Solve(CommandContext ctx, int ID) { var Issue = await ManageCharacter.GetAlls(new ManageCharacter.Suggestions() { Entry = ID }); if (Issue == null) { await ctx.RespondAsync("ID not found..."); return; } Issue.Done = ManageCharacter.Done.yes; var Emmy = new DiscordEmbedBuilder() { Description = $"`[Done]{Issue.Title}`\n\n{Issue.Desc}" }; Emmy = Emmy.WithFooter("Suggestion #" + ID); await ctx.RespondAsync(embed : Emmy); await ManageCharacter.UpdateAsync(Suggest : Issue); await Task.Delay(1000 * 120); await ManageCharacter.RemoveAsync(Issue); }
public async Task InvCards(CommandContext ctx) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chrs = await ManageCharacter.GetAll(ChrGet); int i = 0; var sb = new StringBuilder(); sb.Append($"`{Chrs.Name}'s Cards:`"); while (i < await ManageCharacter.GetCountAsync(Tables.Character)) { var Card = new ManageCharacter.Card() { ChrEntry = Chrs.Entry, ChrCode = i }; var Cards = await ManageCharacter.GetAll(Card); if (Cards == null) { i++; } else { var Chr = await ManageCharacter.GetAll(Card); sb.Append($"`Amount[{Chr.ChrAmount}]` **→** **[__{Chr.ChrClass}__ - __{Chr.ChrName}__ - __{Chr.ChrRace}__]**\n"); i++; } } var embed = new DiscordEmbedBuilder(); var inter = ctx.Client.GetInteractivity(); var pages = inter.GeneratePagesInEmbed(sb.ToString(), SplitType.Line, embed); await inter.SendPaginatedMessageAsync(ctx.Channel, ctx.Member, pages); }
public async Task Kiss(CommandContext ctx, DiscordUser Target) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); Accg = new AccountGet() { UID = Target.Id, GID = ctx.Guild.Id }; Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("Target have no characters."); return; } OwnGet = new OwnerGet() { UID = Target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; Own = await ManageCharacter.GetAll(OwnGet); ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr2 = await ManageCharacter.GetAll(ChrGet); await ctx.RespondAsync($"**{Chr.Name}** *kisses* **{Chr2.Name}**"); }
public static async Task Heal(int Value, Chr Chr) { Chr.HPC += Value; if (Chr.HPC > Chr.HPM) { Chr.HPC = Chr.HPM; } await ManageCharacter.UpdateAsync(Chr); }
public static async Task Damage(int Value, Chr Chr) { Chr.HPC -= Value; if (Chr.HPC < 0) { Chr.HPC = Chr.HPM; } await ManageCharacter.UpdateAsync(Chr); }
public async Task HealAsync(CommandContext ctx, [Description("Target")] DiscordUser target = null) { target = target ?? ctx.User; var Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("Target has no characters."); return; } var OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); if (Chr.HPC > 0 && await Helpers.Owners.CheckAsync(ctx.User.Id)) { Chr.HPC = Chr.HPM; Chr.ENC = Chr.ENM; await ManageCharacter.UpdateAsync(Chr); await ctx.RespondAsync($"**{Chr.Name} has been healed**"); return; } else if (Chr.HPC < 1) { Chr.HPC = Chr.HPM; Chr.ENC = Chr.ENM; await ManageCharacter.UpdateAsync(Chr); await ctx.RespondAsync($"**{Chr.Name} has been healed**"); return; } else { await ctx.RespondAsync("You can't use this if you aren't dead. Ask an admin for help if needed."); } }
public async Task MagicAsync(CommandContext ctx, [RemainingText, Description("Target")] string target) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var Chr2 = await ManageCharacter.GetChrByName(target); if (Chr2 == null) { await ctx.RespondAsync("Does not exist."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Cdr = await Helpers.TimerChr.GetCooldown(Chr.Entry, ctx.Command.Name); if (Cdr != null) { await ctx.RespondAsync($"This is on cooldown, please wait {(Cdr.RemainingTime / 60).ToString() + " m " + (Cdr.RemainingTime - Convert.ToInt32(Cdr.RemainingTime / 60) * 60)} seconds please!"); return; } await Helpers.TimerChr.AddCooldown(Chr.Entry, ctx.Command.Name, 10); var emm = await Helpers.Attack.RollAsync(Chr, Chr2, FightOptions.Magic); await ctx.RespondAsync(embed : emm); }
public async Task Bless(CommandContext ctx, [RemainingText] string Target) { var target = ctx.User; var Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); if (Chr.SubClass != SubClasses.Priest) { await ctx.RespondAsync("You are not a priest"); return; } var TChr = await ManageCharacter.GetChrByName(Target); if (TChr == null) { await ctx.RespondAsync("Does not exist."); return; } var Amount = Chr.SubClassAttribute + Chr.MagicEff; await Helpers.Cast.Heal(Amount, TChr); await ctx.RespondAsync($"`{Chr.Name}` blesses `{TChr.Name}`, as they heal for `{Amount} HP`"); await Helpers.TimerChr.AddCooldown(Chr.Entry, ctx.Command.Name, 900); }
public async Task HealAsync(CommandContext ctx) { var target = ctx.User; var Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Cdr = await Helpers.TimerChr.GetCooldown(Chr.Entry, ctx.Command.Name); if (Cdr != null) { await ctx.RespondAsync($"This is on cooldown, please wait {(Cdr.RemainingTime / 60).ToString() + " m " + (Cdr.RemainingTime - Convert.ToInt32(Cdr.RemainingTime / 60) * 60)} seconds please!"); return; } await Helpers.TimerChr.AddCooldown(Chr.Entry, ctx.Command.Name, 1200); Chr.HPC = Chr.HPM; Chr.ENC = Chr.ENM; await ManageCharacter.UpdateAsync(Chr); await ctx.RespondAsync($"**{Chr.Name} has been healed**"); return; }
public async Task Getcooldowns(CommandContext ctx) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); string Cdrs = "**Cooldowns:**"; foreach (var ids in Helpers.TimerChr.Cooldowns.Keys) { // Only gets (int ID, string CMD) if (Chr.Entry == ids.ID) { Cdrs += $"\n`{ids.CMD}`: "; var Cdr = await Helpers.TimerChr.GetCooldown(Chr.Entry, ids.CMD); Cdrs += $"{(Cdr.RemainingTime / 60).ToString() + " m " + (Cdr.RemainingTime - Convert.ToInt32(Cdr.RemainingTime / 60) * 60)} seconds"; } } var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithAuthor(Chr.Name, null, Chr.Image); Embed = Embed.WithDescription(Cdrs); await ctx.RespondAsync(embed : Embed); }
public async Task SpeedAsync(CommandContext ctx) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var RollN = Helpers.Tools.RNG.Next(12) + 1; var Bonus = Chr.Speed; var TargetR = Helpers.Tools.RNG.Next(12) + 1 + Bonus / 2; var emmys = new DiscordEmbedBuilder(); emmys = emmys.WithAuthor($"{Chr.Name} rolls {RollN} + (speed){Bonus}\nvs\nTarget: {TargetR}"); if (RollN + Bonus > TargetR) { emmys = emmys.WithDescription("You've succeeded."); } else { emmys = emmys.WithDescription("You've failed."); } await ctx.RespondAsync(embed : emmys); }
public async Task SnapCount(CommandContext ctx, DiscordUser User = null) { User = User ?? ctx.User; var Accg = new AccountGet() { UID = User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync($"`{User.Username}` has no characters or an account."); return; } await ctx.RespondAsync($"`{User.Username}` has " + Check.Snaps + " <:snap:713788866687139913>'s"); }
public async Task ViewOther(CommandContext ctx, [RemainingText] string Name) { var Chr = await ManageCharacter.GetChrByName(Name); if (Chr == null) { await ctx.RespondAsync("No character by " + Name); return; } var Own = await ManageCharacter.GetOwnerByEntry(Chr.Entry); var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithDescription($"[`Card`] → [__{Chr.Class} - {Chr.Name} - {Chr.Race}__]"); Embed = Embed.WithImageUrl(Chr.Image); Embed = Embed.WithFooter(Chr.Desc); await ctx.RespondAsync(embed : Embed); }
public async Task ChannelAsync(CommandContext ctx, [Description("Channel")] DiscordChannel ch = null) { ch = ch ?? ctx.Channel; var CH = await ManageCharacter.GetChannel(ch.Id); if (CH == null) { await ctx.RespondAsync("That channel hasn't been added to our DB yet"); return; } string text = $"{ch.Mention}:\n**Category:** `{CH.Category}`"; if (CH.Category == ChannelCategory.Rp) { text += $"\n**Base-XP:** `{CH.XP}`"; } await ctx.RespondAsync(text); }
public async Task AddSnap(CommandContext ctx, DiscordUser user) { var Accg = new AccountGet() { UID = user.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("That person doesn't have an Account here."); return; } Check.Snaps += 1; await ManageCharacter.UpdateAsync(Account : Check); await ctx.RespondAsync($"`{user.Username}` has broken the bot, a <:snap:713788866687139913> has been added to their account."); }
public async Task SetChannelAsync(CommandContext ctx, [Description("Channel")] DiscordChannel ch = null) { ch = ch ?? ctx.Channel; async Task suicide(string why = "") { await ch.SendMessageAsync($"{why ?? ""} Stopping;"); }; var r = await Interactivity.WaitForAnswerAsync(ctx, $"**`What Category does this channel belong to?`**", channel : ctx.Channel); if (r == null) { await suicide(); return; } switch (r.Content.ToLower()) { case "rp": var sr = await Interactivity.WaitForAnswerINTAsync(ctx, $"**`What is the base XP gained from this channel?`**", channel : ctx.Channel); await ManageCharacter.InsertChannel(ch.Id, ChannelCategory.Rp, sr); await ctx.RespondAsync($"{ch.Mention} is now an `RP` channel;"); return; case "chat": await ManageCharacter.InsertChannel(ch.Id, ChannelCategory.Chat, 0); await ctx.RespondAsync($"{ch.Mention} is now an `Chat` channel;"); return; case "bot": await ManageCharacter.InsertChannel(ch.Id, ChannelCategory.Bot, 0); await ctx.RespondAsync($"{ch.Mention} is now an `Bot` channel;"); return; } }
public async Task Kiss(CommandContext ctx, [RemainingText] string Target) { var Accg = new AccountGet() { UID = ctx.User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = ctx.User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Chr2 = await ManageCharacter.GetChrByName(Target); if (Chr2 == null) { await ctx.RespondAsync("No character found by that name."); return; } await ctx.RespondAsync($"**{Chr.Name}** *kisses* **{Chr2.Name}**"); }
public async Task ViewSelf(CommandContext ctx) { var User = ctx.User; var Accg = new AccountGet() { UID = User.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync($"You don't own a character."); return; } var OwnGet = new OwnerGet() { UID = User.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithDescription($"[`Card`] → [__{Chr.Class} - {Chr.Name} - {Chr.Race}__]"); Embed = Embed.WithImageUrl(Chr.Image); Embed = Embed.WithFooter(Chr.Desc); await ctx.RespondAsync(embed : Embed); }
public async Task ViewAsync(CommandContext ctx, DiscordUser Target = null) { Target = Target ?? ctx.User; var Accg = new AccountGet() { UID = Target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync($"{Target.Mention} has no characters."); return; } var OwnGet = new OwnerGet() { UID = Target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithAuthor($"{Chr.Name}"); Embed = Embed.WithThumbnailUrl(Chr.Image); Embed = Embed.WithDescription($"{Chr.Balance} Enzea"); await ctx.RespondAsync(embed : Embed); }
public async Task Solve(CommandContext ctx, int ID) { var count = await ManageCharacter.GetCountAsync(Tables.Issues); if (ID > count) { await ctx.RespondAsync("I don't have that many errors asshole-"); return; } var Issue = await ManageCharacter.GetAll(new ManageCharacter.Issues() { Entry = ID }); if (Issue == null) { await ctx.RespondAsync("ID not found..."); return; } Issue.Solved = ManageCharacter.Solved.yes; var Emmy = new DiscordEmbedBuilder() { Description = $"`[Solved]{Issue.Title}`\n\n{Issue.Desc}" }; Emmy = Emmy.WithFooter("Issue #" + ID); await ctx.RespondAsync(embed : Emmy); await ManageCharacter.UpdateAsync(Issue : Issue); await Task.Delay(1000 * 120); await ManageCharacter.RemoveAsync(Issue); }
public async Task New(CommandContext ctx) { var Issue = new ManageCharacter.Suggestions(); var r = await Interactivity.WaitForAnswerAsync(ctx, $"**What is the title of this Suggestion? (Command name, event name or just what it is)**", channel : ctx.Channel); if (r == null) { return; } Issue.Title = r.Content; r = await Interactivity.WaitForAnswerAsync(ctx, $"**Describe the Suggestion**", channel : ctx.Channel); if (r == null) { return; } Issue.Desc = r.Content; var count = await ManageCharacter.GetCountAsync(Tables.Suggest); Issue.Entry = count; await ManageCharacter.InsertAsync(Suggest : Issue); await ctx.RespondAsync("New Suggestion added, see it with &Suggestion `" + count + "`"); }
public async Task WorkAsync(CommandContext ctx) { var Target = ctx.User; var Accg = new AccountGet() { UID = Target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync($"{Target.Mention} has no characters."); return; } var OwnGet = new OwnerGet() { UID = Target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Cdr = await Helpers.TimerChr.GetCooldown(Chr.Entry, "work"); if (Cdr != null) { await ctx.RespondAsync($"You have already worked, wait for {(Cdr.RemainingTime/60).ToString() + " m " + (Cdr.RemainingTime - Convert.ToInt32(Cdr.RemainingTime/60)*60)} seconds please!"); return; } var Amount = Helpers.Tools.RNG.Next(300); Chr.Balance += Amount; if (Amount < 1) { await ctx.RespondAsync("Sadly there where no jobs available- try again next time!"); } else if (Amount > 125) { var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithAuthor($"{Chr.Name} worked hard and got a magnificent amount of money!"); Embed = Embed.WithDescription($"{Amount} Enzea"); await ctx.RespondAsync(embed : Embed); } else { var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithAuthor($"{Chr.Name} worked and got some money!"); Embed = Embed.WithDescription($"{Amount} Enzea"); await ctx.RespondAsync(embed : Embed); } await ManageCharacter.UpdateAsync(Chr); await Helpers.TimerChr.AddCooldown(Chr.Entry, "work", 120); }
public async Task EnergyBall(CommandContext ctx, DiscordUser Target = null) { var target = ctx.User; var Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); if (Chr.SubClass != SubClasses.Wizard) { await ctx.RespondAsync("You are not a Wizard"); return; } target = Target ?? ctx.User; Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("no characters."); return; } OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; Own = await ManageCharacter.GetAll(OwnGet); ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var TChr = await ManageCharacter.GetAll(ChrGet); var Amount = Chr.SubClassAttribute + Chr.MagicEff; await Helpers.Cast.Damage(Amount *2, TChr); await ctx.RespondAsync($"`{Chr.Name}` fires an energy ball at `{TChr.Name}`, as they burn for `{Amount*2} HP`"); await Helpers.TimerChr.AddCooldown(Chr.Entry, ctx.Command.Name, 1900); }
public async Task Bless(CommandContext ctx, DiscordUser Target = null) { var target = ctx.User; var Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; var Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("You have no characters."); return; } var OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; var Own = await ManageCharacter.GetAll(OwnGet); var ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var Chr = await ManageCharacter.GetAll(ChrGet); var Cdr = await Helpers.TimerChr.GetCooldown(Chr.Entry, ctx.Command.Name); if (Cdr != null) { await ctx.RespondAsync($"This is on cooldown, please wait {(Cdr.RemainingTime / 60).ToString() + " m " + (Cdr.RemainingTime - Convert.ToInt32(Cdr.RemainingTime / 60) * 60)} seconds please!"); return; } if (Chr.SubClass != SubClasses.Priest) { await ctx.RespondAsync("You are not a priest"); return; } target = Target ?? ctx.User; Accg = new AccountGet() { UID = target.Id, GID = ctx.Guild.Id }; Check = await ManageCharacter.GetAll(Acc : Accg); if (Check == null) { await ctx.RespondAsync("no characters."); return; } OwnGet = new OwnerGet() { UID = target.Id, GID = ctx.Guild.Id, Slot = Check.Slot }; Own = await ManageCharacter.GetAll(OwnGet); ChrGet = new ChrGet() { Entry = Own.CharEntry, }; var TChr = await ManageCharacter.GetAll(ChrGet); var Amount = Chr.SubClassAttribute + Chr.MagicEff; await Helpers.Cast.Heal(Amount, TChr); await ctx.RespondAsync($"`{Chr.Name}` blesses `{TChr.Name}`, as they heal for `{Amount} HP`"); await Helpers.TimerChr.AddCooldown(Chr.Entry, ctx.Command.Name, 900); }
public static async Task <DiscordEmbed> RollAsync(Chr Author, Chr Target, FightOptions Option) { //Modifiers + Predefining. int Attribute = 0; bool Magic = false; int Dodge = Target.Dodge; switch (Option) { case FightOptions.Melee: Attribute += Author.Sleight; break; case FightOptions.Ranged: Attribute += Author.Marksman; break; case FightOptions.Magic: Attribute += Author.Magic; Magic = true; break; } //RNG Innit var AuthorRoll = Helpers.Tools.RNG.Next(12) + 1; var TargetRoll = Helpers.Tools.RNG.Next(12) + 1; //Roll Msg #1 string Roll = $"{Author.Name} rolls ({Option}) against {Target.Name}"; string RollInit = $"`({AuthorRoll} + {Attribute})` **vs** `({TargetRoll} + {Dodge})`"; //Switch Win/Loss var AuthorFull = AuthorRoll + Attribute; var TargetFull = TargetRoll + Dodge; string Situation = ""; int Visual = 0; int Damage = Author.Strenght + Helpers.Tools.RNG.Next(20) + 1; if (Magic == true) { Damage = Author.MagicEff + Helpers.Tools.RNG.Next(15) + 1; } if (Author.EffectPath != 0) { if (Author.EffectPath == EffectPath.boost) { Damage += Author.EffectAtribute; } if (Author.EffectPath == EffectPath.weaken) { Damage -= Author.EffectAtribute; } if (Damage < 0) { Damage = 0; } Author.EffectAtribute = 0; Author.EffectPath = 0; await ManageCharacter.UpdateAsync(Author); } if (AuthorFull == 0) { Situation = $"{Author.Name} didn't even get near {Target.Name}"; Visual += 10; Damage = 0; } else if (AuthorFull > TargetFull) { if (AuthorRoll == 12) { Damage += 5; } Situation = $"`{Author.Name}` **succesfully hitted** `{Target.Name}` **for** `{Damage}` **damage**"; Visual += 2; if (Magic == true) { if (Author.ENC < 10) { Situation = "You do not have enough stamina to use Magic Attacks."; Visual += 10; Damage = 0; } } } else if (AuthorFull == TargetFull) { Situation = $"{Author.Name} went on even grounds as {Target.Name}"; Visual += 10; Damage = 0; } else { Situation = $"{Author.Name} couldn't hit {Target.Name}"; Visual += 10; Damage = 0; } //Create Msg var Embed = new DiscordEmbedBuilder(); Embed = Embed.WithAuthor(Roll); Embed = Embed.WithDescription(RollInit + "\n\n" + Situation + "\n" + $"**{Target.Name}** has `{Target.HPC - Damage + "|" + Target.HPM} HP` left"); //CheckIfDamage if (Visual == 2) { Target.HPC -= Damage; if (Target.HPC < 1) { Target.HPC = 0; Embed = Embed.WithFooter($"{Target.Name} died."); } await ManageCharacter.UpdateAsync(Target); if (Magic == true) { Author.ENC -= 10; await ManageCharacter.UpdateAsync(Author); } } //End Return return(Embed); }