예제 #1
0
        private static void CheckPlayerAcceptQuest(GamePlayer player, byte response)
        {
            AidingGuardAlakyrr quest = player.IsDoingQuest(typeof(AidingGuardAlakyrr)) as AidingGuardAlakyrr;

            if (GuardAlakyrr.CanGiveQuest(typeof(AidingGuardAlakyrr), player) <= 0)
            {
                return;
            }

            if (player.IsDoingQuest(typeof(AidingGuardAlakyrr)) != null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendReply(player, "Oh well, if you change your mind, please come back!");
            }
            else
            {
                if (!GuardAlakyrr.GiveQuest(typeof(AidingGuardAlakyrr), player, 1))
                {
                    return;
                }
                SendReply(player, "Very well. Please travel south down this tunnel to what we guards call the Tenebrous Quarter and slay tenebrae. I will need you to collect some of their essence so that we can send it to our scholars to [study].");
                GiveItem(GuardAlakyrr, player, enchantedtenebrousflask);

                GameEventMgr.AddHandler(player, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
                GameEventMgr.AddHandler(player, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            }
        }
예제 #2
0
        protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer         player = (GamePlayer)sender;
            AidingGuardAlakyrr quest  = (AidingGuardAlakyrr)player.IsDoingQuest(typeof(AidingGuardAlakyrr));

            if (quest == null)
            {
                return;
            }

            UseSlotEventArgs uArgs = (UseSlotEventArgs)args;

            InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot);

            if (item != null && item.Id_nb == enchantedtenebrousflask.Id_nb)
            {
                if (quest.Step == 3)
                {
                    SendSystemMessage(player, "You use the Enchanted Tenebrous Flask.");

                    ReplaceItem(player, enchantedtenebrousflask, quarterfulltenebrousflask);
                    SendSystemMessage(player, "The flask is one quarter full.");
                    quest.Step = 4;
                }
            }
            if (item != null && item.Id_nb == quarterfulltenebrousflask.Id_nb)
            {
                if (quest.Step == 5)
                {
                    SendSystemMessage(player, "You use the Quarter Full Tenebrous Flask.");

                    ReplaceItem(player, quarterfulltenebrousflask, halffulltenebrousflask);
                    SendSystemMessage(player, "The flask is half full.");
                    quest.Step = 6;
                }
            }
            if (item != null && item.Id_nb == halffulltenebrousflask.Id_nb)
            {
                if (quest.Step == 7)
                {
                    SendSystemMessage(player, "You use the Half Full Tenebrous Flask.");

                    ReplaceItem(player, halffulltenebrousflask, threequarterfulltenebrousflask);
                    SendSystemMessage(player, "The flask is three quarters full.");
                    quest.Step = 8;
                }
            }
            if (item != null && item.Id_nb == threequarterfulltenebrousflask.Id_nb)
            {
                if (quest.Step == 9)
                {
                    SendSystemMessage(player, "You use the 3 Quarters Full Tenebrous Flask.");

                    ReplaceItem(player, threequarterfulltenebrousflask, fullflaskoftenebrousessence);
                    SendSystemMessage(player, "You fill the flask with Tenebrous Essence.");
                    quest.Step = 10;
                }
            }
        }
예제 #3
0
        protected static void PlayerLeftWorld(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

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

            if (quest != null)
            {
                GameEventMgr.RemoveHandler(player, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
                GameEventMgr.RemoveHandler(player, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
            }
        }
예제 #4
0
        private static void CheckPlayerAbortQuest(GamePlayer player, byte response)
        {
            AidingGuardAlakyrr quest = player.IsDoingQuest(typeof(AidingGuardAlakyrr)) as AidingGuardAlakyrr;

            if (quest == null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendSystemMessage(player, "Good, now go out there and finish your work!");
            }
            else
            {
                SendSystemMessage(player, "Aborting Quest " + questTitle + ". You can start over again if you want.");
                quest.AbortQuest();
            }
        }
예제 #5
0
        protected static void TalkToGuardAlakyrr(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (GuardAlakyrr.CanGiveQuest(typeof(AidingGuardAlakyrr), player) <= 0)
            {
                return;
            }

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

            GuardAlakyrr.TurnTo(player);
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    GuardAlakyrr.SayTo(player, "You are new to this area aren't you? Yes, you look to be one of those from upper Albion. You will find that this lower realm is not as [familiar] as upper Albion and your Camelot.");
                    return;
                }
                else
                {
                    if (quest.Step == 1)
                    {
                        if (e == GameLivingEvent.WhisperReceive)
                        {
                            WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                            switch (wArgs.Text)
                            {
                            case "study":

                                GuardAlakyrr.SayTo(player, "You will need to slay tenebrae and then use an enchanted Tenebrous Flask, while inside the Tenebrous Quarter, to capture their essence. I need you to obtain a full flask of Tenebrous Essence. Return to me once you complete this duty and I will reward you for your efforts.");
                                quest.Step = 2;
                                break;
                            }
                        }
                    }
                    if (quest.Step == 10)
                    {
                        GuardAlakyrr.SayTo(player, "It was Arawn's will to allow your return. I am grateful that you made it back. Please give me the Full Flask of Tenebrous Essence.");
                        quest.Step = 11;
                    }
                    return;
                }
            }
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    switch (wArgs.Text)
                    {
                    case "familiar":
                        GuardAlakyrr.SayTo(player, "Everything here is quite unlike upper Albion, from the surroundings to the creatures. We, the chosen of Arawn, are not even familiar with some of the [creatures] which lurk in the Aqueducts.");
                        break;

                    case "creatures":
                        GuardAlakyrr.SayTo(player, "We have been trying to study some of these creatures so that we can learn more of their origins to better defend ourselves. Our forces are spread thin with the war against the evil army being [waged] below.");
                        break;

                    case "waged":
                        GuardAlakyrr.SayTo(player, "We have not had enough troops to spare to help us combat some of these hostile beings. The [tenebrae] are some of these creatures.");
                        break;

                    case "tenebrae":
                        GuardAlakyrr.SayTo(player, "They seem to hate all that is living, and it is an intense hate, indeed. Their origins are shrouded in mystery, but we do know that they were created out of [darkness].");
                        break;

                    case "darkness":
                        GuardAlakyrr.SayTo(player, "The attacks by the tenebrae have been numerous, and we need to cease some of these attacks. I am authorized to provide money to any who can slay these tenebrae and bring me proof of their deed. Will you [aid] us in this time of need?");
                        break;

                    case "aid":
                        player.Out.SendQuestSubscribeCommand(GuardAlakyrr, QuestMgr.GetIDForQuestType(typeof(AidingGuardAlakyrr)), "Will you slay the tenebrae for Guard Alakyrr? [Levels 1-4]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "study":
                        if (quest.Step == 1)
                        {
                            GuardAlakyrr.SayTo(player, "You will need to slay tenebrae and then use an enchanted Tenebrous Flask, while inside the Tenebrous Quarter, to capture their essence. I need you to obtain a full flask of Tenebrous Essence. Return to me once you complete this duty and I will reward you for your efforts.");
                            quest.Step = 2;
                        }
                        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;
                    }
                }
            }
        }