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

                masterFrederick.SayTo(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].");
            }
        }
Exemple #2
0
        protected static void TalkToBombard(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 (masterFrederick.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;

            bombard.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step == 7)
                    {
                        bombard.SayTo(player, "Welcome to my stable friend. What can I do for you today?");
                    }
                    else if (quest.Step == 8)
                    {
                        bombard.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();
                    }
                }

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

                if (quest != null)
                {
                    // Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "reward":
                        bombard.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;
                    }
                }
            }
        }
Exemple #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();
            }
        }
Exemple #4
0
        protected static void TalkToDunan(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 (masterFrederick.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;

            dunan.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step >= 3 && quest.Step <= 4)
                    {
                        dunan.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?");
                    }
                    else if (quest.Step == 5)
                    {
                        dunan.SayTo(player, "Oh, I see. Yes, from Master Frederick. 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?");
                    }
                    else if (quest.Step == 6)
                    {
                        dunan.SayTo(player, "I need for you to deliver this crate of vegetables to Stable Master Bombard at the Camelot Gates. 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.");
                    }
                }

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

                if (quest != null)
                {
                    //Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "errand":
                        dunan.SayTo(player, "I need for you to deliver this crate of vegetables to Stable Master Bombard at the Camelot Gates. 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(dunan, player, ticketToBombard);
                            GiveItem(dunan, player, crateOfVegetables);

                            quest.Step = 6;
                        }
                        break;
                    }
                }
            }
        }
Exemple #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 TalkToMasterFrederick(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 (masterFrederick.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;

            masterFrederick.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    masterFrederick.SayTo(player, "Greetings to you my young friend. I am Master Frederick. 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
                {
                    if (quest.Step == 2)
                    {
                        masterFrederick.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 sorcerers at the Academy for new recruits like you. It will help to [expedite] your training.");
                    }
                    else if (quest.Step == 3)
                    {
                        masterFrederick.SayTo(player, "All you need to do is take this horse ticket to Vuloch near the gates of Camelot. Hand him the ticket and you'll be on your way to Ludlow. Be swift my young recruit. Time is of the essence.");
                    }
                    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":
                        masterFrederick.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(masterFrederick, QuestMgr.GetIDForQuestType(typeof(ImportantDelivery)), "Are you ready to begin your training?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "character sheet":
                        masterFrederick.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":
                        masterFrederick.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":
                        masterFrederick.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 sorcerers at the Academy for new recruits like you. It will help to [expedite] your training.");
                        break;

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

                    case "horse ticket":
                        masterFrederick.SayTo(player, "All you need to do is take this horse ticket to Vuloch near the gates of Camelot. Hand him the ticket and you'll be on your way to Ludlow. Be swift my young recruit. Time is of the essence.");
                        if (quest.Step == 2)
                        {
                            GiveItem(masterFrederick, player, ticketToLudlow);
                            GiveItem(masterFrederick, 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;
                    }
                }
            }
        }