9
3

TinkererSpindlecog.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. dofile("SpawnScripts/Generic/UnknownLanguage.lua") --added 2022.03.13 Dorbin
  9. local SpindleCogQuest = 5447
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, SpindleCogQuest)
  12. conversation = CreateConversation()
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. FaceTarget(NPC, Spawn)
  19. if not HasLanguage(Spawn, 6) then -- Hailed Language Check
  20. Garbled(NPC,Spawn)
  21. --[[ local choice = math.random(1,2)
  22. if choice == 1 then
  23. PlayFlavor(NPC, "voiceover/english/gnome/ft/gnome/gnome_eco_garble_garbled_gm_cd85a24f.mp3", "garbled text not to be translated", "", 2230728991, 3389119515, Spawn, 6)
  24. elseif choice == 2 then
  25. PlayFlavor(NPC, "voiceover/english/gnome/ft/gnome/gnome_eco_garble_garbled_gm_cd85a24f.mp3", "Prepare! Here come the gnomes!", "", 2230728991, 3389119515, Spawn, 6)
  26. end
  27. --]]
  28. else --Provides quest checks
  29. if not HasCompletedQuest (Spawn, SpindleCogQuest) and not HasQuest (Spawn, SpindleCogQuest) then
  30. FaceTarget(NPC, Spawn)
  31. conversation = CreateConversation()
  32. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog001.mp3", "", "sigh", 1759041547, 1110190424, Spawn)
  33. AddConversationOption(conversation, "What would you need the stamping device for anyway?", "Stamping")
  34. AddConversationOption(conversation, "Yes, a pity indeed. ")
  35. StartConversation(conversation, NPC, Spawn, "Errgh... If only I could get this blasted stamping mechanism working again! What a pity! I really need this confounded contraption to run smoothly!")
  36. --HasQuest (Spawn, SpindleCogQuest) and
  37. elseif GetQuestStep (Spawn, SpindleCogQuest) == 1 then
  38. conversation = CreateConversation()
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  41. AddConversationOption(conversation, "Not yet. I'll be back later.")
  42. StartConversation(conversation, NPC, Spawn, "Have you gotten the sinews I need?")
  43. elseif HasQuest (Spawn, SpindleCogQuest) and GetQuestStep (Spawn, SpindleCogQuest) == 2 then
  44. conversation = CreateConversation()
  45. FaceTarget(NPC, Spawn)
  46. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  47. AddConversationOption(conversation, "Here are the sinews.", "QuestStep2")
  48. AddConversationOption(conversation, "Not yet. I'll be back later.")
  49. StartConversation(conversation, NPC, Spawn, "Have you gotten the sinews I need?")
  50. elseif HasQuest (Spawn, SpindleCogQuest) and GetQuestStep (Spawn, SpindleCogQuest) == 3 then
  51. conversation = CreateConversation()
  52. FaceTarget(NPC, Spawn)
  53. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  54. AddConversationOption(conversation, "Not yet. I'll be back later.")
  55. StartConversation(conversation, NPC, Spawn, "I still need the grease! Any luck finding some?")
  56. elseif HasQuest (Spawn, SpindleCogQuest) and GetQuestStep (Spawn, SpindleCogQuest) == 4 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. AddConversationOption(conversation, "Here is the grease you asked for.", "QuestStep4")
  61. AddConversationOption(conversation, "Not yet. I'll be back later.")
  62. StartConversation(conversation, NPC, Spawn, "I still need the grease! Any luck finding some?")
  63. elseif HasQuest (Spawn, SpindleCogQuest) and GetQuestStep (Spawn, SpindleCogQuest) == 5 then
  64. conversation = CreateConversation()
  65. FaceTarget(NPC, Spawn)
  66. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  67. AddConversationOption(conversation, "Not yet. I'll be back later.")
  68. StartConversation(conversation, NPC, Spawn, "All I'm lacking is ink! Have you found some yet?")
  69. elseif HasQuest (Spawn, SpindleCogQuest) and GetQuestStep (Spawn, SpindleCogQuest) == 6 then
  70. conversation = CreateConversation()
  71. FaceTarget(NPC, Spawn)
  72. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", "", "ponder", 0, 0, Spawn)
  73. AddConversationOption(conversation, "Here is the ink you asked for.", "QuestFinish")
  74. AddConversationOption(conversation, "Not yet. I'll be back later.")
  75. StartConversation(conversation, NPC, Spawn, "All I'm lacking is ink! Have you found some yet?")
  76. elseif HasCompletedQuest(Spawn, SpindleCogQuest) then
  77. conversation = CreateConversation()
  78. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  79. conversation = CreateConversation()
  80. FaceTarget(NPC, Spawn)
  81. AddConversationOption(conversation, "Well, hopefully the components will help.")
  82. AddConversationOption(conversation, "I'll just be... over here.")
  83. 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!")
  84. end
  85. end
  86. end
  87. function Stamping(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. conversation = CreateConversation()
  90. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog002.mp3", "", "", 233880122, 4191683346, Spawn)
  91. if GetLevel(Spawn) >= 20 then -- level check
  92. AddConversationOption(conversation, "If you can't do it by hand, I could help.", "QuestStart")
  93. end
  94. FaceTarget(NPC, Spawn)
  95. AddConversationOption(conversation, "I'm afraid I can't right now. Good luck getting it fixed. ")
  96. StartConversation(conversation, NPC, Spawn, "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!")
  97. end
  98. function QuestStart(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. OfferQuest(NPC, Spawn, SpindleCogQuest)
  101. end
  102. function QuestStep2(NPC, Spawn)
  103. conversation = CreateConversation()
  104. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog004.mp3", "", "thank", 1204035343, 2271829644, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. AddConversationOption(conversation, "I'll be back with these items.", "QuestStep3")
  107. AddConversationOption(conversation, "Try not to blow anything up.","QuestStep3")
  108. StartConversation(conversation, NPC, Spawn, "Splendid! Oh, now let's see... I can use this to wind around... these two spindles here... yes Yes! Perfect! Oh, now that you work for me, you can get me grease so that it'll run smoothly! Lucky for you, I planned ahead. Everything I need is on this list. Splended! Now off again with you.")
  109. end
  110. function QuestStep4(NPC, Spawn)
  111. conversation = CreateConversation()
  112. PlayAnimation(NPC,"agree", Spawn)
  113. FaceTarget(NPC, Spawn)
  114. AddConversationOption(conversation, "I'll be back with these items.","QuestStep5")
  115. AddConversationOption(conversation, "More? This is it! No more after this!","QuestStep5")
  116. StartConversation(conversation, NPC, Spawn, "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!")
  117. end
  118. function QuestFinish(NPC, Spawn)
  119. conversation = CreateConversation()
  120. PlayAnimation(NPC,"clap", Spawn)
  121. FaceTarget(NPC, Spawn)
  122. AddConversationOption(conversation, "Was that enough to finish it?","QuestPreReward")
  123. AddConversationOption(conversation, "Finally!","QuestPreReward")
  124. StartConversation(conversation, NPC, Spawn, "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...")
  125. end
  126. function QuestPreReward(NPC, Spawn)
  127. PlayFlavor(NPC, "", "", "explosion", 0, 0, Spawn)
  128. PlayAnimation(NPC,"11764", Spawn)
  129. conversation = CreateConversation()
  130. FaceTarget(NPC, Spawn)
  131. AddConversationOption(conversation, "Are you alright?","QuestPreReward2")
  132. AddConversationOption(conversation, "Whoa!","QuestPreReward2")
  133. StartConversation(conversation, NPC, Spawn, "Uhhhg...")
  134. end
  135. function QuestPreReward2(NPC, Spawn)
  136. conversation = CreateConversation()
  137. PlayFlavor(NPC, "voiceover/english/tinkerer_spindlecog/qey_village06/tinkererspindlecog012.mp3", "", "sigh", 3868930391, 1103597775, Spawn)
  138. FaceTarget(NPC, Spawn)
  139. AddConversationOption(conversation, "Thank you, and good luck!","QuestReward")
  140. AddConversationOption(conversation, "Thank you for not blowing me up as well.","QuestReward")
  141. 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.")
  142. end
  143. function QuestStep3(NPC, Spawn)
  144. SetStepComplete(Spawn, SpindleCogQuest, 2)
  145. end
  146. function QuestStep5(NPC, Spawn)
  147. SetStepComplete(Spawn, SpindleCogQuest, 4)
  148. end
  149. function QuestReward(NPC, Spawn)
  150. SetStepComplete(Spawn, SpindleCogQuest, 6)
  151. end