Ejemplo n.º 1
0
        private static EmbedBuilder ListItems(Player player, int page, NPC n)
        {
            List <string> itemList = new List <string>();
            string        current  = null;

            for (int i = ((page - 1) * 15); i < n.inventory.Count && i < (page * 15); i++)
            {
                StackedItems inst = n.inventory.inv[i];
                current += $"{i + 1}|{inst} {EUI.ItemType(inst.item.type)}{inst.item.CompareTo(player.equipment)}| " +
                           $"{GetPrice(inst.item.GetValue(), n.stats.PriceMod(), player.stats.PriceMod(), -1)}" +
                           $"Kuts" + Environment.NewLine;

                if (current.Length > 1000)
                {
                    itemList.Add(current);
                    current = null;
                }
            }

            itemList.Add(current);

            EmbedBuilder embed = new EmbedBuilder();

            embed.WithTitle($"{n.name}'s Inventory");
            embed.Fields = itemList.Select(s => DUtils.NewField("Items", s)).ToList();
            return(embed);
        }