Пример #1
0
        protected static void TalkToMorlinCaan(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 (Masrim.CanGiveQuest(typeof(Rogue_50), player) <= 0)
            {
                return;
            }

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

            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    MorlinCaan.SayTo(player, "Check your journal for instructions!");
                }
                return;
            }
        }
Пример #2
0
        protected static void TalkToMasrim(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 (Masrim.CanGiveQuest(typeof(Rogue_50), player) <= 0)
            {
                return;
            }

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

            if (e == GameObjectEvent.Interact)
            {
                // Nag to finish quest
                if (quest != null)
                {
                    Masrim.SayTo(player, "Check your Journal for instructions!");
                }
                else
                {
                    Masrim.SayTo(player, "Midgard needs your [services]");
                }
            }

            // The player whispered to the NPC
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                // Check player is already doing quest
                if (quest == null)
                {
                    switch (wArgs.Text)
                    {
                    case "services":
                        player.Out.SendQuestSubscribeCommand(Masrim, QuestMgr.GetIDForQuestType(typeof(Rogue_50)), "Will you help Masrim [Rogue Level 50 Epic]?");
                        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;
                    }
                }
            }
        }
Пример #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)
        {
            Rogue_50 quest = player.IsDoingQuest(typeof(Rogue_50)) as Rogue_50;

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