Ejemplo n.º 1
0
        protected static void TalkToAnnark(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;

            annark.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null && quest.Step == 2)
                {
                    annark.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToAnnark.Talk1"));
                    quest.Step = 3;
                    quest.TeleportTo(player, annark, locationIdora, 30);
                    return;
                }

                return;
            }
        }
Ejemplo n.º 2
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"));
                    }
                }
            }
        }
Ejemplo n.º 3
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)
        {
            Frontiers quest = player.IsDoingQuest(typeof(Frontiers)) as Frontiers;

            if (quest == null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendSystemMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.CheckPlayerAbortQuest.Text1"));
            }
            else
            {
                SendSystemMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.CheckPlayerAbortQuest.Text2", questTitle));
                quest.AbortQuest();
            }
        }
Ejemplo n.º 4
0
        protected static void PlayerEnterWorld(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

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

            if (quest != null)
            {
                // if player reenters during step 4 alice will have finished translation anyway...
                if (quest.Step == 4)
                {
                    quest.idoraDone = true;
                }
            }
        }
Ejemplo n.º 5
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 (dalikor.CanGiveQuest(typeof(Frontiers), player) <= 0)
            {
                return;
            }

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

            if (quest != null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendReply(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.CheckPlayerAcceptQuest.Text1"));
            }
            else
            {
                //Check if we can add the quest!
                if (!dalikor.GiveQuest(typeof(Frontiers), player, 1))
                {
                    return;
                }

                dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.CheckPlayerAcceptQuest.Text2", player.Name));

                GiveItem(dalikor, player, noteForNjiedi);
                GiveItem(dalikor, player, askefruerPlans);
                player.AddMoney(Money.GetMoney(0, 0, 0, 6, 0), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.CheckPlayerAcceptQuest.Text3"));
                InventoryLogging.LogInventoryAction("(QUEST;" + quest.Name + ")", player, eInventoryActionType.Quest, 600);
            }
        }
Ejemplo n.º 6
0
        protected static void TalkToIdora(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;

            idora.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    //Player is not doing the quest...
                    if (quest.Step == 3 || quest.Step == 2)
                    {
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk1", player.CharacterClass.Name));
                    }
                    else if (quest.Step == 4)
                    {
                        if (quest.idoraDone)
                        {
                            idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk2"));
                        }
                        else
                        {
                            idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk3"));
                        }
                    }
                    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 :)
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Whisper1"))
                    {
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk4"));
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk5"));
                        if (quest.Step == 4)
                        {
                            GiveItem(idora, player, translatedPlans);
                            GiveItem(idora, player, ticketToMularn);
                            quest.Step = 5;
                            quest.TeleportTo(player, idora, locationVorgar, 50);
                        }
                    }
                }
            }
        }
Ejemplo n.º 7
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 TalkToDalikor(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;

            //Did the player rightclick on NPC?
            dalikor.TurnTo(player);
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk1"));
                    return;
                }
                else
                {
                    switch (quest.Step)
                    {
                    case 1:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk2", player.Name));
                        break;

                    case 5:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk3", player.Name));
                        break;

                    case 6:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk4"));
                        break;
                    }
                    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 :)
                    //If the player offered his "help", we send the quest dialog now!
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper1"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk5"));
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper2"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk6"));
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper3"))
                    {
                        player.Out.SendQuestSubscribeCommand(dalikor, QuestMgr.GetIDForQuestType(typeof(Frontiers)), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.OfferQuest"));
                    }
                }
                else
                {
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper4"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk7", player.Name));
                        if (quest.Step == 6)
                        {
                            quest.FinishQuest();
                        }
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper5"))
                    {
                        player.Out.SendCustomDialog(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.AbortQuest"), new CustomDialogResponse(CheckPlayerAbortQuest));
                    }
                }
            }
        }