EmmaTorque.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. --[[
  2. Script Name : SpawnScripts/Caves/EmmaTorque.lua
  3. Script Purpose : Emma Torque <Field Engineer>
  4. Script Author : Scatman
  5. Script Date : 2009.10.18
  6. Script Notes :
  7. --]]
  8. local QUEST1_FROM_CONSULBREE = 361
  9. local QUEST3_FROM_CONSULBREE = 494
  10. local QUEST4_FROM_CONSULBREE = 495
  11. local QUEST_1 = 496
  12. local QUEST_2 = 497
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, QUEST_1)
  15. ProvidesQuest(NPC, QUEST_2)
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. conversation = CreateConversation()
  23. -- her quests require QUEST1_FROM_CONSULBREE to be completed first
  24. if HasQuest(Spawn, QUEST3_FROM_CONSULBREE) then
  25. if GetQuestStep(Spawn, QUEST3_FROM_CONSULBREE) == 1 then
  26. AddConversationOption(conversation, "Consul Bree sent me to you. I need a river stone.", "dlg_17_1")
  27. -- Drawing Ray
  28. elseif not HasItem(Spawn, 46016) then
  29. AddConversationOption(conversation, "I need the Drawing Ray.", "dlg_17_2")
  30. end
  31. end
  32. if HasCompletedQuest(Spawn, QUEST1_FROM_CONSULBREE) then
  33. if HasCompletedQuest(Spawn, QUEST_1) then
  34. if HasCompletedQuest(Spawn, QUEST_2) then
  35. if HasCompletedQuest(Spawn, QUEST4_FROM_CONSULBREE) then
  36. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/qst_emma_done_3b19b0b7.mp3", "Fulkoir had a great mind, but a poor, poor heart.", "", 4051073368, 1187972437, Spawn)
  37. else
  38. OnQuest2(NPC, Spawn, conversation)
  39. end
  40. elseif HasQuest(Spawn, QUEST_2) then
  41. OnQuest2(NPC, Spawn, conversation)
  42. else
  43. OnQuest1(NPC, Spawn, conversation)
  44. end
  45. elseif HasQuest(Spawn, QUEST_1) then
  46. OnQuest1(NPC, Spawn, conversation)
  47. else
  48. HaveAlmostEverything(NPC, Spawn, conversation)
  49. end
  50. elseif HasQuest(Spawn, QUEST1_FROM_CONSULBREE) then
  51. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/qst_emma_notready_aeac255d.mp3", "Once Consul Bree gets me the information she promised me I'll be able to design these charges! Maybe you can help her.", "", 2803218058, 1631284097, Spawn)
  52. else
  53. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/qst_emma_notready_aeac255d.mp3", "Once Consul Bree gets me the information she promised me I'll be able to design these charges! Maybe you can help her.", "", 2803218058, 1631284097, Spawn)
  54. end
  55. end
  56. -------------------------------------------------------------------------------------------------------------------
  57. -- QUEST 3 FROM CONSUL BREE
  58. -------------------------------------------------------------------------------------------------------------------
  59. function dlg_17_1(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. conversation = CreateConversation()
  62. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_bree_000.mp3", "", "", 1968235016, 878780365, Spawn)
  63. AddConversationOption(conversation, "May I have one?", "dlg_17_2")
  64. StartConversation(conversation, NPC, Spawn, "Ah, yes. She had me studying those a while back. Very complicated procedure to draw the stone from a river behemoth. You need to kill one and then, from its remains, you can draw the stone to the surface. After that it is as simple as grabbing it. You'll need a Drawing Ray--one of my inventions--to get it.")
  65. end
  66. function dlg_17_2(NPC, Spawn)
  67. SetStepComplete(Spawn, QUEST3_FROM_CONSULBREE, 1)
  68. FaceTarget(NPC, Spawn)
  69. conversation = CreateConversation()
  70. -- Drawing Ray
  71. if not HasItem(Spawn, 46016) then
  72. SummonItem(Spawn, 46016, 1)
  73. SendMessage(Spawn, "You receive [Drawing Ray].")
  74. end
  75. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_ray.mp3", "", "", 98468078, 2274575394, Spawn)
  76. AddConversationOption(conversation, "Thanks, I guess.")
  77. StartConversation(conversation, NPC, Spawn, "Sure. Be careful with it. I don't think it will explode and kill you, but I also don't want you using it anywhere near me.")
  78. end
  79. -------------------------------------------------------------------------------------------------------------------
  80. -- QUEST 1
  81. -------------------------------------------------------------------------------------------------------------------
  82. function HaveAlmostEverything(NPC, Spawn)
  83. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_000.mp3", "", "", 1365042533, 2322859650, Spawn)
  84. AddConversationOption(conversation, "Destruction?", "dlg_12_1")
  85. AddConversationOption(conversation, "I have to go.")
  86. StartConversation(conversation, NPC, Spawn, "I have almost everything I need! You know, most of my people are so preoccupied with creation that they forget to see the value in proper destruction.")
  87. end
  88. function dlg_12_1(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. conversation = CreateConversation()
  91. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_001.mp3", "", "", 961712587, 2002405652, Spawn)
  92. AddConversationOption(conversation, "To demolish?", "dlg_12_2")
  93. StartConversation(conversation, NPC, Spawn, "Oh? Are you a fan of destruction? The elegant need for precise calculation is unobserved to many, but demolitions are not something suited to an ogre mind. Real demolitions, I mean. Sure an ogre can smash all he wants, but with a fraction of that effort a correctly placed explosive charge can render far more damage. That is why I am here.")
  94. end
  95. function dlg_12_2(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. conversation = CreateConversation()
  98. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_002.mp3", "", "", 3590999842, 100037735, Spawn)
  99. AddConversationOption(conversation, "What kind of machines?", "dlg_12_3")
  100. StartConversation(conversation, NPC, Spawn, "Consul Bree asked for me. Well, not me specifically, but the Engineering Guild knew I was perfect for the job. These gnolls have come across some terrible machines, " .. GetName(Spawn) .. ".")
  101. end
  102. function dlg_12_3(NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. conversation = CreateConversation()
  105. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_003.mp3", "", "", 3625869581, 925115546, Spawn)
  106. AddConversationOption(conversation, "When will you be ready?", "dlg_12_4")
  107. StartConversation(conversation, NPC, Spawn, "Devices that can be used to tunnel through rock with the speed of dynamite, but the subtlety of manual labor. I have reason to believe that these machines--among others--were provided to the gnolls by Freeportians. A pair of gnomes: Fulkoir and Fluwkowir Haggleton. Consul Bree has seen the machines, that is why she has called for me. And I'm almost ready to move.")
  108. end
  109. function dlg_12_4(NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. conversation = CreateConversation()
  112. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_004.mp3", "", "", 1144754177, 2806670128, Spawn)
  113. AddConversationOption(conversation, "How can I help?", "dlg_12_5")
  114. StartConversation(conversation, NPC, Spawn, "As soon as I get a large enough collection of blasting powder. I have enough for the smaller devices, those that Consul Bree will be able to take care of--my precision won't really be needed. But the Freeportian gnomes have finished construction on two monstrous machines. Those machines are here, now in the Caves. And it falls to me to destroy them. But I need help.")
  115. end
  116. function dlg_12_5(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. conversation = CreateConversation()
  119. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_005.mp3", "", "", 2949726626, 4278022809, Spawn)
  120. AddConversationOption(conversation, "All right.", "OfferQuest1")
  121. StartConversation(conversation, NPC, Spawn, "All around here are the wasteful remnants of previous dig projects. You will find copious amounts of blasting powder among the ignored, powdered mineral that is spit out by their digging machines. Collect this powder for me.")
  122. end
  123. function OfferQuest1(NPC, Spawn)
  124. FaceTarget(NPC, Spawn)
  125. OfferQuest(NPC, Spawn, QUEST_1)
  126. end
  127. function OnQuest1(NPC, Spawn, conversation)
  128. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_006.mp3", "", "", 3167880761, 2808104950, Spawn)
  129. if (HasQuest(Spawn, QUEST_1) and GetQuestStep(Spawn, QUEST_1) == 2) or (HasCompletedQuest(Spawn, QUEST_1)) then
  130. AddConversationOption(conversation, "Yes, I have. Here you go.", "dlg_20_1")
  131. else
  132. AddConversationOption(conversation, "No, not yet.")
  133. end
  134. StartConversation(conversation, NPC, Spawn, "Have you collected the powder?")
  135. end
  136. function dlg_20_1(NPC, Spawn)
  137. if HasQuest(Spawn, QUEST_1) then
  138. SetStepComplete(Spawn, QUEST_1, 2)
  139. end
  140. FaceTarget(NPC, Spawn)
  141. conversation = CreateConversation()
  142. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_007.mp3", "", "", 4075800183, 229387878, Spawn)
  143. AddConversationOption(conversation, "I am ready.", "dlg_20_2")
  144. StartConversation(conversation, NPC, Spawn, "Most precise! This will be enough to create both charges. Are you ready to help me again?")
  145. end
  146. -------------------------------------------------------------------------------------------------------------------
  147. -- QUEST 2
  148. -------------------------------------------------------------------------------------------------------------------
  149. function dlg_20_2(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. conversation = CreateConversation()
  152. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_008.mp3", "", "", 3584996398, 1510863126, Spawn)
  153. AddConversationOption(conversation, "I can.", "OfferQuest2")
  154. StartConversation(conversation, NPC, Spawn, "When you find the machines, the 2830 series DDBDs, there should be two of them. For our purposes they are 'A' and 'B.' I doubt they'll even be labeled, but you should know them when you see them. It is important that you place these explosives on the main drive shaft, which is external to the inner workings. It will be outside the hardwood casing, it shouldn't be hard to spot. Consul Bree's information suggests that one of the two gnomes responsible for bringing this technology here is already dead. The remaining gnome, Fulkoir Haggleton, must be stopped. He will be near the Rockpaws, though he may be in hiding. Destroying his machines will certainly draw him out. Can you do this?")
  155. end
  156. function OfferQuest2(NPC, Spawn)
  157. FaceTarget(NPC, Spawn)
  158. OfferQuest(NPC, Spawn, QUEST_2)
  159. end
  160. function OnQuest2(NPC, Spawn, conversation)
  161. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_010.mp3", "", "", 3042855134, 2522255224, Spawn)
  162. if GetQuestStep(Spawn, QUEST_2) == 4 then
  163. AddConversationOption(conversation, "I have done all that you asked.", "dlg_26_1")
  164. end
  165. AddConversationOption(conversation, "Nothing. Bye.")
  166. StartConversation(conversation, NPC, Spawn, "Well?")
  167. end
  168. function dlg_26_1(NPC, Spawn)
  169. FaceTarget(NPC, Spawn)
  170. conversation = CreateConversation()
  171. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_011.mp3", "", "", 3844748719, 1801822798, Spawn)
  172. AddConversationOption(conversation, "Yes, the machines are destroyed and Fulkoir is dead.", "dlg_26_2")
  173. StartConversation(conversation, NPC, Spawn, "Most precise! I heard the explosions from here, I am glad you were not in them and that they were in the proper spots--they WERE in the proper spots, right?")
  174. end
  175. function dlg_26_2(NPC, Spawn)
  176. SetStepComplete(Spawn, QUEST_2, 4)
  177. FaceTarget(NPC, Spawn)
  178. conversation = CreateConversation()
  179. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_012.mp3", "", "", 514277359, 3372853210, Spawn)
  180. AddConversationOption(conversation, "You are welcome.")
  181. StartConversation(conversation, NPC, Spawn, "Great! Consul Bree will be very pleased. You have done the Qeynos Guard a great service, " .. GetName(Spawn) .. ". Take this, please. And thank you.")
  182. end