示例#1
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToSquireGalune(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;
            }

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

            squireGalune.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    switch (quest.Step)
                    {
                    case 2:
                        squireGalune.SayTo(player, "Oh, no, it's a spider! Please, someone get this awful thing away from me!");
                        squireGalune.Emote(eEmote.Beg);
                        break;

                    case 3:
                        squireGalune.SayTo(player, "Sir Jerem finally sent someone? Nevermind, I don't care who sent you, I'm just relieved that horrible spider is dead! I thought for sure it was going to kill me. I'll never listen to [Master Graent's] stories again.");
                        break;
                    }
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest != null)
                {
                    switch (wArgs.Text)
                    {
                    case "Master Graent's":
                        if (quest.Step == 3)
                        {
                            squireGalune.SayTo(player, "He's full of stories about hidden treasures and deeds of valor, but he never mentioned spiders! He conveniently left that part out. When I get back to the castle, I'm going to give him a piece of my [mind].");
                        }
                        break;

                    case "mind":
                        if (quest.Step == 3)
                        {
                            squireGalune.SayTo(player, "I think I'll be able to make it back on my own now. Thank you so much for rescuing me from that spider.  Please let Sir Jerem know that I'm safe when you get back to the keep.");
                            quest.Step = 4;
                        }
                        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)
        {
            ShakenSquire quest = player.IsDoingQuest(typeof(ShakenSquire)) as ShakenSquire;

            if (quest == null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendSystemMessage(player, "Good, no 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
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

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

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

            sirJerem.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    sirJerem.SayTo(player, "Good day, " + player.CharacterClass.Name + ".  I'm sorry that I can't spare much time for idle chatter, but I've got a number of things on my mind right now.  Keeping track of a keep full of squires certainly isn't easy [work].");
                    return;
                }
                else
                {
                    if (quest.Step == 4)
                    {
                        sirJerem.SayTo(player, "Ah, you've returned. Were you able to track down Squire [Galune]?");
                    }
                    return;
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    //Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "work":
                        sirJerem.SayTo(player, "They're good lads, mostly, but they tend to get a little overeager at times.  In fact, one of my youngest squires has gone missing. I suspect he heard rumors from the locals and went to [investigate] them.");
                        break;

                    //If the player offered his help, we send the quest dialog now!
                    case "investigate":
                        sirJerem.SayTo(player, "This happens every time we get a new squire. The merchants fill his head with nonsense about becoming a hero and then the boy goes off exploring and gets himself into trouble.  Will you help me locate my missing squire?");
                        player.Out.SendQuestSubscribeCommand(sirJerem, QuestMgr.GetIDForQuestType(typeof(ShakenSquire)), "Will you help Sir Jerem find \nthe missing squire? \n[Levels 6-9]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "once":
                        if (quest.Step == 1)
                        {
                            sirJerem.SayTo(player, "I think Graent envies them, in a way. The squires are still young enough to have a bright-eyed enthusiasm for exploration and danger, and he feeds that with his stories.  I think the Tomb of Mithra is probably the best place to start your [search].");
                        }
                        break;

                    case "search":
                        if (quest.Step == 1)
                        {
                            sirJerem.SayTo(player, "The Tomb can be found to the east of here, past the bridge, and across the road.  If you need help finding it, don't forget that you can always consult your map. The name of the squire you're looking for is Galune. Good luck.");
                            quest.Step = 2;
                        }
                        break;

                    case "Galune":
                        if (quest.Step == 4)
                        {
                            SendMessage(player, "You tell Sir Jerem that you found Squire Galune in the Tomb, and that he is making his way back to the keep.  You decide not to mention the spider, but you get the sense that Sir Jerem will find out anyway.", 0, eChatType.CT_Say, eChatLoc.CL_PopupWindow);
                            sirJerem.SayTo(player, "I'm glad to hear that you found the squire before he got himself into too much trouble. Most likely, he fainted at the sight of some rat or spider, and decided to wait for someone to [rescue him].");
                        }
                        break;

                    case "rescue him":
                        if (quest.Step == 4)
                        {
                            sirJerem.SayTo(player, "I won't give him too much trouble over it. I have a feeling that he's learned a good lesson from all of this and won't be nearly so adventurous in the future. Here's a bit of money for your efforts.");
                            quest.FinishQuest();
                        }
                        break;

                    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;
                    }
                }
            }
        }