Beispiel #1
0
        public async Task AdminHelp()
        {
            if (Funcs.IsAdmin(Context.User))
            {
                JEmbed emb = new JEmbed();
                emb.Author.Name  = "Shenron Admin Commands";
                emb.ThumbnailUrl = Context.User.AvatarId;
                emb.ColorStripe  = Constants.Colours.SHENRON_GREEN;

                foreach (CommandInfo command in Bot.commands.Commands)
                {
                    if (command.Summary == null)
                    {
                        emb.Fields.Add(new JEmbedField(x =>
                        {
                            string header = "db!" + command.Name;
                            foreach (ParameterInfo parameter in command.Parameters)
                            {
                                header += " [" + parameter.Name + "]";
                            }
                            x.Header = header;
                            x.Text   = "";
                        }));
                    }
                }

                await Context.Channel.SendMessageAsync("", embed : emb.Build());
            }
        }
Beispiel #2
0
        public async Task Help()
        {
            JEmbed emb = new JEmbed();

            emb.Author.Name  = "Shenron Commands";
            emb.ThumbnailUrl = Context.User.AvatarId;
            emb.ColorStripe  = Constants.Colours.SHENRON_GREEN;

            foreach (CommandInfo command in Bot.commands.Commands)
            {
                emb.Fields.Add(new JEmbedField(x =>
                {
                    string header = "db!" + command.Name;
                    foreach (ParameterInfo parameter in command.Parameters)
                    {
                        header += " [" + parameter.Name + "]";
                    }
                    x.Header = header;
                    x.Text   = command.Summary;
                }));
            }

            await Context.User.SendMessageAsync("", embed : emb.Build());

            await Context.Channel.SendMessageAsync("Commands have been sent to you privately!");
        }
Beispiel #3
0
        public async Task Scouter(IUser user)
        {
            var JEmb = new JEmbed();

            JEmb.Author.Name = $"{user.Username}'s Power Level";
            JEmb.ColorStripe = Funcs.GetColour(user, Context.Guild);
            JEmb.Description = Convert.ToString(DBFuncs.GetPowerLVL(user));

            await Context.Channel.SendMessageAsync("", embed : JEmb.Build());
        }
Beispiel #4
0
        public async Task Status(IUser user)
        {
            JEmbed JEmb   = new JEmbed();
            DBUser dbUser = DBFuncs.FindDBUser(user);

            JEmb.Author.Name = $"{user.Username}'s Status";
            JEmb.ColorStripe = Funcs.GetColour(user, Context.Guild);
            JEmb.Description = "Health: " + dbUser.Health + "/" + dbUser.MaxHealth;

            await Context.Channel.SendMessageAsync("", embed : JEmb.Build());
        }
Beispiel #5
0
        public static Embed Dialogue(DBNPC npc, string dialogue)
        {
            JEmbed JEmb = new JEmbed();

            //JEmb.ThumbnailUrl = $@"DragonBall\Images\{npc.Name}.jpg";
            JEmb.ThumbnailUrl = "https://hdwallsbox.com/wallpapers/l/1280x720/61/dragon-ball-z-master-roshi-1280x720-60215.jpg";
            JEmb.Author.Name  = npc.Name;
            JEmb.Description  = dialogue;
            JEmb.ColorStripe  = Constants.Colours.SHENRON_GREEN;

            return(JEmb.Build());
        }
Beispiel #6
0
        public async Task Purge(int amount)
        {
            var messages = await Context.Channel.GetMessagesAsync(amount + 1).Flatten();

            await Context.Channel.DeleteMessagesAsync(messages);

            JEmbed embed = new JEmbed()
            {
                Title       = "Messages deleted.",
                Description = $"{amount} messages deleted.",
                ColorStripe = Constants.Colours.SHENRON_GREEN
            };
            var emb = embed.Build();
            var msg = await Context.Channel.SendMessageAsync("", embed : emb);

            Thread.Sleep(2000);
            await msg.DeleteAsync();
        }
Beispiel #7
0
        public async Task Profile(IUser user)
        {
            if (DBFuncs.PlayerRegistered(user))
            {
                var emb = new JEmbed()
                {
                    ThumbnailUrl = user.GetAvatarUrl(),
                    ColorStripe  = Funcs.GetColour(user, Context.Guild)
                };
                emb.Fields.Add(new JEmbedField(x =>
                {
                    x.Header = "Race";
                    x.Text   = DBFuncs.GetAttribute("RACE", user);
                }));

                emb.Fields.Add(new JEmbedField(x =>
                {
                    x.Header = "Level";
                    x.Text   = DBFuncs.GetAttribute("LEVEL", user);
                    x.Inline = true;
                }));

                emb.Fields.Add(new JEmbedField(x =>
                {
                    x.Header = "EXP";
                    x.Text   = DBFuncs.GetAttribute("EXP", user) + "/" + Convert.ToString(Math.Pow(Convert.ToInt32(DBFuncs.GetAttribute("LEVEL", user)), 2) + 10);
                    x.Inline = true;
                }));

                emb.Author.Name = user.Username + "'s Profile";

                var embed = emb.Build();
                await Context.Channel.SendMessageAsync("", embed : embed);
            }
            else
            {
                await Context.Channel.SendMessageAsync("Player in not registered");
            }
        }
