Ejemplo n.º 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 TalkToDragonflyHatchling(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 (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

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

            if (e == GameLivingEvent.Interact)
            {
                if (quest != null && quest.dragonflyHatchling == sender && quest.Step == 4)
                {
                    SendSystemMessage(player, "The dragonfly hatchling hums quitely.");

                    quest.dragonflyHatchling.MaxSpeedBase = player.MaxSpeedBase;
                    quest.dragonflyHatchling.Follow(player, 30, 2000);
                    quest.Step = 5;
                    return;
                }
            }
        }
Ejemplo n.º 2
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 TalkToHaruld(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 (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

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

            if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest != null && quest.Step == 1)
                {
                    haruld.TurnTo(player);
                    switch (wArgs.Text)
                    {
                    case "fairy":
                        haruld.SayTo(player, "Fairies? Bah, I don't care one lick about those creatures. Why don't you go speak to Nob in the stable there? He knows all about those nasty things.");
                        quest.Step = 2;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected static void CheckNearFairyDragonflyHandler(DOLEvent e, object sender, EventArgs args)
        {
            GameNPC fairyDragonflyHandler = (GameNPC)sender;

            // if princess is dead no ned to checks ...
            if (!fairyDragonflyHandler.IsAlive || fairyDragonflyHandler.ObjectState != GameObject.eObjectState.Active)
            {
                return;
            }

            foreach (GamePlayer player in fairyDragonflyHandler.GetPlayersInRadius(1500))
            {
                IreFairyIre quest = (IreFairyIre)player.IsDoingQuest(typeof(IreFairyIre));

                if (quest != null && !quest.fairyDragonflyHandlerAttackStarted && quest.Step == 3)
                {
                    quest.fairyDragonflyHandlerAttackStarted = true;

                    SendSystemMessage(player, "Fairy Dragonfly Handler says, \"No! I have been betrayed by loathsome insects! How can this be?\"");
                    IOldAggressiveBrain aggroBrain = fairyDragonflyHandler.Brain as IOldAggressiveBrain;
                    if (aggroBrain != null)
                    {
                        aggroBrain.AddToAggroList(player, 70);
                    }

                    // if we find player doing quest stop looking for further ones ...
                    break;
                }
            }
        }
Ejemplo n.º 4
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 CheckPlayerAcceptQuest(GamePlayer player, byte response)
        {
            // We recheck the qualification, because we don't talk to players
            // who are not doing the quest
            if (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

            IreFairyIre quest = player.IsDoingQuest(typeof(IreFairyIre)) as IreFairyIre;

            if (quest != null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendReply(player, "Oh well, if you change your mind, please come back!");
            }
            else
            {
                // Check if we can add the quest!
                if (!masterFrederick.GiveQuest(typeof(IreFairyIre), player, 1))
                {
                    return;
                }

                masterFrederick.SayTo(player, "Alright recruit, we have very few leads in regards to this egg napping, but I am of the opinion someone saw something. Haruld at the stable across the way may have seen something. There are a lot of fairies that reside near there. Go speak with him.");
            }
        }
Ejemplo n.º 5
0
        protected static void PlayerLeftWorld(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

            IreFairyIre quest = player.IsDoingQuest(typeof(IreFairyIre)) as IreFairyIre;

            if (quest != null)
            {
                quest.deleteDragonflyHatchling();
            }
        }
Ejemplo n.º 6
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 TalkToNob(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 (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

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

            nob.TurnTo(player);
            if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest != null)
                {
                    switch (wArgs.Text)
                    {
                    case "fairy":
                        nob.SayTo(player, "Ire fairies? Hrm...Now that you mention it, I do remember seeing some fairies heading off to a small grove behind the stable last night. There were a solid handful of them. They were carrying [something], I don't know what it was.");
                        break;

                    case "something":
                        nob.SayTo(player, "It looked heavy for them, whatever it was. Just head southeast from here and you'll find the grove. I hope you find what you're looking for.");
                        if (quest.Step == 2)
                        {
                            quest.Step = 3;
                            quest.initDragonflyHatchling();
                            quest.dragonflyHatchling.AddToWorld();
                        }

                        break;
                    }
                }
            }
        }
Ejemplo n.º 7
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)
        {
            IreFairyIre quest = player.IsDoingQuest(typeof(IreFairyIre)) as IreFairyIre;

            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();
            }
        }
Ejemplo n.º 8
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 TalkToColm(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 (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

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

            colm.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step == 5)
                    {
                        colm.SayTo(player, "Oh thank you Vinde for bringing back the baby. I know his parents will be relieved he's returned safe and sound. How did you manage to get him back? Did it use anything? A chain? A bridle?");

                        if (quest.dragonflyHatchling != null)
                        {
                            quest.dragonflyHatchling.StopFollowing();
                            quest.deleteDragonflyHatchling();
                        }
                    }
                    else if (quest.Step == 6)
                    {
                        colm.SayTo(player, "I know this isn't much, but I used to do a bit of adventuring in my time. I'm sure you'll be able to use this. Now, I think you should return to Master Frederick and let him or her know what's going on.");

                        if (player.HasAbilityToUseItem(recruitsVest))
                        {
                            GiveItem(colm, player, recruitsVest);
                        }
                        else
                        {
                            GiveItem(colm, player, recruitsQuiltedVest);
                        }

                        quest.Step = 7;
                    }

                    return;
                }
            }

            // 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 "appreciation":
                        colm.SayTo(player, "I know this isn't much, but I used to do a bit of adventuring in my time. I'm sure you'll be able to use this. Now, I think you should return to your trainer and let him or her know what's going on.");
                        if (quest.Step == 6)
                        {
                            if (player.HasAbilityToUseItem(recruitsVest))
                            {
                                GiveItem(colm, player, recruitsVest);
                            }
                            else
                            {
                                GiveItem(colm, player, recruitsQuiltedVest);
                            }

                            quest.Step = 7;
                        }

                        break;
                    }
                }
            }
        }
