示例#1
0
        protected static void TalkToGuardCynon(DOLEvent e, object sender, EventArgs args)
        {
            // We get the player from the event arguments
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

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

            if (quest == null)
            {
                return;
            }

            guardCynon.TurnTo(player);

            // Did the player rightclick on guardCynon?
            if (e == GameObjectEvent.Interact)
            {
                if (quest.Step == 1)
                {
                    guardCynon.SayTo(player, "Good day, you must be the courier from Palune. I've been waiting for her to finish with that polearm for quite some time. May I have the halberd?");
                }

                if (quest.Step == 2)
                {
                    guardCynon.SayTo(player, "This halberd is talking to me! What kind of useless enchantment is this? I asked Palune to put a simple accuracy enchantment upon this weapon, not to make it [chatter] at me!");
                }

                return;
            }

            // The player whispered to Sir Quait (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                if (quest.Step == 2)
                {
                    switch (wArgs.Text)
                    {
                    case "chatter":
                        guardCynon.SayTo(player, "This is downright annoying, and worse, the weapon is useless to me! Take this back to Palune and let her know that if she doesn't correct this, I'll see to it that the Defenders of Albion find a new enchanter.");
                        GiveItem(guardCynon, player, enchantedHalberd);
                        quest.Step = 3;
                        break;
                    }
                }
            }
        }
示例#2
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)
        {
            Disenchanted quest = player.IsDoingQuest(typeof(Disenchanted)) as Disenchanted;

            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();
            }
        }
示例#3
0
        /* This is the method we declared as callback for the hooks we set to
         * palune. It will be called whenever a player right clicks on Sir Quait
         * or when he whispers something to him.
         */

        protected static void TalkToPalune(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 (palune.CanGiveQuest(typeof(Disenchanted), player) <= 0)
            {
                return;
            }

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

            palune.TurnTo(player);

            // Did the player rightclick on palune?
            if (e == GameObjectEvent.Interact)
            {
                // We check if the player is already doing the quest
                if (quest != null)
                {
                    // If the player is already doing the quest, we look if he has the items:
                    if (quest.Step == 3)
                    {
                        palune.SayTo(player, "You've returned! Excell...hey, wait a minute. Why do you still have the halberd with you? Were you not able to find Guard Cynon or West [Downs]?");
                    }

                    return;
                }
                else
                {
                    // Player hasn't the quest:
                    palune.SayTo(player, "Greetings. I hope your day has gone better than mine. It seems the courier I normally use has fallen ill, and I've been left without anyone to deliver this equipment. I'm able to get some of the weapons and armor to my local [customers].");
                    return;
                }
            }

            // The player whispered to Sir Quait (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 "customers":
                        palune.SayTo(player, "Unfortunately, I also have a number of deliveries to customers in other parts of the realm. I'd ask one of the squires or the stableboys to deliver some of these, but everyone seems to have their own [responsibilities].");
                        break;

                    case "responsibilities":
                        palune.SayTo(player, "If I paid you for your time, would you be willing to deliver a polearm I recently enchanted for a member of the Defenders of Albion?");
                        player.Out.SendQuestSubscribeCommand(palune, QuestMgr.GetIDForQuestType(typeof(Disenchanted)), "Will you deliver the polearm for Palune? [Levels 7-10]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;

                    case "Downs":
                        if (quest.Step == 3)
                        {
                            SendSystemMessage(player, "You tell Palune that you delivered the polearm to Guard Cynon, as asked, but he was not satisfied with it. You describe what happened when he tried to wield the weapon. Palune's face pales as you relate the story.");
                            palune.SayTo(player, "Oh my! I couldn't have done that, could I? Oh, no, what if I did put the wrong enchantment on it? I'll bet Guard Cynon is so angry at me...May I have the polearm back?");
                        }

                        break;
                    }
                }
            }
        }