Beispiel #8
0
        public async Task Train()
        {
            List <DBNPC>  inLocation = new List <DBNPC>();
            List <DBUser> here       = new List <DBUser>();

            foreach (DBNPC npc in NPCList.NPCs)
            {
                if (Context.Channel.Id == npc.Location)
                {
                    inLocation.Add(npc);
                }
            }

            foreach (DBUser user in Bot.sess.Players)
            {
                string location = DBFuncs.GetAttribute("LOCATION", user.User);
                if (location != "null")
                {
                    if (Context.Channel.Id == Convert.ToUInt64(location) && user.User.Id != Context.User.Id)
                    {
                        here.Add(user);
                    }
                }
            }

            var JEmb = new JEmbed();

            JEmb.Description = "People in area:";

            if (inLocation.Count > 0 || here.Count > 0)
            {
                foreach (DBNPC npc in inLocation)
                {
                    JEmb.Fields.Add(new JEmbedField(x =>
                    {
                        x.Header = npc.Name + " [NPC]";
                        x.Text   = $"Power Level: ~{npc.Power_Level}";
                    }));
                }

                foreach (DBUser user in here)
                {
                    JEmb.Fields.Add(new JEmbedField(x =>
                    {
                        x.Header = user.User.Username + " [PLAYER]";
                        x.Text   = $"Power Level: ~{DBFuncs.GetPowerLVL(user.User)}";
                    }));
                }

                JEmb.ColorStripe = Funcs.GetColour(Context.User, Context.Guild);
                JEmb.Footer.Text = "Type 'db!train [name]' to request to train with them!";
            }
            else
            {
                JEmb.Fields.Add(new JEmbedField(x =>
                {
                    x.Header = "None";
                    x.Text   = "There seems to be no one here.. Check another area.";
                }));
            }

            await Context.Channel.SendMessageAsync("", embed : JEmb.Build());
        }
Beispiel #9
0
        public async Task Train(string npcChoice)
        {
            bool npcfound = false;

            foreach (DBNPC npc in NPCList.NPCs)
            {
                if (Context.Channel.Id == npc.Location)
                {
                    if (npc.Name.ToLower().Contains(npcChoice.ToLower()))
                    {
                        npcfound = true;
                        JEmbed JEmb = new JEmbed();
                        JEmb.ThumbnailUrl = $@"DragonBall\Images\{npc.Name}.jpg";
                        JEmb.Author.Name  = npc.Name;
                        JEmb.Description  = npc.Dialogue;

                        JEmb.Fields.Add(new JEmbedField(x =>
                        {
                            x.Header = "Race:";
                            x.Text   = $"{npc.Race}";
                            x.Inline = true;
                        }));

                        JEmb.Fields.Add(new JEmbedField(x =>
                        {
                            x.Header = "Power Level:";
                            x.Text   = $"~{npc.Power_Level}";
                            x.Inline = true;
                        }));

                        string name = npc.Name;
                        if (npc.Name.Contains(" "))
                        {
                            name = $"\"{npc.Name}\"";
                        }

                        JEmb.Fields.Add(new JEmbedField(x =>
                        {
                            x.Header = $"db!train {name} 1";
                            x.Text   = "Train me!";
                        }));

                        JEmb.Fields.Add(new JEmbedField(x =>
                        {
                            x.Header = $"db!train {name} 2";
                            x.Text   = "Nevermind.";
                        }));

                        JEmb.ColorStripe = Funcs.GetColour(Context.User, Context.Guild);

                        await Context.Channel.SendMessageAsync("", embed : JEmb.Build());

                        break;
                    }
                }
            }
            if (!npcfound)
            {
                await Context.Channel.SendMessageAsync($"Cannot find NPC with name {npcChoice}.");
            }
        }
Beispiel #10
0
        public async Task Wish(string wish, IUser user)
        {
            if (DBFuncs.FindDBUser(user).BallCount() == 7)
            {
                if (wish == "list")
                {
                    JEmbed jemb = new JEmbed();
                    jemb.Author.Name    = "Wish List";
                    jemb.Author.IconUrl = Bot.client.CurrentUser.GetAvatarUrl();
                    jemb.ColorStripe    = Constants.Colours.SHENRON_GREEN;

                    int counter = 1;
                    foreach (string item in File.ReadAllLines(@"Files\wishes.txt"))
                    {
                        jemb.Fields.Add(new JEmbedField(x =>
                        {
                            x.Header = $"[{counter}]";
                            x.Text   = item;
                        }));
                        counter++;
                    }

                    await Context.Channel.SendMessageAsync("", embed : jemb.Build());
                }
                else if (wish == "1")
                {
                    int currentLVL = Convert.ToInt32(DBFuncs.GetAttribute("LEVEL", user));
                    int newLVL     = currentLVL + 10;
                    DBFuncs.SetAttribute("LEVEL", user, Convert.ToString(newLVL));

                    await Context.Channel.SendMessageAsync($"Your wish has been granted... {user.Username}! You are now level {newLVL}.");
                }
                else if (wish == "2")
                {
                }                        //increase currency
                else if (wish == "3")
                {
                }                        //give skill
                else if (wish == "4")
                {
                }                        //custom
                else
                {
                    await Context.Channel.SendMessageAsync($"Wish '{wish}' does not exist. Refer to the wish by it's ID number."); return;
                }

                for (int i = 0; i < 7; i++)
                {
                    if (Bot.sess.Balls[i].Location == null && Bot.sess.Balls[i].Held == false)
                    {
                        var dbUser = DBFuncs.FindDBUser(Context.User);
                        dbUser.heldBalls.Clear();
                        Bot.sess.Balls[i].Holder = null;
                        Bot.sess.Balls[i].Held   = false;
                        Bot.sess.End();
                    }
                }
            }
            else
            {
                await Context.Channel.SendMessageAsync("Shenron cannot be summoned without all seven **Dragon Balls**!");
            }
        }