예제 #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 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(ImportantDelivery), player) <= 0)
            {
                return;
            }

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

            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 (!dalikor.GiveQuest(typeof(ImportantDelivery), player, 1))
                {
                    return;
                }

                SendReply(player, "Congratulations! You are now one step closer to understanding the world of Camelot! During this phase of your training, I will be sending you to different parts of the realm to deliver much needed supplies to various citizens. You will need to check your QUEST JOURNAL from time to time to see what you need to accomplish next on your quest. You can access the quest journal from the COMMAND button on your [character sheet].");
            }
        }
예제 #2
0
        protected static void TalkToHarlfug(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            //for the quest!
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (dalikor.CanGiveQuest(typeof(ImportantDelivery), player) <= 0)
            {
                return;
            }

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

            harlfug.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    switch (quest.Step)
                    {
                    case 7:
                        harlfug.SayTo(player, "Welcome to my stable friend. What can I do for you today?");
                        break;

                    case 8:
                        harlfug.SayTo(player, "Ah, here we are. I know it isn't much, but I got it in a trade a while ago, and I don't have much use for it. I'm sure you can put it to use though, can't you? Let me know if you're in need of anything else. I have a few errands I need run.");
                        quest.FinishQuest();
                        break;
                    }
                }

                return;
            }
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                if (quest != null)
                {
                    //Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "reward":
                        harlfug.SayTo(player, "Ah, here we are. I know it isn't much, but I got it in a trade a while ago, and I don't have much use for it. I'm sure you can put it to use though, can't you? Let me know if you're in need of anything else. I have a few errands I need run.");
                        if (quest.Step == 8)
                        {
                            quest.FinishQuest();
                        }
                        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)
        {
            ImportantDelivery quest = player.IsDoingQuest(typeof(ImportantDelivery)) as ImportantDelivery;

            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();
            }
        }
예제 #4
0
        protected static void TalkToAbohas(DOLEvent e, object sender, EventArgs args)
        {
            // We get the player from the event arguments and check if he qualifies
            // for the quest!
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (dalikor.CanGiveQuest(typeof(ImportantDelivery), player) <= 0)
            {
                return;
            }

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

            abohas.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    switch (quest.Step)
                    {
                    case 3:
                    case 4:
                        abohas.SayTo(player, "Greetings traveler. I've not seen you around here before. You must be a new recruit. Well then, is there something I can help you with?");
                        break;

                    case 5:
                        abohas.SayTo(player, "Oh, I see. Yes, from Dalikor. We've been waiting for these supplies for a while. It's good to have them. I don't suppose you're up for one more [errand], are you?");
                        break;

                    case 6:
                        abohas.SayTo(player, "I need for you to deliver this crate of vegetables to Stable Master Harlfug in Vasudheim. Don't worry, I'll give you a ticket so you don't have to run there. Thank you my friend. Be swift so the vegetables don't rot.");
                        break;
                    }
                }

                return;
            }
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                if (quest != null)
                {
                    // Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "errand":
                        abohas.SayTo(player, "I need for you to deliver this crate of vegetables to Stable Master Harlfug in Vasudheim. Don't worry, I'll give you a ticket so you don't have to run there. Thank you my friend. Be swift so the vegetables don't rot.");
                        if (quest.Step == 5)
                        {
                            GiveItem(abohas, player, ticketToVasudheim);
                            GiveItem(abohas, player, crateOfVegetables);

                            quest.Step = 6;
                        }

                        break;
                    }
                }
            }
        }
예제 #5
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
            // for the quest!
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (dalikor.CanGiveQuest(typeof(ImportantDelivery), player) <= 0)
            {
                return;
            }

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

            dalikor.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    // Player is not doing the quest...
                    dalikor.SayTo(player, "Greetings to you my young friend. I am Dalikor. I'm here to help you find your way around this vast realm. In the process, you'll have the ability to earn weapons, armor, coin and some levels. Would you like to start [training] now?");
                    return;
                }
                else
                {
                    switch (quest.Step)
                    {
                    case 2:
                        dalikor.SayTo(player, "This journal will help you from time to time while you are doing various tasks for me. I like to call it a smart journal. It was made by one of the runemasters for new recruits like you. It will help to [expedite] your training.");
                        break;

                    case 3:
                        dalikor.SayTo(player, "All you need to do is take this horse ticket to Gularg in Mularn. Hand him the ticket and you'll be on your way to Haggerfel. Be swift my young recruit. Time is of the essence.");
                        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 :)
                    switch (wArgs.Text)
                    {
                    case "training":
                        dalikor.SayTo(player, "I thought you would. What I am here to do is to guide you through your first few seasons, until I feel you're confident and skilled enough to make it on your own in Albion. If you aren't properly trained, then what good are you to the realm? None, of course. Now, I will start your training off by asking you a simple quesion, whether or not you wish to [proceed] with your training. A dialogue box will pop up. Either press the Accept or Decline button.");
                        break;

                    // If the player offered his "help", we send the quest dialog now!
                    case "proceed":
                        player.Out.SendQuestSubscribeCommand(dalikor, QuestMgr.GetIDForQuestType(typeof(ImportantDelivery)), "Are you ready to begin your training?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "character sheet":
                        dalikor.SayTo(player, "Your character sheet houses all of your character's information, such as attributes, weapon skill, base class and profession. If at any time you want to see your character's statistics, press the far left icon on the menu bar (it looks like a person with a circle around them) for more [information].");
                        break;

                    case "information":
                        dalikor.SayTo(player, "I know this all seems a little overwhelming, but I have a special item here that will make this transition a smooth one. Please, take this [journal].");
                        if (quest.Step == 1)
                        {
                            quest.Step = 2;
                        }

                        break;

                    case "journal":
                        dalikor.SayTo(player, "This journal will help you from time to time while you are doing various tasks for me. I like to call it a smart journal. It was made by one of the runemasters for new recruits like you. It will help to [expedite] your training.");
                        break;

                    case "expedite":
                        dalikor.SayTo(player, "Now that I've given you a small introduction to the world of Midgard, let's get started with your first task. I need for you to deliver this package of supplies to Abohas in Haggerfel. Don't worry, I have a special [horse ticket] for you.");
                        break;

                    case "horse ticket":
                        dalikor.SayTo(player, "All you need to do is take this horse ticket to Gularg in Mularn. Hand him the ticket and you'll be on your way to Haggerfel. Be swift my young recruit. Time is of the essence.");
                        if (quest.Step == 2)
                        {
                            GiveItem(dalikor, player, ticketToHaggerfel);
                            GiveItem(dalikor, player, sackOfSupplies);
                            quest.Step = 3;
                        }

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