a_family_recipe.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. --[[
  2. Script Name : Quests/Graystone/a_family_recipe.lua
  3. Script Purpose : Handles the quest, "A Family Recipe"
  4. Script Author : Scatman
  5. Script Date : 2009.10.05
  6. Zone : Graystone Yard
  7. Quest Giver: Mav Boilfist
  8. Preceded by: None
  9. Followed by: Cheers! (cheers.lua)
  10. Modified by: Ememjr
  11. Mod Date: 5/14/20
  12. Notes : added code for randomizing the items, based notes n zam, but still verifying thoses notes are correct or not
  13. --]]
  14. local AFamilyRecipe = 283
  15. local item1 = nil
  16. local item2 = nil
  17. local item3 = nil
  18. local a = {}
  19. local b = {}
  20. local c = {0,0,342,770,0,357}
  21. local d = {"3CF0F", "3CF1G", "2DF0F", "4QGCG", "CC4QF", "QGC4F"}
  22. table.insert(a,"I need to acquire some [1111]. 3CF0F is the shipping number.")
  23. table.insert(a, "I need to acquire some [2222]. 3CF1G is the shipping number.")
  24. table.insert(a, "I need to acquire some yeast. 2DF0F is the shipping number.")
  25. table.insert(a, "I need to acquire some Frozen Cherries. 4QGCG is the shipping number.")
  26. table.insert(a, "I need to acquire some [5555]. 3CF0F is the shipping number.")
  27. table.insert(a, "I need to acquire some honey. QGC4F is the shipping number.")
  28. table.insert(b, "I have acquired some [1111].")
  29. table.insert(b, "I have acquired some [2222].")
  30. table.insert(b, "I have acquired some yeast.")
  31. table.insert(b, "I have acquired Frozen Cherries.")
  32. table.insert(b, "I have acquired some [5555].")
  33. table.insert(b, "I have acquired some honey.")
  34. function Init(Quest)
  35. if item1 == nil then
  36. item1 = 4
  37. item2 = 3
  38. item3 = 6
  39. end
  40. AddQuestStep(Quest, 1, a[item1] , 1, 100, "I must collect the needed ingredients for Mav Boilfist. I will need to refer to the overflow shipping manifest she gave me to determine where the items are located.", c[item1])
  41. AddQuestStep(Quest, 2, a[item2] , 1, 100, "I must collect the needed ingredients for Mav Boilfist. I will need to refer to the overflow shipping manifest she gave me to determine where the items are located.", c[item2])
  42. AddQuestStep(Quest, 3, a[item3] , 1, 100, "I must collect the needed ingredients for Mav Boilfist. I will need to refer to the overflow shipping manifest she gave me to determine where the items are located.", c[item3])
  43. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete")
  44. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete")
  45. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete")
  46. end
  47. function Accepted(Quest, QuestGiver, Player)
  48. FaceTarget(QuestGiver, Player)
  49. conversation = CreateConversation()
  50. -- Overflow Manifest
  51. if not HasItem(Player, 10268, 1) then
  52. SummonItem(Player, 10268, 1)
  53. end
  54. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/mav_boilfist/qey_village03/quests/mav_boilfist/mav_boilfist010.mp3", "", "", 2473952435, 2751712477, Player)
  55. AddConversationOption(conversation, "I'll go look for them.")
  56. StartConversation(conversation, QuestGiver, Player, "It shouldn't be too hard. The orders you're looking for are " .. d[item1] ..", " .. d[item2] ..", " .. d[item2] )
  57. end
  58. function Declined(Quest, QuestGiver, Player)
  59. end
  60. function Step1_Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 1, b[item1] )
  62. -- if QuestIsComplete(Player, AFamilyRecipe) then
  63. FoundAllItems(Quest, QuestGiver, Player)
  64. -- end
  65. end
  66. function Step2_Complete(Quest, QuestGiver, Player)
  67. UpdateQuestStepDescription(Quest, 2, b[item2] )
  68. -- if QuestIsComplete(Player, AFamilyRecipe) then
  69. FoundAllItems(Quest, QuestGiver, Player)
  70. -- end
  71. end
  72. function Step3_Complete(Quest, QuestGiver, Player)
  73. UpdateQuestStepDescription(Quest, 3, b[item3])
  74. -- if QuestIsComplete(Player, AFamilyRecipe) then
  75. FoundAllItems(Quest, QuestGiver, Player)
  76. -- end
  77. end
  78. function FoundAllItems(Quest, QuestGiver, Player)
  79. if QuestStepIsComplete(Player,283,1) and QuestStepIsComplete(Player,283,2) and QuestStepIsComplete(Player,283,3) then
  80. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected all of the needed ingredients.")
  81. AddQuestStepChat(Quest, 4, "I need to bring all of these components to Mav Boilfist near the docks.", 1, "I need to bring these ingredients to Mav Boilfist in Graystone Yard.", 0, 2350016)
  82. AddQuestStepCompleteAction(Quest, 4, "Quest_Complete")
  83. end
  84. end
  85. function Quest_Complete(Quest, QuestGiver, Player)
  86. UpdateQuestStepDescription(Quest, 4, "I have given Mav all of the components she requested.")
  87. UpdateQuestTaskGroupDescription(Quest, 2, "I have given Mav the ingredients she asked for.")
  88. -- Overflow Manifest
  89. while HasItem(Player, 10268) do
  90. RemoveItem(Player, 10268)
  91. end
  92. GiveQuestReward(Quest, Player)
  93. UpdateQuestDescription(Quest, "I have collected the ingredients for Mav and returned them to her.")
  94. end
  95. function Reload(Quest, QuestGiver, Player, Step)
  96. if Step == 1 then
  97. Step1_Complete(Quest, QuestGiver, Player)
  98. elseif Step == 2 then
  99. Step2_Complete(Quest, QuestGiver, Player)
  100. elseif Step == 3 then
  101. Step3_Complete(Quest, QuestGiver, Player)
  102. end
  103. end