Beispiel #1
0
        protected static void TalkToNjiedi(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 (dalikor.CanGiveQuest(typeof(Frontiers), player) <= 0)
            {
                return;
            }

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

            dalikor.TurnTo(player);
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step == 1)
                    {
                        njiedi.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToNjiedi.Talk1"));
                    }
                }
            }
        }
Beispiel #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 TalkToNjiedi(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 (dalikor.CanGiveQuest(typeof(StolenEggs), player) <= 0)
            {
                return;
            }

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

            njiedi.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step == 5)
                    {
                        njiedi.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.TalkToNjiedi.Talk1", player.Name));

                        if (quest.grifflet != null)
                        {
                            quest.grifflet.StopFollowing();
                            quest.deleteGrifflet();
                        }
                    }
                    else if (quest.Step == 6)
                    {
                        njiedi.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.TalkToNjiedi.Talk2"));
                        if (player.HasAbilityToUseItem(recruitsVest))
                        {
                            GiveItem(njiedi, player, recruitsVest);
                        }
                        else
                        {
                            GiveItem(njiedi, 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)
                {
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.TalkToNjiedi.Whisper1"))
                    {
                        njiedi.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.TalkToNjiedi.Talk2"));
                        if (quest.Step == 6)
                        {
                            if (player.HasAbilityToUseItem(recruitsVest))
                            {
                                GiveItem(njiedi, player, recruitsVest);
                            }
                            else
                            {
                                GiveItem(njiedi, player, recruitsQuiltedVest);
                            }

                            quest.Step = 7;
                        }
                    }
                }
            }
        }
Beispiel #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 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;
                    }
                }
            }
        }