TinkererSpindlecog.lua 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/TinkererSpindlecog.lua
  3. Script Purpose : Tinkerer Spindlecog
  4. Script Author : Dorbin
  5. Script Date : 2022.01.21
  6. Script Notes : Speaking Gnomish
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/UnknownLanguage.lua") --added 2022.03.13 Dorbin
  10. local SpindleCogQuest = 5447
  11. function spawn(NPC)
  12. ProvidesQuest(NPC, SpindleCogQuest)
  13. conversation = CreateConversation()
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function hailed(NPC, Spawn)
  19. if GetFactionAmount(Spawn,11)<0 then
  20. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  21. else
  22. FaceTarget(NPC, Spawn)
  23. if not HasLanguage(Spawn, 6) then -- Hailed Language Check
  24. Garbled(NPC,Spawn)
  25. else --Provides quest checks
  26. if not HasCompletedQuest (Spawn, SpindleCogQuest) and not HasQuest (Spawn, SpindleCogQuest) then
  27. FaceTarget(NPC, Spawn)
  28. Dialog.New(NPC, Spawn)
  29. Dialog.AddDialog("Errgh... If only I could get this blasted stamping mechanism working again! What a pity! I really need this confounded contraption to run smoothly!")
  30. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog001.mp3", 1759041547, 1110190424)
  31. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  32. Dialog.AddLanguage(6)
  33. Dialog.AddOption("What would you need the stamping device for anyway?", "Stamping")
  34. Dialog.AddOption("Yes, a pity indeed. ")
  35. Dialog.Start()
  36. elseif GetQuestStep (Spawn, SpindleCogQuest) <=2 then
  37. conversation = CreateConversation()
  38. FaceTarget(NPC, Spawn)
  39. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog009.mp3", "", "ponder", 575428579, 1524232466, Spawn)
  40. if GetQuestStep (Spawn, SpindleCogQuest) == 2 then
  41. AddConversationOption(conversation, "Here are the sinews.", "QuestStep2")
  42. else
  43. AddConversationOption(conversation, "Not yet. I'll be back later.")
  44. end
  45. StartConversation(conversation, NPC, Spawn, "Have you gotten the sinews I need?")
  46. elseif GetQuestStep (Spawn, SpindleCogQuest) == 3 or GetQuestStep (Spawn, SpindleCogQuest) == 4 then
  47. conversation = CreateConversation()
  48. FaceTarget(NPC, Spawn)
  49. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  50. if GetQuestStep (Spawn, SpindleCogQuest) == 4 then
  51. AddConversationOption(conversation, "Here is the grease you asked for.", "QuestStep4")
  52. else
  53. AddConversationOption(conversation, "Not yet. I'll be back later.")
  54. end
  55. StartConversation(conversation, NPC, Spawn, "I still need the grease! Any luck finding some?")
  56. elseif GetQuestStep (Spawn, SpindleCogQuest) == 5 or GetQuestStep (Spawn, SpindleCogQuest) == 6 then
  57. conversation = CreateConversation()
  58. FaceTarget(NPC, Spawn)
  59. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  60. if GetQuestStep (Spawn, SpindleCogQuest) == 6 then
  61. AddConversationOption(conversation, "Here is the ink you asked for.", "QuestFinish")
  62. else
  63. AddConversationOption(conversation, "Not yet. I'll be back later.")
  64. end
  65. StartConversation(conversation, NPC, Spawn, "All I'm lacking is ink! Have you found some yet?")
  66. elseif HasCompletedQuest(Spawn, SpindleCogQuest) then
  67. conversation = CreateConversation()
  68. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  69. conversation = CreateConversation()
  70. FaceTarget(NPC, Spawn)
  71. AddConversationOption(conversation, "Well, hopefully the components will help.")
  72. AddConversationOption(conversation, "I'll just be... over here.")
  73. StartConversation(conversation, NPC, Spawn, "No matter what I do it just won't work! Oh well, I'll keep on it. They don't call me Tinkerer Spindlecog for nothing!")
  74. end
  75. end
  76. end
  77. end
  78. function Stamping(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("For part of my official duties that I can't tell you about! No matter how rudimentary the system, all government officials must be mysterious about what they do--didn't you know? Someday, I might need to officially stamp something! Say, maybe you can help me!")
  82. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog002.mp3", 233880122, 4191683346)
  83. Dialog.AddLanguage(6)
  84. Dialog.AddOption("Well, all right, I'll help you. Have you thought about doing it manually?", "Dialog3")
  85. Dialog.AddOptionRequirement(REQ_LEVEL_GREATER_OR_EQUAL, 20)
  86. Dialog.AddOption("I'm afraid I can't right now. Good luck getting it fixed. ")
  87. Dialog.Start()
  88. end
  89. function QuestStart(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. OfferQuest(NPC, Spawn, SpindleCogQuest)
  92. end
  93. function Dialog3(NPC, Spawn)
  94. FaceTarget(NPC, Spawn)
  95. Dialog.New(NPC, Spawn)
  96. Dialog.AddDialog("Of course not! That's horribly inefficient! Why would I ever do something by hand when I can build a machine to do it for me? If I could only connect these two ... Ah! Brilliant! Brilliant! Let me jot this down for you, and once you get this stuff, bring it back straightaway! It's a bit of a trek, but I'm sure you are up to the challenge!")
  97. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog003.mp3", 2508515239, 4260547544)
  98. Dialog.AddLanguage(6)
  99. Dialog.AddOption("I'll see what I can do.", "QuestStart")
  100. Dialog.AddOption("Actually... I should get my affairs in order. Good luck!")
  101. Dialog.Start()
  102. end
  103. function QuestStep2(NPC, Spawn)
  104. FaceTarget(NPC, Spawn)
  105. Dialog.New(NPC, Spawn)
  106. Dialog.AddDialog("Splendid! Now let's see ... I can use this to wind around these two spindles here ... yes, yes ... perfect! Now that you work for me, you can get me grease so it'll run smoothly! Lucky for you, I planned ahead ... everything I need is on this list. Splendid! Now, off again with you. Go on!")
  107. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog004.mp3",1204035343, 2271829644)
  108. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  109. Dialog.AddLanguage(6)
  110. Dialog.AddOption("I'll be back with these items.", "QuestStep3")
  111. Dialog.AddOption("Try not to blow anything up.","QuestStep3")
  112. Dialog.Start()
  113. end
  114. function QuestStep4(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. Dialog.New(NPC, Spawn)
  117. Dialog.AddDialog("Ah, yes YES! This works perfectly! Just a little here... a little there... wait! I need ink! How am I suppose to stamp without ink?! Here. Take this list and find some ink for me. This is it!")
  118. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog004.mp3",1204035343, 2271829644)
  119. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  120. Dialog.AddLanguage(6)
  121. Dialog.AddOption("I'll be back with these items.","QuestStep5")
  122. Dialog.AddOption("More? This is it! No more after this!","QuestStep5")
  123. Dialog.Start()
  124. end
  125. function QuestFinish(NPC, Spawn)
  126. FaceTarget(NPC, Spawn)
  127. Dialog.New(NPC, Spawn)
  128. Dialog.AddDialog("This is it! The final piece I need to complete my machine. Thank you for everything you've done. Now... I must put this together... very carefully...")
  129. -- Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog005.mp3",0, 0)
  130. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  131. Dialog.AddLanguage(6)
  132. Dialog.AddOption("Was that enough to finish it?","QuestPreReward")
  133. Dialog.AddOption("Finally!","QuestPreReward")
  134. Dialog.Start()
  135. end
  136. function QuestPreReward(NPC, Spawn)
  137. PlayFlavor(NPC, "", "", "explosion", 0, 0, Spawn)
  138. AddTimer(NPC,1600,"QuestPreReward2",Spawn)
  139. end
  140. function QuestPreReward2(NPC, Spawn)
  141. PlayAnimation(NPC,"11764", Spawn)
  142. conversation = CreateConversation()
  143. FaceTarget(NPC, Spawn)
  144. AddConversationOption(conversation, "Are you alright?","QuestPreReward2")
  145. AddConversationOption(conversation, "Whoa!","QuestPreReward2")
  146. StartConversation(conversation, NPC, Spawn, "Uhhhg...")
  147. end
  148. function QuestPreReward2(NPC, Spawn)
  149. conversation = CreateConversation()
  150. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  151. FaceTarget(NPC, Spawn)
  152. AddConversationOption(conversation, "Thank you, and good luck!","QuestReward")
  153. AddConversationOption(conversation, "Thank you for not blowing me up as well.","QuestReward")
  154. StartConversation(conversation, NPC, Spawn, "No matter what I do it just won't work! Oh well, I'll keep on it. They don't call me Tinkerer Spindlecog for nothing! Here, please take this for all your help.")
  155. end
  156. function QuestStep3(NPC, Spawn)
  157. SetStepComplete(Spawn, SpindleCogQuest, 2)
  158. end
  159. function QuestStep5(NPC, Spawn)
  160. SetStepComplete(Spawn, SpindleCogQuest, 4)
  161. end
  162. function QuestReward(NPC, Spawn)
  163. SetStepComplete(Spawn, SpindleCogQuest, 6)
  164. end