Пример #1
0
        public static void AppendOutlawEventIntro(StoryBuilderSegment segment)
        {
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Next, lets see who the top outlaws are this week!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "The top outlaw will receive 10 Arcade tokens.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Second place will receive 5 Arcade Tokens.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Third will receive 3 Arcade Tokens.");

            using (var databaseConnection = new DatabaseConnection(DatabaseID.Players))
            {
                var topOutlaws = PlayerDataManager.GetTopOutlaws(databaseConnection.Database).OrderByDescending(x => x.Points).Take(3).ToList();

                if (topOutlaws.Count > 0)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"The top outlaw this week is {topOutlaws[0].CharacterName} with {topOutlaws[0].Points} OP!");
                }
                if (topOutlaws.Count > 1)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"In second place is {topOutlaws[1].CharacterName} with {topOutlaws[1].Points} OP!");
                }
                if (topOutlaws.Count > 2)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"Lastly, in third place is {topOutlaws[2].CharacterName} with {topOutlaws[2].Points} OP!");
                }
            }
        }
Пример #2
0
        public static void AppendLeaderboardEventIntro(StoryBuilderSegment segment)
        {
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Lets start the first portion of the Gala...");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "We'll be checking the leaderboards and handing out prizes.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "First place in each category will receive 3 Arcade Tokens.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Second will receive 2 Arcade Tokens.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Third will receive 1 Arcade Token.");

            foreach (var leaderboard in LeaderBoardManager.ListLeaderboards())
            {
                var leaderboardItems = leaderboard.Load().OrderByDescending(x => x.Value).ToList();

                StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"In the {leaderboard.Name} category...");

                if (leaderboardItems.Count > 0)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"First place goes to {leaderboardItems[0].Name}!");
                }
                if (leaderboardItems.Count > 1)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"Second place goes to {leaderboardItems[1].Name}!");
                }
                if (leaderboardItems.Count > 2)
                {
                    StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"Third place goes to {leaderboardItems[2].Name}!");
                }
            }

            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "That's every category!");
        }
Пример #3
0
        public static void StartEvent()
        {
            if (ActiveEvent == null)
            {
                return;
            }

            foreach (var registeredClient in EventManager.GetRegisteredClients())
            {
                Story story = new Story(Guid.NewGuid().ToString());
                StoryBuilderSegment segment = StoryBuilder.BuildStory();
                StoryBuilder.AppendSaySegment(segment, $"This event is... {ActiveEvent.Name}!", -1, 0, 0);
                StoryBuilder.AppendSaySegment(segment, ActiveEvent.IntroductionMessage, -1, 0, 0);

                foreach (var rule in ActiveEvent.Rules)
                {
                    StoryBuilder.AppendSaySegment(segment, rule, -1, 0, 0);
                }

                if (ActiveEvent.Duration.HasValue)
                {
                    StoryBuilder.AppendSaySegment(segment, $"The event will end in {ActiveEvent.Duration.Value.TotalMinutes} minutes.", -1, 0, 0);
                }
                if (Main.IsTestingEvent)
                {
                    StoryBuilder.AppendSaySegment(segment, $"This event is currently being tested and winners will not receive any prizes.", -1, 0, 0);
                }
                else if (!string.IsNullOrEmpty(ActiveEvent.RewardMessage))
                {
                    StoryBuilder.AppendSaySegment(segment, ActiveEvent.RewardMessage, -1, 0, 0);
                }

                StoryBuilder.AppendSaySegment(segment, "The event has now begun!", -1, 0, 0);
                segment.AppendToStory(story);
                StoryManager.PlayStory(registeredClient, story);
            }

            ActiveEvent.Start();

            var eventStartMessage = new StringBuilder();

            if (Main.IsTestingEvent)
            {
                eventStartMessage.Append("[Testing] ");
            }
            eventStartMessage.Append($"{ActiveEvent.Name} has started!");

            Task.Run(() => DiscordManager.Instance.SendAnnouncement(eventStartMessage.ToString()));
            Messenger.SendAnnouncement("Weekly Event", eventStartMessage.ToString());

            if (ActiveEvent.Duration.HasValue)
            {
                var endTime = DateTime.UtcNow.Add(ActiveEvent.Duration.Value);

                SetGlobalCountdown(new Countdown("The event ends in...", endTime));
                TimedEventManager.CreateTimer("endevent", endTime, null);
            }
        }
