Esempio n. 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)
        {
            BreakingTheBandits quest = player.IsDoingQuest(typeof(BreakingTheBandits)) as BreakingTheBandits;

            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();
            }
        }
Esempio n. 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 TalkToAtheleys(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 (atheleys.CanGiveQuest(typeof(BreakingTheBandits), player) <= 0)
            {
                return;
            }

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

            atheleys.TurnTo(player);
            //Did the player rightclick on atheleys?
            if (e == GameObjectEvent.Interact)
            {
                //We check if the player is already doing the quest
                if (quest != null)
                {
                    if (quest.Step == 1)
                    {
                        atheleys.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)
                    {
                        atheleys.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:
                    atheleys.SayTo(player, "Good day to you mighty. I am Atheleys Sy'Lian from the royal court at Avalon. I was sent here to speak with Lord Prydwen about the problem that he has been experiencing lately with the [bandits] that roam the hillsides.");
                    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 "bandits":
                        atheleys.SayTo(player, "Since the death of our beloved King Arthur, the bandits of Camelot Hills, and indeed, all of Albion, have grown quite bold. They roam the roads in packs, harassing travelers and disrupting the peace. They must be [stopped].");
                        break;

                    case "stopped":
                        atheleys.SayTo(player, "Alas, Captain Bonswell has but limited resources to address this problem. I do not blame him, nor do I envy him. His is not an easy task. While he deals with threats from abroad and Morgana's minions, I have decided to take on the bandit [problem].");
                        break;

                    case "problem":
                        atheleys.SayTo(player, "The first step in my plan is to eliminate the leader of a group of bandits operating just outside of Prydwen Keep. Will you assist me in this task?.");
                        player.Out.SendQuestSubscribeCommand(atheleys, QuestMgr.GetIDForQuestType(typeof(BreakingTheBandits)), "Will you help Atheleys Sy'Lian in her campaign against the bandits? [Levels 8-11]");
                        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)
                        {
                            atheleys.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)
                        {
                            atheleys.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)
                        {
                            atheleys.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;
                    }
                }
            }
        }