Пример #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)
        {
            ArleighsAssistant quest = player.IsDoingQuest(typeof(ArleighsAssistant)) as ArleighsAssistant;

            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 TalkToArleighPenn(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 (arleighPenn.CanGiveQuest(typeof(ArleighsAssistant), player) <= 0)
            {
                return;
            }

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

            arleighPenn.TurnTo(player);
            //Did the player rightclick on arleighPenn?
            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 == 4) || (quest.Step == 5))
                    {
                        arleighPenn.SayTo(player, "Welcome back, my friend " + player.Name + ". I can tell already you've had luck finding the items I requested. How about you hand over those spriteling toes? Arthw is getting very low on the light green dye.");
                        quest.Step = 5;
                    }
                    if (quest.Step == 6)
                    {
                        arleighPenn.SayTo(player, "Now, do you have the worm rot for me? I'm getting very low on dark gray dye.");
                    }
                    if (quest.Step == 7)
                    {
                        arleighPenn.SayTo(player, "Now for the final item, the green skin.");
                    }
                    return;
                }
                else
                {
                    SendSystemMessage(player, "Arleigh does a little dance of celebration.");
                    //Player hasn't the quest:
                    arleighPenn.SayTo(player, "Greetings and salutations, my fine friend. I am the one, the only, Arleigh, dyemaster extraordinaire! I have just finished developing a vast collection of [new dyes] through my refinement of the arts!");
                    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 "new dyes":
                        arleighPenn.SayTo(player, "Yes, new dyes! Tired of that old orange, that boring blue, that tired worn-out green? Well, take a look at what my friend Arthw and I have! We [carry the finest] selection of dyes in the land.");
                        break;

                    case "carry the finest":
                        arleighPenn.SayTo(player, "No one else in this area carries dyes as fine as ours! You can believe me, I am an honest man. In fact, I will prove how honest I am to you. I will give you a dye free if you help me with [a small problem].");
                        break;

                    case "a small problem":
                        arleighPenn.SayTo(player, "When I was gathering materials to create these new, exciting dyes, I only gathered enough to create a test lot. That lot is almost gone, and Arthw and I have been so busy that neither of us has had time to go collecting. If you would be so kind as to gather a few things for me, I will give you a pot of dye free of charge, plus throw in a few coins for your trouble. Does that [sound good] to you?");
                        break;

                    //If the player offered his "help", we send the quest dialog now!
                    case "sound good":
                        player.Out.SendQuestSubscribeCommand(arleighPenn, QuestMgr.GetIDForQuestType(typeof(ArleighsAssistant)), "Will you help Arleigh find the components he needs for new dyes?");
                        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 "list them":
                        arleighPenn.SayTo(player, "I need spriteling toes from a river spriteling. When you dry them out, grind them up, and mix them with other components I shall keep secret, they make a wonderful light green dye that Arthw sells. Now, for the [next item].");
                        break;

                    case "next item":
                        arleighPenn.SayTo(player, "The dark gray dye I make comes from none other than worm rot. Can you believe it? I have developed a special process that extracts and purifies the color for a true dark gray. The worm rot can be found on undead fildhs, what else? Once you have the spriteling toes and the worm rot, search for an [emerald snake].");
                        break;

                    case "emerald snake":
                        arleighPenn.SayTo(player, "These snakes are born green and spend all day in the green grass. I need some of that snake skin. When it is refined, it makes a fantastic royal green color. There are your three items. Return to me when you have them all!.");
                        SendSystemMessage(player, "Arleigh bows to you.");
                        break;
                    }
                }
            }
        }