Пример #1
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 TalkToSeamstressLynnet(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 (stewardWillie.CanGiveQuest(typeof(WolfPeltCloak), player) <= 0)
            {
                return;
            }

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

            lynnet.TurnTo(player);

            // Did the player rightclick on Sir Quait?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    // If the player is already doing the quest, we ask if he found the sword!
                    lynnet.SayTo(player, "I hear you have a token for me, as proof of your valuable work for his Lordship. Give it to me and I will reward you.");
                }
            }
        }
Пример #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)
        {
            WolfPeltCloak quest = player.IsDoingQuest(typeof(WolfPeltCloak)) as WolfPeltCloak;

            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
         * Sir Quait. It will be called whenever a player right clicks on Sir Quait
         * or when he whispers something to him.
         */

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

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

            stewardWillie.TurnTo(player);

            // Did the player rightclick on Sir Quait?
            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 ask if he found the fur!
                    if (player.Inventory.GetFirstItemByID(wolfFur.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) != null)
                    {
                        stewardWillie.SayTo(player, "Ah, well done! His Lordship will be pleased to know there is one less mongrel in the pack! Give me the fur so I can throw it with the others.");
                    }
                    else if (player.Inventory.GetFirstItemByID(wolfHeadToken.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) != null)
                    {
                        stewardWillie.SayTo(player, "Give the token to Seamstress Lynnet in Ludlow, she'll give ye your reward. Thank ye for your fine services to His Lordship.");
                    }
                    else
                    {
                        stewardWillie.SayTo(player, "Good! I know we ca'count on ye. I will reward ye for the pelt ye bring me from one of those vile beasts!");
                    }

                    return;
                }
                else
                {
                    stewardWillie.SayTo(player, "Aye, hello there! Have ye been sent t'help with our [problem]");
                    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 "problem":
                        stewardWillie.SayTo(player, "What? Ye haven't heard? Hhhmm, then I wonder if ye would [like to help]");
                        break;

                    case "pack of wolves":
                        stewardWillie.SayTo(player, "There should be some around the area of this village, take a look near the road to Camelot. Kill any wolf pups you can find, and bring me its fur.");
                        break;

                    case "like to help":
                        stewardWillie.SayTo(player, "That's wonderful! We've been havin' a serious problem with a [pack of wolves]. His Lordship wants'em eliminated because they have been a-bothering the people here about. His Lordship has authorized me to reward those who [serve him well].");
                        break;

                    // If the player offered his "help", we send the quest dialog now!
                    case "serve him well":
                        player.Out.SendQuestSubscribeCommand(stewardWillie, QuestMgr.GetIDForQuestType(typeof(WolfPeltCloak)), "Do you accept the Wolf Pelt Cloak quest?");
                        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;
                    }
                }
            }
        }