Ejemplo n.º 1
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());
        }
Ejemplo n.º 2
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());
        }
Ejemplo n.º 3
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");
            }
        }
Ejemplo n.º 4
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());
        }
Ejemplo n.º 5
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}.");
            }
        }