/* 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) { BoulderlingBalm quest = player.IsDoingQuest(typeof(BoulderlingBalm)) as BoulderlingBalm; 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(); } }
/* 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 TalkToBrotherMaynard(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 (brotherMaynard.CanGiveQuest(typeof(BoulderlingBalm), player) <= 0) { return; } //We also check if the player is already doing the quest BoulderlingBalm quest = player.IsDoingQuest(typeof(BoulderlingBalm)) as BoulderlingBalm; brotherMaynard.TurnTo(player); //Did the player rightclick on brotherMaynard? if (e == GameObjectEvent.Interact) { //We check if the player is already doing the quest if (quest != null) { if (quest.Step == 1) { brotherMaynard.SayTo(player, "Thank you for agreeing to help. The main ingredient in my balm is a powder made from the crushed remains of boulderlings. The remains of two boulderlings should supply me for quite [some time]."); } else if (quest.Step == 4) { brotherMaynard.SayTo(player, "You've returned! I trust you were able to get the boulderling remains without much trouble? Please hand me the first set of remains."); } else if (quest.Step == 5) { brotherMaynard.SayTo(player, "May I have the second set of remains?"); } return; } else { //Player hasn't the quest: brotherMaynard.SayTo(player, "Good day to you, friend. Have you come to seek healing or to offer aid to the [Church]?"); 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 "Church": brotherMaynard.SayTo(player, "I'm not necessarily talking about punishing the wicked or slaying the enemies of the pious. Small acts of charity and service can make a difference, too. I leave combat to the Church's [paladins]."); break; case "paladins": brotherMaynard.SayTo(player, "Most believe that it is more glorious to take up the sword in the service of faith than to offer assistance to those in need. My calling is that of a healer, and I am grateful for the chance to use my skill in service to a greater [cause]."); break; case "cause": brotherMaynard.SayTo(player, "It is easy to forget that with no healers, no armor and weaponsmiths, there would be no paladins. I serve those who make the blades, the armor, the arrows and bows that our knights use in [battle]."); break; case "battle": brotherMaynard.SayTo(player, "A dedicated craftsman's hands taked a beating, and over the years, I've learned to make a balm that soothes them. I go hrough it rather quickly and I'm almost out of ingredients. Perhaps you would help me restock?"); player.Out.SendQuestSubscribeCommand(brotherMaynard, QuestMgr.GetIDForQuestType(typeof(BoulderlingBalm)), "Will you gather the ingredients for Brother Maynard's special balm? [Levels 10-13]"); break; } } else { switch (wArgs.Text) { case "abort": player.Out.SendCustomDialog("Do you really want to abort this quest?", new CustomDialogResponse(CheckPlayerAbortQuest)); break; case "some time": if (quest.Step == 1) { brotherMaynard.SayTo(player, "To find the boulderlings, travel east to Prydwen Bridge and cross it. The boulderlings will be located on a hill just to the east of the road. Good luck, " + player.CharacterClass.Name + "."); quest.Step = 2; } break; } } } }