Ejemplo n.º 9
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 TalkToMasterFrederick(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 (masterFrederick.CanGiveQuest(typeof(IreFairyIre), player) <= 0)
            {
                return;
            }

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

            masterFrederick.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                // We check if the player is already doing the quest
                if (quest == null)
                {
                    // Player is not doing the quest...
                    masterFrederick.SayTo(player, "Recruit Vinde, these fairies are becoming a serious problem for Cotswold. They have been harassing the citizens here! Can you believe that? They are retaliating for us getting to their generals. They must be [stopped]!");
                    return;
                }
                else
                {
                    if (quest.Step == 7)
                    {
                        masterFrederick.SayTo(player, "You've returned Vinde. Did you have any success in locating the [egg for Colm]?");
                    }

                    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 "stopped":
                        masterFrederick.SayTo(player, "Colm, the dragonfly handler, told me the other day one of his dragonfly eggs had gone missing. He suspected the Ire Fairies took it. Since there were no footprints, I'm inclined to [believe] him.");
                        break;

                    case "believe":
                        masterFrederick.SayTo(player, "I want you to find where this egg has gone, bring it back and destroy the fairies who took it. We can't have them taking our dragonflies and torturing them for their own evil designs! What do you say? Are you [ready]?");
                        break;

                    // If the player offered his "help", we send the quest dialog now!
                    case "ready":
                        player.Out.SendQuestSubscribeCommand(masterFrederick, QuestMgr.GetIDForQuestType(typeof(IreFairyIre)), "Will you go out and find where these eggs went?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "egg for Colm":
                        masterFrederick.SayTo(player, "Ah, so the little thing hatched did it? Well, no matter. Excellent job recruit! For that, you shall be rewarded! Here, take [this].");
                        break;

                    case "this":
                        masterFrederick.SayTo(player, "I know you have done a great service for Colm, and I am happy for you for your continued selfless acts. Go now Vinde. We will speak again soon.");
                        if (quest.Step == 7)
                        {
                            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;
                    }
                }
            }
        }