ShippingCoordinatorHando.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. --[[
  2. Script Name : SpawnScripts/Graystone/ShippingCoordinatorHando.lua
  3. Script Purpose : Shipping Coordinator Hando
  4. Script Author : Scatman
  5. Script Date : 2009.10.05
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericVoiceOvers.lua")
  9. -- Quest ID's
  10. local DWARF_MENTOR_QUEST_3 = 286
  11. local LATESHIPMENT = 290
  12. local INTHEDRINK = 291
  13. -- Item ID's
  14. local LOCATION_BUOYS = 9109
  15. function spawn(NPC)
  16. ProvidesQuest(NPC, INTHEDRINK)
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. conversation = CreateConversation()
  24. GenericHail(NPC, Spawn)
  25. if HasCompletedQuest(Spawn, LATESHIPMENT) then
  26. if HasCompletedQuest(Spawn, INTHEDRINK) then
  27. GreatJobOnBuoys(NPC, Spawn, conversation)
  28. elseif HasQuest(Spawn, INTHEDRINK) then
  29. if GetQuestStep(Spawn, INTHEDRINK) >= 1 and GetQuestStep(Spawn, INTHEDRINK) <= 3 then
  30. DoesntLookAllConnectedYet(NPC, Spawn, conversation)
  31. else
  32. GreatJobOnBuoys(NPC, Spawn, conversation)
  33. end
  34. else
  35. WhatDidMarusSay(NPC, Spawn, conversation)
  36. end
  37. elseif HasQuest(Spawn, LATESHIPMENT) then
  38. if GetQuestStep(Spawn, LATESHIPMENT) == 3 then
  39. BusyWithQuest(NPC, Spawn, conversation)
  40. elseif GetQuestStep(Spawn, LATESHIPMENT) == 4 or GetQuestStep(Spawn, LATESHIPMENT) == 5 then
  41. FindWhatYouNeeded(NPC, Spawn, conversation)
  42. elseif GetQuestStep(Spawn, LATESHIPMENT) >= 6 then
  43. WhatDidMarusSay(NPC, Spawn, conversation)
  44. else
  45. Say(NPC, "Kind of busy at the moment, sorry.", Spawn)
  46. end
  47. elseif HasQuest(Spawn, DWARF_MENTOR_QUEST_3) and GetQuestStep(Spawn, DWARF_MENTOR_QUEST_3) <= 3 then
  48. OnDwarfMentorQuest3(NPC, Spawn, conversation)
  49. else
  50. Say(NPC, "Kind of busy at the moment, sorry.", Spawn)
  51. end
  52. end
  53. ------------------------------------------------------------------------------------------------------------
  54. -- BARBARIAN MENTOR QUEST
  55. ------------------------------------------------------------------------------------------------------------
  56. function BusyWithQuest(NPC, Spawn, conversation)
  57. AddConversationOption(conversation, "I need to talk to you about a missing package for Burk Stoneshatter.", "dlg_16_1")
  58. StartConversation(conversation, NPC, Spawn, "Listen, I'm sure sitting around chewing the fat with you is a great way to pass the time, but I'm busy here and can't be bothered with small talk.")
  59. end
  60. function FindWhatYouNeeded(NPC, Spawn, conversation)
  61. if GetQuestStep(Spawn, LATESHIPMENT) == 5 then
  62. AddConversationOption(conversation, "No, it's not in the shipments on the dock.", "dlg_18_1")
  63. end
  64. AddConversationOption(conversation, "I haven't looked yet.")
  65. StartConversation(conversation, NPC, Spawn, "Did you find what you needed?")
  66. end
  67. function dlg_16_1(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. conversation = CreateConversation()
  70. AddConversationOption(conversation, "Shipment GG4QC isn't listed on your overflow manifest, and it hasn't been delivered yet.", "dlg_16_2")
  71. StartConversation(conversation, NPC, Spawn, "Burk, eh? What's he need?")
  72. end
  73. function dlg_16_2(NPC, Spawn)
  74. SetStepComplete(Spawn, LATESHIPMENT, 3)
  75. FaceTarget(NPC, Spawn)
  76. conversation = CreateConversation()
  77. AddConversationOption(conversation, "Thank you.")
  78. StartConversation(conversation, NPC, Spawn, "Yeah, all new packages will be on the docks until we can move em. Go check the crates at the end of the docks and these here. I'm sure you'll find what you're looking for. Right now there are 13 crates and barrels on the docks to check in. Bring it to me once you've found it.")
  79. end
  80. function dlg_18_1(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. conversation = CreateConversation()
  83. AddConversationOption(conversation, "The shipment number was GG4QC.", "dlg_18_2")
  84. StartConversation(conversation, NPC, Spawn, "What shipment number was it again?")
  85. end
  86. function dlg_18_2(NPC, Spawn)
  87. FaceTarget(NPC, Spawn)
  88. conversation = CreateConversation()
  89. AddConversationOption(conversation, "I'm positive it wasn't on the docks.", "dlg_18_3")
  90. StartConversation(conversation, NPC, Spawn, "Hmm. According to the charts that was unloaded but never sent into overflow... and never delivered. If it's not at the end of the docks then something is wrong.")
  91. end
  92. function dlg_18_3(NPC, Spawn)
  93. SetStepComplete(Spawn, LATESHIPMENT, 5)
  94. FaceTarget(NPC, Spawn)
  95. conversation = CreateConversation()
  96. AddConversationOption(conversation, "All right, I'll speak to him.")
  97. StartConversation(conversation, NPC, Spawn, "I believe you. You're going to need to talk to the dock loader. You would never think it, looking at him, but he's got a great mind for remembering numbers. He'll tell you whether or not the packages were unloaded. His name is Marus Donoval, you can find him in the tavern, on the ground floor of the inn.")
  98. end
  99. function WhatDidMarusSay(NPC, Spawn, conversation)
  100. if (HasCompletedQuest(Spawn, LATESHIPMENT) and not HasCompletedQuest(Spawn, INTHEDRINK)) or (HasQuest(Spawn, LATESHIPMENT) and GetQuestStep(Spawn, LATESHIPMENT) == 7) then
  101. AddConversationOption(conversation, "He said the shipment was off-loaded. He says it's possible it may have fallen in the water.", "dlg_21_1")
  102. end
  103. AddConversationOption(conversation, "I haven't talked to him yet.")
  104. StartConversation(conversation, NPC, Spawn, "What did Marus have to say?")
  105. end
  106. function dlg_21_1(NPC, Spawn)
  107. if HasQuest(Spawn, LATESHIPMENT) then
  108. SetStepComplete(Spawn, LATESHIPMENT, 7)
  109. end
  110. FaceTarget(NPC, Spawn)
  111. conversation = CreateConversation()
  112. AddConversationOption(conversation, "No...", "dlg_21_2")
  113. AddConversationOption(conversation, "Yes, I am, actually. Sorry.")
  114. StartConversation(conversation, NPC, Spawn, "It's starting to look that way, unfortunately. Listen, you aren't afraid of the water, are you?")
  115. end
  116. ------------------------------------------------------------------------------------------------
  117. -- QUEST 3
  118. ------------------------------------------------------------------------------------------------
  119. function dlg_21_2(NPC, Spawn)
  120. FaceTarget(NPC, Spawn)
  121. conversation = CreateConversation()
  122. AddConversationOption(conversation, "Sure, I can do that.", "dlg_21_3")
  123. AddConversationOption(conversation, "Not a chance.")
  124. StartConversation(conversation, NPC, Spawn, "The shipment must be down there, somewhere. How would you like to help us retrieve it?")
  125. end
  126. function dlg_21_3(NPC, Spawn)
  127. FaceTarget(NPC, Spawn)
  128. conversation = CreateConversation()
  129. AddConversationOption(conversation, "All right!", "OfferQuest3")
  130. StartConversation(conversation, NPC, Spawn, "Great! Here, take these location buoys. Swim down into the water and find the missing shipment crates, there were three of them. Attach a location buoy to each crate, then swim back here while we pull them out.")
  131. end
  132. function OfferQuest3(NPC, Spawn)
  133. FaceTarget(NPC, Spawn)
  134. OfferQuest(NPC, Spawn, INTHEDRINK)
  135. end
  136. function DoesntLookAllConnectedYet(NPC, Spawn, conversation)
  137. AddConversationOption(conversation, "I need more location buoys.", "MoreBuoys")
  138. StartConversation(conversation, NPC, Spawn, "It doesn't look like they're all connected yet, come back when that's done.")
  139. end
  140. function MoreBuoys(NPC, Spawn)
  141. FaceTarget(NPC, Spawn)
  142. conversation = CreateConversation()
  143. -- Location Buoys
  144. if HasItem(Spawn, LOCATION_BUOYS, 1) then
  145. AddConversationOption(conversation, "All right.")
  146. StartConversation(conversation, NPC, Spawn, "It looks like you've already got them. Check your bags, maybe even your bank.")
  147. else
  148. SummonItem(Spawn, LOCATION_BUOYS, 1)
  149. AddConversationOption(conversation, "Thanks.")
  150. StartConversation(conversation, NPC, Spawn, "Sure, here you go.")
  151. end
  152. end
  153. function GreatJobOnBuoys(NPC, Spawn, conversation)
  154. if HasQuest(Spawn, INTHEDRINK) and GetQuestStep(Spawn, INTHEDRINK) == 4 then
  155. AddConversationOption(conversation, "Thanks.", "dlg_25_1")
  156. else
  157. AddConversationOption(conversation, "Thanks.")
  158. end
  159. StartConversation(conversation, NPC, Spawn, "Hey, great job with those buoys.")
  160. end
  161. function dlg_25_1(NPC, Spawn)
  162. SetStepComplete(Spawn, INTHEDRINK, 4)
  163. FaceTarget(NPC, Spawn)
  164. conversation = CreateConversation()
  165. AddConversationOption(conversation, "Great, thank you.", "dlg_25_2")
  166. StartConversation(conversation, NPC, Spawn, "We've already pulled up the first package. Burk's shipment was inside. Here, you can take it to him.")
  167. end
  168. function dlg_25_2(NPC, Spawn)
  169. FaceTarget(NPC, Spawn)
  170. conversation = CreateConversation()
  171. AddConversationOption(conversation, "You're welcome.")
  172. StartConversation(conversation, NPC, Spawn, "No, thank you. You've been very helpful. We're so backlogged around here we may have not known about the missing shipment for weeks. Some of the cargo was still ruined, but we saved a lot more than we would have been able to, thanks to you. I really appreciate it.")
  173. end
  174. ------------------------------------------------------------------------------------------------------------
  175. -- DWARF MENTOR QUEST
  176. ------------------------------------------------------------------------------------------------------------
  177. function OnDwarfMentorQuest3(NPC, Spawn, conversation)
  178. if GetQuestStep(Spawn, DWARF_MENTOR_QUEST_3) == 1 then
  179. AddConversationOption(conversation, "I'm here to pick up a package for Mav Boilfist.", "dlg_22_1")
  180. StartConversation(conversation, NPC, Spawn, "Interruption after interruption! What do you want?")
  181. else
  182. if GetQuestStep(Spawn, DWARF_MENTOR_QUEST_3) == 3 then
  183. AddConversationOption(conversation, "Yes. It's right here.", "dlg_29_1")
  184. end
  185. AddConversationOption(conversation, "Not yet.")
  186. StartConversation(conversation, NPC, Spawn, "Did you find it?")
  187. end
  188. end
  189. function dlg_22_1(NPC, Spawn)
  190. FaceTarget(NPC, Spawn)
  191. conversation = CreateConversation()
  192. PlayFlavor(NPC, "","", "doh", 0, 0)
  193. AddConversationOption(conversation, "It should have just arrived. It's a package from the Baubbleshire.", "dlg_22_2")
  194. StartConversation(conversation, NPC, Spawn, "Arg! Her packages are backlogged already, what do you need?")
  195. end
  196. function dlg_22_2(NPC, Spawn)
  197. SetStepComplete(Spawn, DWARF_MENTOR_QUEST_3, 1)
  198. FaceTarget(NPC, Spawn)
  199. conversation = CreateConversation()
  200. AddConversationOption(conversation, "All right, thank you.")
  201. StartConversation(conversation, NPC, Spawn, "Newly arrived packages are at the end of the dock. Go check there. Bring it to me if you find it.")
  202. end
  203. function dlg_29_1(NPC, Spawn)
  204. SetStepComplete(Spawn, DWARF_MENTOR_QUEST_3, 3)
  205. FaceTarget(NPC, Spawn)
  206. conversation = CreateConversation()
  207. PlayFlavor(NPC, "","", "thanks", 0, 0)
  208. AddConversationOption(conversation, "That is okay, and thank you.")
  209. StartConversation(conversation, NPC, Spawn, "All right, this all seems to be in order. Sorry for snapping at you, it's been a busy week.")
  210. end