Пример #4
0
        public void AppendAttackSayStory(StoryBuilderSegment segment)
        {
            Stories.StoryBuilder.AppendSaySegment(segment, this.Name.Trim() + ": " + this.AttackSay.Trim(), this.Species, 0, 0);

            if (!string.IsNullOrEmpty(this.AttackSay2))
            {
                Stories.StoryBuilder.AppendSaySegment(segment, this.Name.Trim() + ": " + this.AttackSay2.Trim(), this.Species, 0, 0);
            }

            if (!string.IsNullOrEmpty(this.AttackSay3))
            {
                Stories.StoryBuilder.AppendSaySegment(segment, this.Name.Trim() + ": " + this.AttackSay3.Trim(), this.Species, 0, 0);
            }
        }
Пример #5
0
        public static void EndEvent()
        {
            ActiveEvent.End();
            Task.Run(() => DiscordManager.Instance.SendAnnouncement($"{ActiveEvent.Name} has finished!"));
            Messenger.GlobalMsg($"{ActiveEvent.Name} has finished!", Text.BrightGreen);

            foreach (var registeredClient in EventManager.GetRegisteredClients())
            {
                ActiveEvent.DeconfigurePlayer(registeredClient);

                Story story = new Story(Guid.NewGuid().ToString());
                StoryBuilderSegment segment = StoryBuilder.BuildStory();
                StoryBuilder.AppendSaySegment(segment, $"The event is now finished!", -1, 0, 0);
                StoryBuilder.AppendSaySegment(segment, $"Please wait as a winner is announced...", -1, 0, 0);
                segment.AppendToStory(story);
                StoryManager.PlayStory(registeredClient, story);
            }
        }
Пример #6
0
        public static Story BuildEventIntroForSpring()
        {
            Story story = new Story(Guid.NewGuid().ToString());
            StoryBuilderSegment segment = StoryBuilder.BuildStory();

            StoryBuilder.AppendCreateFNPCAction(segment, "0", "s153", 24, 6, 169, name: "Eventful", direction: Enums.Direction.Down, isShiny: true);
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Greetings!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Welcome to our Weekly Gala!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "The Gala has three parts.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "For the first part, I will be handing out Arcade Tokens for the leaderboard.");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Then, I will be giving out Arcade Tokens for the top outlaws!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, "Finally, we will be having our weekly event!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"The event this week will be {ActiveEvent.Name}.");

            AppendLeaderboardEventIntro(segment);
            AppendOutlawEventIntro(segment);

            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"Time for the event!");
            StoryBuilder.AppendSpeechBubbleSegment(segment, 0, $"Enjoy {ActiveEvent.Name}!");

            segment.AppendToStory(story);

            return(story);
        }
