JPFeterman.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/JPFeterman.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.01.06 07:01:46
  5. Script Purpose :
  6. :
  7. --]]
  8. local ProofIsInThePudding = 417
  9. local AHuntersTool = 418
  10. local BigGameHunting = 419
  11. local GrizzlefangMane = 420
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange")
  14. end
  15. function InRange(NPC, Spawn)
  16. if not HasQuest(Spawn, ProofIsInThePudding) and not HasCompletedQuest(Spawn, ProofIsInThePudding) then
  17. ProvidesQuest(NPC, ProofIsInThePudding)
  18. SetInfoFlag(NPC)
  19. SetVisualFlag(NPC)
  20. elseif HasCompletedQuest(Spawn, ProofIsInThePudding) then
  21. ProvidesQuest(NPC, AHuntersTool)
  22. SetInfoFlag(NPC)
  23. SetVisualFlag(NPC)
  24. elseif HasCompletedQuest(Spawn, AHuntersTool) then
  25. ProvidesQuest(NPC, BigGameHunting)
  26. SetInfoFlag(NPC)
  27. SetVisualFlag(NPC)
  28. elseif HasCompletedQuest(Spawn, BigGameHunting) then
  29. ProvidesQuest(NPC, GrizzlefangMane)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. end
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. local choice = math.random(1, 3)
  37. if choice == 1 then
  38. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1010.mp3", "", "", 0, 0, Spawn)
  39. elseif choice == 2 then
  40. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1010.mp3", "", "", 0, 0, Spawn)
  41. else
  42. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1010.mp3", "", "", 0, 0, Spawn)
  43. end
  44. if not HasQuest(Spawn, ProofIsInThePudding) and not HasCompletedQuest(Spawn, ProofIsInThePudding) then
  45. dlg(NPC, Spawn)
  46. elseif GetQuestStep(Spawn, ProofIsInThePudding) == 6 or GetQuestStep(Spawn, AHuntersTool) == 4 or GetQuestStep(Spawn, BigGameHunting) == 6 or GetQuestStep(Spawn, GrizzlefangMane) == 2 then
  47. dlg4(NPC, Spawn)
  48. elseif HasQuest(Spawn, ProofIsInThePudding) and not HasCompletedQuest(Spawn, ProofIsInThePudding) or HasQuest(Spawn, AHuntersTool) and not HasCompletedQuest(Spawn, AHuntersTool) or HasQuest(Spawn, BigGameHunting) and not HasCompletedQuest(Spawn, BigGameHunting) or HasQuest(Spawn, GrizzlefangMane) and not HasCompletedQuest(Spawn, GrizzlefangMane) then
  49. progress(NPC, Spawn)
  50. elseif HasCompletedQuest(Spawn, ProofIsInThePudding) and not HasCompletedQuest(Spawn, AHuntersTool) then
  51. dlg5(NPC, Spawn)
  52. elseif HasCompletedQuest(Spawn, ProofIsInThePudding) and HasCompletedQuest(Spawn, AHuntersTool) and not HasCompletedQuest(Spawn, BigGameHunting) then
  53. dlg9(NPC, Spawn)
  54. elseif HasCompletedQuest(Spawn, ProofIsInThePudding) and HasCompletedQuest(Spawn, AHuntersTool) and HasCompletedQuest(Spawn, BigGameHunting) and not HasCompletedQuest(Spawn, GrizzlefangMane) then
  55. dlg13(NPC, Spawn)
  56. elseif HasCompletedQuest(Spawn, ProofIsInThePudding) and HasCompletedQuest(Spawn, AHuntersTool) and HasCompletedQuest(Spawn, BigGameHunting) and HasCompletedQuest(Spawn, GrizzlefangMane) then
  57. PlayFlavor(NPC, "", "Good to see you again!", "", 0, 0, Spawn)
  58. end
  59. end
  60. function respawn(NPC)
  61. spawn(NPC)
  62. end
  63. -- PROOF IS IN THE PUDDING PART
  64. function dlg(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. conversation = CreateConversation()
  67. AddConversationOption(conversation, "Um, what are you talking about?", "dlg1")
  68. AddConversationOption(conversation, "Right, I really don't have time for this.")
  69. StartConversation(conversation, NPC, Spawn, "Salutations, friend! Ahh, by the look in your eyes I can see that you're in need of my considerable experience. It can be difficult learning the perilous ways of adventure in these harsh, barren lands. Many a poor, naive soul such as yourself has met their end out here.")
  70. end
  71. function dlg1(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. conversation = CreateConversation()
  74. AddConversationOption(conversation, "Well, you aren't full of yourself at all, are you?", "dlg2")
  75. AddConversationOption(conversation, "That's it, I'm not going to take this.")
  76. StartConversation(conversation, NPC, Spawn, "Oh, there's no need to pretend otherwise! I understand your fears. Not many are as knowledgeable of these things as I am, and I feel it's my duty to help those who could benefit from my tutelage. Why, even I was once as inexperienced as yourself a long, long time ago... but that is a story for another time.")
  77. end
  78. function dlg2(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. conversation = CreateConversation()
  81. AddConversationOption(conversation, "I guess it couldn't hurt...", "dlg3")
  82. AddConversationOption(conversation, "No way. I'm leaving.")
  83. StartConversation(conversation, NPC, Spawn, "Ahh, such spirit. It warms my heart to see it. Before I send you into the arms of danger, I'll need you to prove to me that you're ready to follow in my renowned footsteps. Once you've seen a few of the more perilous places of adventure, you should be ready to learn from my experience.")
  84. end
  85. function dlg3(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. conversation = CreateConversation()
  88. AddConversationOption(conversation, "Okay.", "offer")
  89. StartConversation(conversation, NPC, Spawn, "That's the spirit! Here, let me just jot down a few of the more perilous locations here in The Commonlands in your journal.")
  90. end
  91. function dlg4(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. conversation = CreateConversation()
  94. if HasQuest(Spawn, ProofIsInThePudding) then
  95. AddConversationOption(conversation, "I have scouted the areas you asked me to, J.P.", "complete1")
  96. elseif HasQuest(Spawn, AHuntersTool) then
  97. AddConversationOption(conversation, "I have what you need to make your bow, J.P", "complete2")
  98. elseif HasQuest(Spawn, BigGameHunting) then
  99. AddConversationOption(conversation, "I have your trophies, J.P.", "complete3")
  100. elseif HasQuest(Spawn, GrizzlefangMane) then
  101. AddConversationOption(conversation, "Grizzlefang is no more.", "complete4")
  102. end
  103. AddConversationOption(conversation, "That's all the adventure I need for one day.")
  104. StartConversation(conversation, NPC, Spawn, "Hello again, young adventurer to be!")
  105. end
  106. -- A HUNTER'S TOOL PART
  107. function dlg5(NPC, Spawn)
  108. FaceTarget(NPC, Spawn)
  109. conversation = CreateConversation()
  110. AddConversationOption(conversation, "Oh, is that what you think you are doing?", "dlg6")
  111. AddConversationOption(conversation, "You think that you are actually teaching me something? I think I'm done with this.")
  112. StartConversation(conversation, NPC, Spawn, "Back so soon? My, you are the eager little apprentice aren't you? Well, when I was your age, I too was looking for someone older and wiser to lead me down the road of adventuring.")
  113. end
  114. function dlg6(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. conversation = CreateConversation()
  117. AddConversationOption(conversation, "What happened to your bow?", "dlg7")
  118. AddConversationOption(conversation, "I don't care about your silly bow.")
  119. StartConversation(conversation, NPC, Spawn, "Oh yes, very much so. Just because you can't see the lessons now doesn't mean that I am any less the mentor. Why, I'd be out there in the field hunting with you, if it weren't for the loss of my favorite bow.")
  120. end
  121. function dlg7(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. conversation = CreateConversation()
  124. AddConversationOption(conversation, "Fine, I'll help you fix your bow.", "dlg8")
  125. AddConversationOption(conversation, "I've had enough of this. Fix your own bow.")
  126. StartConversation(conversation, NPC, Spawn, "It's just worn from overuse. Oh, the beasts I have slain with my mighty bow. I am simply too busy, with all of my many apprentices, to take the time to gather the components I need to fix my bow. I think it will be a wonderful task for your studies.")
  127. end
  128. function dlg8(NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. conversation = CreateConversation()
  131. AddConversationOption(conversation, "Ok, I'll see what I can do.", "offer2")
  132. StartConversation(conversation, NPC, Spawn, "I'll need a few sturdy pieces of maple, some tuber strands to make a nice draw, and maybe you could convince a couple dervishes to relinquish a compound cam or two.")
  133. end
  134. -- BIG GAME HUNTING PART
  135. function dlg9(NPC, Spawn)
  136. FaceTarget(NPC, Spawn)
  137. local conversation = CreateConversation()
  138. AddConversationOption(conversation, "Whatever, I'm ready.", "dlg10")
  139. AddConversationOption(conversation, "No way. ")
  140. StartConversation(conversation, NPC, Spawn, "Hello again, my young pupil! I must say that I was quite impressed with your last performance. Your skills are already improving, thanks largely to my expert tutelage, and I think you may even be ready to begin some real adventuring soon. What do you say to that?")
  141. end
  142. function dlg10(NPC, Spawn)
  143. FaceTarget(NPC, Spawn)
  144. local conversation = CreateConversation()
  145. AddConversationOption(conversation, "Right, right. I'm not as great as you... sure. What do you want me to do?", "dlg11")
  146. AddConversationOption(conversation, "I think I'm going to leave now.")
  147. StartConversation(conversation, NPC, Spawn, "I don't know that you're quite ready to take on some of the more fearsome monsters found in this region, so we shall have to come up with a task better suited to your abilities.")
  148. end
  149. function dlg11(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. local conversation = CreateConversation()
  152. AddConversationOption(conversation, "A safari sounds fun.", "dlg12")
  153. AddConversationOption(conversation, "I think you'll have to complete your own collection.")
  154. StartConversation(conversation, NPC, Spawn, "Well, I'd say your skills should be sufficient now to go on a modest hunt across the vast plains of the Commonlands. A safari should be perfect for you, and it will help me complete my renowned trophy collection!")
  155. end
  156. function dlg12(NPC, Spawn)
  157. FaceTarget(NPC, Spawn)
  158. local conversation = CreateConversation()
  159. AddConversationOption(conversation, "But you haven't actually taught me anything...", "offer3")
  160. StartConversation(conversation, NPC, Spawn, "Great! Now to complete my collection, I'll need a skull from a fierce carrion hound, a Bloodskull mason's pick, a plains elephant tusk, a bull rhino horn, and a stinger from one of the rather vicious sentry wasps found out here. Now, run along and put all those skills I've taught you to work!")
  161. end
  162. -- GRIZZLEFANG MANE PART
  163. function dlg13(NPC, Spawn)
  164. FaceTarget(NPC, Spawn)
  165. local conversation = CreateConversation()
  166. AddConversationOption(conversation, "Okay, I'll find and slay the lion. Sounds like fun!", "dlg14")
  167. AddConversationOption(conversation, "You want me to do your dirty work? You are on your own on this one.")
  168. StartConversation(conversation, NPC, Spawn, "This bow reminds me of the one great beast that escaped me: the mighty lion, Grizzlefang. You could surely prove your prowess as a hunter were you to bring me the mane of the beast. It would prove a more than adequate last stage in your training.")
  169. end
  170. function dlg14(NPC, Spawn)
  171. FaceTarget(NPC, Spawn)
  172. local conversation = CreateConversation()
  173. AddConversationOption(conversation, "Alright, I'm off.", "offer4")
  174. StartConversation(conversation, NPC, Spawn, "Excellent. You can find Grizzlefang near the old druid rings. Or, at least, the last time I ran fro... er saw him, he was near the old druid rings. If you head that way, I'm sure he'll find you.")
  175. end
  176. function complete1(NPC, Spawn)
  177. FaceTarget(NPC, Spawn)
  178. SetStepComplete(Spawn, ProofIsInThePudding, 6)
  179. conversation = CreateConversation()
  180. AddConversationOption(conversation, "Why thank you, J.P.")
  181. StartConversation(conversation, NPC, Spawn, "Very well done, or at least done... Anyways, I'm not done with you yet.")
  182. end
  183. function complete2(NPC, Spawn)
  184. FaceTarget(NPC, Spawn)
  185. SetStepComplete(Spawn, AHuntersTool, 4)
  186. conversation = CreateConversation()
  187. AddConversationOption(conversation, "I guess I will take that as a compliment.")
  188. StartConversation(conversation, NPC, Spawn, "Well done, but since you took so long, I repaired it myself. No matter. You show spunk, and I like that.")
  189. end
  190. function complete3(NPC, Spawn)
  191. SetStepComplete(Spawn, BigGameHunting, 6)
  192. FaceTarget(NPC, Spawn)
  193. local conversation = CreateConversation()
  194. AddConversationOption(conversation, "Umm, sure J.P.")
  195. StartConversation(conversation, NPC, Spawn, "Excellent, under my expert tutelage anyone can become a great adventurer!")
  196. end
  197. function complete4(NPC, Spawn)
  198. SetStepComplete(Spawn, GrizzlefangMane, 2)
  199. FaceTarget(NPC, Spawn)
  200. local conversation = CreateConversation()
  201. AddConversationOption(conversation, "I will, J.P. Thank you for your guidance.")
  202. StartConversation(conversation, NPC, Spawn, "Amazing! I didn't think you had it in you! Well done indeed. It appears I have nothing left to teach you. The rest, you must discover on your own.")
  203. end
  204. function offer(NPC, Spawn)
  205. OfferQuest(NPC, Spawn, ProofIsInThePudding)
  206. end
  207. function offer2(NPC, Spawn)
  208. OfferQuest(NPC, Spawn, AHuntersTool)
  209. end
  210. function offer3(NPC, Spawn)
  211. OfferQuest(NPC, Spawn, BigGameHunting)
  212. end
  213. function offer4(NPC, Spawn)
  214. OfferQuest(NPC, Spawn, GrizzlefangMane)
  215. end
  216. function progress(NPC, Spawn)
  217. FaceTarget(NPC, Spawn)
  218. conversation = CreateConversation()
  219. AddConversationOption(conversation, "Why do I put up with this?")
  220. StartConversation(conversation, NPC, Spawn, "Hurry on now! You've got a lot of work to do, my young friend. Come see me when you're finished.")
  221. end