예제 #1
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)
        {
            Church_50 quest = player.IsDoingQuest(typeof(Church_50)) as Church_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();
            }
        }
예제 #2
0
        protected static void TalkToRoben(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 (Roben.CanGiveQuest(typeof(Church_50), player) <= 0)
            {
                return;
            }

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

            Roben.TurnTo(player);
            if (e == GameObjectEvent.Interact)
            {
                // Nag to finish quest
                if (quest == null)
                {
                    Roben.SayTo(player, "It appears that those present when the glyph was made whole received a [vision].");
                }
                else
                {
                    switch (quest.Step)
                    {
                    case 1:
                        Roben.SayTo(player, "You must not let this occur " + player.GetName(0, false) + "! I am familar with [Lyonesse]. I suggest that you gather a strong group of adventurers in order to succeed in this endeavor!");
                        break;

                    case 2:
                        Roben.SayTo(player, "Were you able to defeat the cult of the dark lord Arawn?");
                        break;
                    }
                }
            }

            // 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 "vision":
                        Roben.SayTo(player, "They speak of a broken cathedral located within the borders of Lyonesse. The glyph was able to show the new [occupants] of this cathedral.");
                        break;

                    case "occupants":
                        Roben.SayTo(player, "Occupants that worship not the church of Albion, but the dark lord Arawn! Magess Axton requests that you gather a group and destroy the leader of these dark disciples. She believes these worshippers of Arawan strive to [break the light of camelot] and establish their own religion within our realm.");
                        break;

                    case "break the light of camelot":
                        player.Out.SendQuestSubscribeCommand(Roben, QuestMgr.GetIDForQuestType(typeof(Church_50)), "Will you help Roben [Church Level 50 Epic]?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "Lyonesse":
                        Roben.SayTo(player, "The cathedral that Axton speaks of lies deep at the heart of that land, behind the Pikeman, across from the Trees. Its remaining walls can be seen at great distances during the day so you should not miss it. I would travel with thee, but my services are required elswhere. Fare thee well " + player.CharacterClass.Name + ".");
                        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;
                    }
                }
            }
        }