Пример #7
0
        public static Story CreateIntroStory(Client client)
        {
            Story story = new Story();

            StoryBuilderSegment segment = new StoryBuilderSegment();

            Pokemon eevee  = Pokedex.FindByName("Eevee");
            string  map1ID = Main.Crossroads;

            StoryBuilder.AppendMapVisibilityAction(segment, false);
            StoryBuilder.AppendPlayerPadlockAction(segment, "Lock");
            StoryBuilder.AppendWarpAction(segment, map1ID, 25, 25);
            StoryBuilder.AppendPlayMusicAction(segment, "PMD2) Strange Happenings.mp3", true, true);
            StoryBuilder.AppendSaySegment(segment, "You step into the light of the crystal...", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "You feel its energy going through your body...", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Dizzy... are you moving?", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "You feel a cool breeze... maybe, just maybe...", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "You slowly open your eyes...", -1, 0, 0);
            StoryBuilder.AppendPauseAction(segment, 1000);
            StoryBuilder.AppendPlayMusicAction(segment, "%mapmusic%", true, true);
            StoryBuilder.AppendSaySegment(segment, "Hey! You!", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Are you okay?", -1, 0, 0);
            StoryBuilder.AppendCreateFNPCAction(segment, "0", map1ID, 25, 23, eevee.ID);
            StoryBuilder.AppendChangeFNPCDirAction(segment, "0", Server.Enums.Direction.Down);
            StoryBuilder.AppendMapVisibilityAction(segment, true);
            StoryBuilder.AppendSaySegment(segment, "Oh, good! You're awake!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "You've been laying there for a while now. Are you okay? Are you hurt?", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(An eevee is talking to me...)", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Oh, well. The important thing is that you are awake now!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "So, where are you from? I haven't seen you in these parts before.", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Hmm... Where am I from? I don't remember a thing)", -1, 0, 0);
            StoryBuilder.AppendPauseAction(segment, 1000);
            StoryBuilder.AppendSaySegment(segment, "Oh, you don't remember? Strange. Anyway, you're probably wondering who I am...", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "...I am the great Eevocious! Master of evolutions and battle!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Eevocious, huh... what an odd name. But, alright. Eevocious it is.)", -1, 0, 0);
            StoryBuilder.AppendPauseAction(segment, 2000);
            StoryBuilder.AppendSaySegment(segment, "...I bet I fooled you, didn't I.", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "And you actually thought I was Eevocious!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Yeah, I'm sorry. It's just hard to resist. A new Pokemon just appearing out of no where gives me a chance to be whomever I want to be!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Very funny)", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Anyway, my real name is Eevee. I'm an explorer. Or, I want to become an explorer. See...", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "I can't become a true explorer until I prove that I am capable of handling the toughest situations. That's why I'm training to be able to get through Tiny Grotto!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Tiny Grotto?)", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "You're probably wondering what Tiny Grotto even is! I'll explain.", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "It's a dungeon. It's not the hardest dungeon, but it's good practice. Yup, so I'm going to Tiny Grotto!", eevee.ID, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Oh look, Eevee is leaving me.)", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "Bye~!", eevee.ID, 0, 0);
            StoryBuilder.AppendMoveFNPCAction(segment, "0", 1, 24, Server.Enums.Speed.Walking, true);
            StoryBuilder.AppendDeleteFNPCAction(segment, "0");
            StoryBuilder.AppendSaySegment(segment, "(Now what do I do next? I know I can't go to Tiny Grotto... I don't even know how to battle!)", -1, 0, 0);
            StoryBuilder.AppendSaySegment(segment, "(Maybe I'll find out more if I continue going North (^))", -1, 0, 0);
            StoryBuilder.AppendPlayerPadlockAction(segment, "Unlock");

            if (client.Player.Veteran)
            {
                StoryBuilder.AppendPlayerPadlockAction(segment, "Lock");
                StoryBuilder.AppendPauseAction(segment, 2000);
                StoryBuilder.AppendSaySegment(segment, "PMU Staff: You weren't expecting all this, now were you?", -1, 0, 0);
                StoryBuilder.AppendSaySegment(segment, "PMU Staff: Have fun exploring!", -1, 0, 0);
                StoryBuilder.AppendPlayerPadlockAction(segment, "Unlock");
            }
            #region old
            //StoryBuilder.AppendMapVisibilityAction(segment, false);
            //StoryBuilder.AppendSaySegment(segment, "Hey! You!", -1, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "Are you okay?", -1, 0, 0);
            //StoryBuilder.AppendCreateFNPCAction(segment, "0", map1ID, 10, 6, eevee.Sprite);
            //StoryBuilder.AppendMapVisibilityAction(segment, true);
            //StoryBuilder.AppendSaySegment(segment, "Oh, good! You're awake!", eevee.Mugshot, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "You've been laying there for a while now. Are you okay? Are you hurt?", eevee.Mugshot, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "(An eevee is talking to me...)", -1, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "You're probably wondering what Tiny Woods even is! I'll explain.", eevee.Mugshot , 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "It's a dungeon. It's not the hardest dungeon, but it's good practice. Yup, so I'm going to Tiny Woods!", eevee.Mugshot, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "(Oh look, Eevee is leaving me. Fun.", -1, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "Bye~!", eevee.Mugshot , 0, 0);
            //StoryBuilder.AppendMoveFNPCAction(segment, "0", 0, 7, Server.Enums.Speed.Walking, true);
            //StoryBuilder.AppendDeleteFNPCAction(segment, "0");
            //StoryBuilder.AppendSaySegment(segment, "(Now what do I do next? I know I can't go to Tiny Woods... I don't even know how to battle!", -1, 0, 0);
            //StoryBuilder.AppendSaySegment(segment, "(Maybe I'll find out more if I continue going North (^))", -1, 0, 0);
            //StoryBuilder.AppendPlayerPadlockAction(segment, "Unlock");
            #endregion

            segment.AppendToStory(story);
            return(story);
        }