示例#1
0
        public async Task CreateDynasty([Remainder] string dynastyName)
        {
            Context.WIPCheck();

            if (Dynasty.Exist(dynastyName))
            {
                await ReplyAsync($"Dyansty name {dynastyName} is already in use");

                return;
            }

            StringM.RegexName(dynastyName, 5);

            Player player = Context.Player;

            if (player.userid != 201875246091993088 && player.level < 20)
            {
                await ReplyAsync("Character must be minimum level 20 to create a Dynasty.");

                return;
            }

            await Dynasty.Load(player);

            if (player.dynasty != null)
            {
                await ReplyAsync("You are already in a dynasty");
            }
            else
            {
                await player.NewUI(await ReplyAsync(
                                       $"Form the {dynastyName} Dynasty for {Dynasty.DYNASTY_COST} Kutsyei Coins?"),
                                   MsgType.DynastyUpgrade, dynastyName);
            }
        }
示例#2
0
        public async Task DynastyEdit(string field, [Remainder] string value)
        {
            Player player = Context.Player;

            (Dynasty dan, DynastyMember _) = await GetDynasty(player);

            switch (field?.ToLower())
            {
            case "desc":
            case "description":
                if (value.Length > 240)
                {
                    await ReplyAsync("Description may not be longer than 240 characters");

                    return;
                }
                dan.description = value;
                await dan.Save();

                break;

            case "message":
                if (value.Length > 120)
                {
                    await ReplyAsync("Description may not be longer than 120 characters");

                    return;
                }
                dan.messageOfTheDay = value;
                await dan.Save();

                break;

            case "name":
                if (Dynasty.Exist(value))
                {
                    await ReplyAsync($"Dyansty name {value} is already in use");

                    return;
                }
                StringM.RegexName(value, 5);
                dan.name = value;
                await dan.Save();

                break;
            }
        }