Example #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);
            }
        }
Example #2
0
        public static async Task <(Dynasty dan, DynastyMember membership)> GetDynasty(Player player)
        {
            (Dynasty dan, DynastyMember membership, string error) = await Dynasty.Load(player);

            if (error != null)
            {
                throw NeitsilliaError.ReplyError(error);
            }
            return(dan, membership);
        }