Exemplo n.º 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)
        {
            AMessageToTheManes quest = player.IsDoingQuest(typeof(AMessageToTheManes)) as AMessageToTheManes;

            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();
            }
        }
Exemplo n.º 2
0
        /* This is the method we declared as callback for the hooks we set to
         * Sir Quait. It will be called whenever a player right clicks on Sir Quait
         * or when he whispers something to him.
         */

        protected static void TalkToSirJerem(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 (sirJerem.CanGiveQuest(typeof(AMessageToTheManes), player) <= 0)
            {
                return;
            }

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

            sirJerem.TurnTo(player);
            //Did the player rightclick on sirJerem?
            if (e == GameObjectEvent.Interact)
            {
                //We check if the player is already doing the quest
                if (quest != null)
                {
                    if (quest.Step == 1)
                    {
                        sirJerem.SayTo(player, "It heartens me to know that I can count on your help. Because we cannot devote many resources to dealing with the demons, the first part of my plan calls for us to deliver a warning message to these [demons].");
                    }
                    else if (quest.Step == 3)
                    {
                        sirJerem.SayTo(player, "You've returned! I must admit, " + player.Name + ". I was beginning to get a little worried. Were you able to kill the two Manes [demons]?");
                    }
                    return;
                }
                else
                {
                    //Player hasn't the quest:
                    sirJerem.SayTo(player, "Hello again, " + player.CharacterClass.Name + ". Pardon me for not taking note of your presence earlier, but I've been considering how best to approach a new problem. Albion has no lack of enemies, and we must be vigilant in our defence against [each].");
                    return;
                }
            }
            // The player whispered to Sir Jerem (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                //We also check if the player is already doing the quest
                if (quest == null)
                {
                    switch (wArgs.Text)
                    {
                    case "each":
                        sirJerem.SayTo(player, "The forces of Midgard, Hibernia, the demons of Darkness Falls, the Drakoran, and Morgana's twisted legions all crave the destruction of our kingdom. So far, we have managed to fend them off, but we cannot count on [luck] to guide us.");
                        break;

                    case "luck":
                        sirJerem.SayTo(player, "We have skilled soldirs and commanders, but if our enemies should decide to unite, I fear they would overrun us. The denizens of Darkness Falls have begun to venture beyond the confines of their dungeon. We must act to [contain] them.");
                        break;

                    case "contain":
                        player.Out.SendQuestSubscribeCommand(sirJerem, QuestMgr.GetIDForQuestType(typeof(AMessageToTheManes)), "Will you help Sir Jerem dissuade the Manes demons from leaving Darkness Falls? [Levels 9-12]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;

                    case "demons":
                        if (quest.Step == 1)
                        {
                            sirJerem.SayTo(player, "Our scouts have reported that two kinds of demons, the Grumoz and the Manes, have ventured outside the portal. Slay two of the Manes to show the demon princes that Albion will not suffer their presence in its [lands].");
                        }
                        else if (quest.Step == 3)
                        {
                            quest.SendSystemMessage("You tell Sir Jerem that you were successful in your mission.");
                            sirJerem.SayTo(player, "Well done! I'll have my scouts monitor the area around the portal in the coming days to see if your actions had the intended effect. I'd be a fool to believe they would give up easily, but at least they will know that we are aware of their [presence].");
                        }
                        break;

                    case "lands":
                        if (quest.Step == 1)
                        {
                            sirJerem.SayTo(player, "The Darkness Falls portal is to the east of Prydwen Keep, beyond the bridge. If you have trouble locating it, don't forget that it is marked on your map.");
                            quest.Step = 2;
                        }
                        break;

                    case "presence":
                        if (quest.Step == 3)
                        {
                            sirJerem.SayTo(player, "Thank you again for all your help. I wish I could offer you a greater payment for your services, but as it is, our gold is stretched thin. Please accept this money along with the thanks of the people of Prydwen Keep.");
                            quest.FinishQuest();
                        }
                        break;
                    }
                }
            }
        }