9
3

TinkererSpindlecog.lua 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. SetInfoStructString(NPC, "action_state", "artificing_idle")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function hailed(NPC, Spawn)
  20. if GetFactionAmount(Spawn,11)<0 then
  21. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  22. else
  23. FaceTarget(NPC, Spawn)
  24. if not HasLanguage(Spawn, 6) then -- Hailed Language Check
  25. Garbled(NPC,Spawn)
  26. else --Provides quest checks
  27. if not HasCompletedQuest (Spawn, SpindleCogQuest) and not HasQuest (Spawn, SpindleCogQuest) then
  28. FaceTarget(NPC, Spawn)
  29. Dialog.New(NPC, Spawn)
  30. 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!")
  31. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog001.mp3", 1759041547, 1110190424)
  32. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  33. Dialog.AddLanguage(6)
  34. Dialog.AddOption("What would you need the stamping device for anyway?", "Stamping")
  35. Dialog.AddOption("Yes, a pity indeed. ")
  36. Dialog.Start()
  37. elseif GetQuestStep (Spawn, SpindleCogQuest) <=2 then
  38. conversation = CreateConversation()
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog009.mp3", "", "ponder", 575428579, 1524232466, Spawn)
  41. if GetQuestStep (Spawn, SpindleCogQuest) == 2 then
  42. AddConversationOption(conversation, "Here are the sinews.", "QuestStep2")
  43. else
  44. AddConversationOption(conversation, "Not yet. I'll be back later.")
  45. end
  46. StartConversation(conversation, NPC, Spawn, "Have you gotten the sinews I need?")
  47. elseif GetQuestStep (Spawn, SpindleCogQuest) == 3 or GetQuestStep (Spawn, SpindleCogQuest) == 4 then
  48. conversation = CreateConversation()
  49. FaceTarget(NPC, Spawn)
  50. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  51. if GetQuestStep (Spawn, SpindleCogQuest) == 4 then
  52. AddConversationOption(conversation, "Here is the grease you asked for.", "QuestStep4")
  53. else
  54. AddConversationOption(conversation, "Not yet. I'll be back later.")
  55. end
  56. StartConversation(conversation, NPC, Spawn, "I still need the grease! Any luck finding some?")
  57. elseif GetQuestStep (Spawn, SpindleCogQuest) == 5 or GetQuestStep (Spawn, SpindleCogQuest) == 6 then
  58. conversation = CreateConversation()
  59. FaceTarget(NPC, Spawn)
  60. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  61. if GetQuestStep (Spawn, SpindleCogQuest) == 6 then
  62. AddConversationOption(conversation, "Here is the ink you asked for.", "QuestFinish")
  63. else
  64. AddConversationOption(conversation, "Not yet. I'll be back later.")
  65. end
  66. StartConversation(conversation, NPC, Spawn, "All I'm lacking is ink! Have you found some yet?")
  67. elseif HasCompletedQuest(Spawn, SpindleCogQuest) then
  68. conversation = CreateConversation()
  69. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  70. conversation = CreateConversation()
  71. FaceTarget(NPC, Spawn)
  72. AddConversationOption(conversation, "Well, hopefully the components will help.")
  73. AddConversationOption(conversation, "I'll just be... over here.")
  74. 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!")
  75. end
  76. end
  77. end
  78. end
  79. function Stamping(NPC, Spawn)
  80. FaceTarget(NPC, Spawn)
  81. Dialog.New(NPC, Spawn)
  82. 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!")
  83. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog002.mp3", 233880122, 4191683346)
  84. Dialog.AddLanguage(6)
  85. Dialog.AddOption("Well, all right, I'll help you. Have you thought about doing it manually?", "Dialog3")
  86. Dialog.AddOptionRequirement(REQ_LEVEL_GREATER_OR_EQUAL, 20)
  87. Dialog.AddOption("I'm afraid I can't right now. Good luck getting it fixed. ")
  88. Dialog.Start()
  89. end
  90. function QuestStart(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. OfferQuest(NPC, Spawn, SpindleCogQuest)
  93. end
  94. function Dialog3(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. Dialog.New(NPC, Spawn)
  97. 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!")
  98. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog003.mp3", 2508515239, 4260547544)
  99. Dialog.AddLanguage(6)
  100. Dialog.AddOption("I'll see what I can do.", "QuestStart")
  101. Dialog.AddOption("Actually... I should get my affairs in order. Good luck!")
  102. Dialog.Start()
  103. end
  104. function QuestStep2(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. Dialog.New(NPC, Spawn)
  107. 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!")
  108. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog004.mp3",1204035343, 2271829644)
  109. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  110. Dialog.AddLanguage(6)
  111. Dialog.AddOption("I'll be back with these items.", "QuestStep3")
  112. Dialog.AddOption("Try not to blow anything up.","QuestStep3")
  113. Dialog.Start()
  114. end
  115. function QuestStep4(NPC, Spawn)
  116. FaceTarget(NPC, Spawn)
  117. Dialog.New(NPC, Spawn)
  118. 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!")
  119. Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog004.mp3",1204035343, 2271829644)
  120. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  121. Dialog.AddLanguage(6)
  122. Dialog.AddOption("I'll be back with these items.","QuestStep5")
  123. Dialog.AddOption("More? This is it! No more after this!","QuestStep5")
  124. Dialog.Start()
  125. end
  126. function QuestFinish(NPC, Spawn)
  127. FaceTarget(NPC, Spawn)
  128. Dialog.New(NPC, Spawn)
  129. 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...")
  130. -- Dialog.AddVoiceover("voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog005.mp3",0, 0)
  131. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  132. Dialog.AddLanguage(6)
  133. Dialog.AddOption("Was that enough to finish it?","QuestPreReward")
  134. Dialog.AddOption("Finally!","QuestPreReward")
  135. Dialog.Start()
  136. end
  137. function QuestPreReward(NPC, Spawn)
  138. PlayFlavor(NPC, "", "", "explosion", 0, 0, Spawn)
  139. AddTimer(NPC,1600,"QuestPreReward2",Spawn)
  140. end
  141. function QuestPreReward2(NPC, Spawn)
  142. PlayAnimation(NPC,"11764", Spawn)
  143. conversation = CreateConversation()
  144. FaceTarget(NPC, Spawn)
  145. AddConversationOption(conversation, "Are you alright?","QuestPreReward2")
  146. AddConversationOption(conversation, "Whoa!","QuestPreReward2")
  147. StartConversation(conversation, NPC, Spawn, "Uhhhg...")
  148. end
  149. function QuestPreReward2(NPC, Spawn)
  150. conversation = CreateConversation()
  151. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  152. FaceTarget(NPC, Spawn)
  153. AddConversationOption(conversation, "Thank you, and good luck!","QuestReward")
  154. AddConversationOption(conversation, "Thank you for not blowing me up as well.","QuestReward")
  155. 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.")
  156. end
  157. function QuestStep3(NPC, Spawn)
  158. SetStepComplete(Spawn, SpindleCogQuest, 2)
  159. end
  160. function QuestStep5(NPC, Spawn)
  161. SetStepComplete(Spawn, SpindleCogQuest, 4)
  162. end
  163. function QuestReward(NPC, Spawn)
  164. SetStepComplete(Spawn, SpindleCogQuest, 6)
  165. end