cheers.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --[[
  2. Script Name : Quests/Graystone/cheers.lua
  3. Script Purpose : Handles the quest, "Cheers!"
  4. Script Author : Scatman
  5. Script Date : 2009.10.05
  6. Zone : Graystone Yard
  7. Quest Giver: Mav Boilfist
  8. Preceded by: A Family Recipe (a_family_recipe.lua)
  9. Followed by: A Package (a_package.lua)
  10. --]]
  11. local CHEERS_QUEST = 285
  12. function Init(Quest)
  13. AddQuestStep(Quest, 1, "I need to collect Mav's brew from the keg next to her.", 1, 100, "I need to collect some of Mav's brew from the keg next to her.", 0)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_GotBrewFromKeg")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. FaceTarget(QuestGiver, Player)
  18. conversation = CreateConversation()
  19. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/mav_boilfist/qey_village03/quests/mav_boilfist/mav_boilfist017a.mp3", "", "", 4196748864, 1238448420, Player)
  20. AddConversationOption(conversation, "We'll see.")
  21. StartConversation(conversation, QuestGiver, Player, "I hope they like it!")
  22. end
  23. function Declined(Quest, QuestGiver, Player)
  24. end
  25. function Step1_Complete_GotBrewFromKeg(Quest, QuestGiver, Player)
  26. UpdateQuestStepDescription(Quest, 1, "I have collected Mav's brew.")
  27. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected Mav's brew.")
  28. AddQuestStepChat(Quest, 2, "I need to give some of Mav's brew to Gnor Farven in the tavern.", 1, "I need to give samples of Mav's brew to a number of people around Graystone Yard.", 0, 2350036)
  29. AddQuestStepChat(Quest, 3, "I need to give some of Mav's brew to Gurna Hadel in the tavern.", 1, "I need to give samples of Mav's brew to a number of people around Graystone Yard.", 0, 2350042)
  30. AddQuestStepChat(Quest, 4, "I need to give some of Mav's brew to Dunda Frostgrip southwest of the scribe's shop.", 1, "I need to give samples of Mav's brew to a number of people around Graystone Yard.", 0, 2350047)
  31. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_SpokeWithGnor")
  32. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_SpokeWithGurna")
  33. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_SpokeWithDunda")
  34. end
  35. function Step2_Complete_SpokeWithGnor(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 2, "I have given some of Mav's brew to Gnor Farven.")
  37. -- Mav's Brew
  38. if HasItem(Player, 9383) then
  39. RemoveItem(Player, 9383)
  40. end
  41. if QuestIsComplete(Player, CHEERS_QUEST) then
  42. SpokeWithAllFriends(Quest, QuestGiver, Player)
  43. end
  44. end
  45. function Step3_Complete_SpokeWithGurna(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 3, "I have given some of Mav's brew to Gurna Hadel.")
  47. -- Mav's Brew
  48. if HasItem(Player, 9383) then
  49. RemoveItem(Player, 9383)
  50. end
  51. if QuestIsComplete(Player, CHEERS_QUEST) then
  52. SpokeWithAllFriends(Quest, QuestGiver, Player)
  53. end
  54. end
  55. function Step4_Complete_SpokeWithDunda(Quest, QuestGiver, Player)
  56. UpdateQuestStepDescription(Quest, 4, "I have given some of Mav's brew to Dunda Frostgrip.")
  57. -- Mav's Brew
  58. if HasItem(Player, 9383) then
  59. RemoveItem(Player, 9383)
  60. end
  61. if QuestIsComplete(Player, CHEERS_QUEST) then
  62. SpokeWithAllFriends(Quest, QuestGiver, Player)
  63. end
  64. end
  65. function SpokeWithAllFriends(Quest, QuestGiver, Player)
  66. UpdateQuestTaskGroupDescription(Quest, 2, "I have given samples of Mav's brew to a number of people around Graystone Yard.")
  67. AddQuestStepChat(Quest, 5, "I need to speak with Mav Boilfist.", 1, "I should return to Mav and let her know what everyone thought of her brew.", 0, 2350016)
  68. AddQuestStepCompleteAction(Quest, 5, "Quest_Complete")
  69. end
  70. function Quest_Complete(Quest, QuestGiver, Player)
  71. UpdateQuestStepDescription(Quest, 5, "I have spoken with Mav Boilfist.")
  72. UpdateQuestTaskGroupDescription(Quest, 3, "I have given Mav the rest of her brew.")
  73. GiveQuestReward(Quest, Player)
  74. UpdateQuestDescription(Quest, "I have given some of Mav's brew to those who wanted to try it. I then told Mav about their reactions, she seemed pleased.")
  75. end
  76. function Reload(Quest, QuestGiver, Player, Step)
  77. if Step == 1 then
  78. Step1_Complete_GotBrewFromKeg(Quest, QuestGiver, Player)
  79. elseif Step == 2 then
  80. Step2_Complete_SpokeWithGnor(Quest, QuestGiver, Player)
  81. elseif Step == 3 then
  82. Step3_Complete_SpokeWithGurna(Quest, QuestGiver, Player)
  83. elseif Step == 4 then
  84. Step4_Complete_SpokeWithDunda(Quest, QuestGiver, Player)
  85. end
  86. end