Ejemplo n.º 1
0
        public async Task UsingItem(int index, IGuildUser taggedUser = null, int optional = 0)
        {
            if (!GlobalVar.CanUseItem)
            {
                return;
            }
            if (UserAccounts.CheckHaveThisDebuff(UserAccounts.GetUserAccount(Context.User), "Panic"))
            {
                await Context.Channel.SendMessageAsync($"Cant use item in panic {Context.User.Mention}");

                return;
            }
            if (UserAccounts.IsDead(Context.User))
            {
                return;
            }
            if (!IsHavingThisRole((SocketGuildUser)Context.User, "Survivor"))
            {
                return;
            }
            GlobalVar.GuildSelect   = Context.Guild;
            GlobalVar.ChannelSelect = (SocketTextChannel)Context.Channel;
            if (taggedUser != null)
            {
                var target = UserAccounts.GetUserAccount((SocketUser)taggedUser);
                await Inventories.UseActiveItem(Context.User, index, target, optional);
            }
            else
            {
                await Inventories.UseActiveItem(Context.User, index, null, optional);
            }
        }