Пример #1
0
        /* This is our callback hook that will be called when the player clicks
         * on any button in the quest offer dialog. We check if he accepts or
         * declines here...
         */

        private static void CheckPlayerAbortQuest(GamePlayer player, byte response)
        {
            MarlinsSalesPitch quest = player.IsDoingQuest(typeof(MarlinsSalesPitch)) as MarlinsSalesPitch;

            if (quest == null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendSystemMessage(player, "Good, now go out there and finish your work!");
            }
            else
            {
                SendSystemMessage(player, "Aborting Quest " + questTitle + ". You can start over again if you want.");
                quest.AbortQuest();
            }
        }
Пример #2
0
        /* This is the method we declared as callback for the hooks we set to
         * Sir Quait. It will be called whenever a player right clicks on Sir Quait
         * or when he whispers something to him.
         */

        protected static void TalkToMarlinThuler(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (marlinThuler.CanGiveQuest(typeof(MarlinsSalesPitch), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            MarlinsSalesPitch quest = player.IsDoingQuest(typeof(MarlinsSalesPitch)) as MarlinsSalesPitch;

            marlinThuler.TurnTo(player);
            //Did the player rightclick on marlinThuler?
            if (e == GameObjectEvent.Interact)
            {
                //We check if the player is already doing the quest
                if (quest != null)
                {
                    if (quest.Step == 1)
                    {
                        marlinThuler.SayTo(player, "I'm glad to hear you're willing to answer your realm's call for help. Albion will remember your service. The local bandit leader is a fellow by the name of [Mostram].");
                    }
                    else if (quest.Step == 3)
                    {
                        marlinThuler.SayTo(player, "Welcome back, " + player.Name + ". Word travels quickly in these parts, and I have heard of your success. Some of the bandits have even started to retreat to their camps in the northeast. You've [done well].");
                    }
                }
                else
                {
                    //Player hasn't the quest:
                    marlinThuler.SayTo(player, "Oh woe is me! I have no idea how I can possibly hope to go on with [business] now? Please, you must help me!");
                    return;
                }
            }
            // The player whispered to Sir Jerem (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                //We also check if the player is already doing the quest
                if (quest == null)
                {
                    switch (wArgs.Text)
                    {
                    case "business":
                        marlinThuler.SayTo(player, "Those tomb raider scoundrels have stolen my favorite drum again. I use it to demonstrate the wondrous sound my instruments can produce! Never has a customer heard that beautiful sound and failed to buy something from me. Without that drum, I'm ruined! Will you get my [drum] back for me? I will reward you handsomely, I swear it.");
                        break;

                    case "drum":
                        player.Out.SendQuestSubscribeCommand(marlinThuler, QuestMgr.GetIDForQuestType(typeof(MarlinsSalesPitch)), "Will you help Marlin retrieve his lost drum? [Levels 17-20]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;

                    case "Mostram":
                        if (quest.Step == 1)
                        {
                            marlinThuler.SayTo(player, "From what we've been able to find out, Mostram works from the fields south of the keep and across the river. Slay him and return to me when the deed is done.");
                            quest.Step = 2;
                        }
                        break;

                    case "done well":
                        if (quest.Step == 3)
                        {
                            marlinThuler.SayTo(player, "Now we must show the bandits that this is only the beginning of a long campaign. I've already begun planning our next moves to rid Camelot Hills of the bandit problem. Perhaps we can work together again in the [future].");
                        }
                        break;

                    case "future":
                        if (quest.Step == 3)
                        {
                            marlinThuler.SayTo(player, "It will be some time before my next plan is ready. For now, though, please take this money as payment for your services.");
                            quest.FinishQuest();
                        }
                        break;
                    }
                }
            }
        }