Ejemplo n.º 1
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!");
        }
Ejemplo n.º 2
0
        public static void RunEventIntro()
        {
            foreach (var registeredClient in EventManager.GetRegisteredClients())
            {
                var story = BuildEventIntroStory();

                StoryManager.PlayStory(registeredClient, story);
            }

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

                    if (leaderboardItems.Count > 0)
                    {
                        var client = ClientManager.FindClient(leaderboardItems[0].Name);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 3);
                        }
                    }
                    if (leaderboardItems.Count > 1)
                    {
                        var client = ClientManager.FindClient(leaderboardItems[1].Name);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 2);
                        }
                    }
                    if (leaderboardItems.Count > 2)
                    {
                        var client = ClientManager.FindClient(leaderboardItems[2].Name);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 2);
                        }
                    }
                }

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

                    if (topOutlaws.Count > 0)
                    {
                        var client = ClientManager.FindClient(topOutlaws[0].CharacterName);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 10);
                        }
                    }
                    if (topOutlaws.Count > 1)
                    {
                        var client = ClientManager.FindClient(topOutlaws[1].CharacterName);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 5);
                        }
                    }
                    if (topOutlaws.Count > 2)
                    {
                        var client = ClientManager.FindClient(topOutlaws[2].CharacterName);
                        if (client != null)
                        {
                            client.Player.GiveItem(133, 3);
                        }
                    }
                }
            }
        }