SelwynOakheart.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/SelwynOakheart.lua
  3. Script Purpose : Selwyn Oakheart
  4. Script Author : Dorbin
  5. Script Date : 07.08.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local FIGHTER = 1
  10. local WARRIOR =2
  11. local GUARDIAN= 3
  12. local BERSERKER = 4
  13. local BRAWLER = 5
  14. local MONK = 6
  15. local BRUISER= 7
  16. local CRUSADER = 8
  17. local SHADOWKNIGHT = 9
  18. local PALADIN = 10
  19. local PRIEST = 11
  20. local CLERIC = 12
  21. local TEMPLAR = 13
  22. local INQUISITOR = 14
  23. local DRUID = 15
  24. local WARDEN = 16
  25. local FURY = 17
  26. local SHAMAN = 18
  27. local MYSTIC = 19
  28. local DEFILER = 20
  29. local MAGE = 21
  30. local SORCERER = 22
  31. local WIZARD = 23
  32. local WARLOCK = 24
  33. local ENCHANTER = 25
  34. local ILLUSIONIST = 26
  35. local COERCER = 27
  36. local SUMMONER = 28
  37. local CONJUROR = 29
  38. local NECROMANCER = 30
  39. local SCOUT = 31
  40. local ROGUE = 32
  41. local SWASHBUCKLER = 33
  42. local BRIGAND = 34
  43. local BARD = 35
  44. local TROUBADOR = 36
  45. local DIRGE = 37
  46. local PREDATOR = 38
  47. local RANGER = 39
  48. local ASSASSIN = 40
  49. local ANIMALIST = 41
  50. local BEASTLORD = 42
  51. local SHAPER = 43
  52. local CHANNELER = 44
  53. local armor1 = 5606
  54. local armor2 = 5607
  55. local armor3 = 5608
  56. local armor4 = 5609
  57. local armor5 = 5610
  58. local armor6 = 5611
  59. function spawn(NPC)
  60. ProvidesQuest(NPC,armor1)
  61. ProvidesQuest(NPC,armor2)
  62. ProvidesQuest(NPC,armor3)
  63. ProvidesQuest(NPC,armor4)
  64. ProvidesQuest(NPC,armor5)
  65. ProvidesQuest(NPC,armor6)
  66. end
  67. function respawn(NPC)
  68. spawn(NPC)
  69. end
  70. function hailed(NPC, Spawn)
  71. if GetFactionAmount(Spawn,11)<0 then --QEYNOS FACTION CHECK
  72. PlayFlavor(NPC,"","","glare", 0, 0, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. else
  75. if GetLevel(Spawn)>=20 then --LEVEL CHECK
  76. if GetClass(Spawn)== MONK or GetClass(Spawn)== BRUISER or GetClass(Spawn)== WARDEN or GetClass(Spawn)== FURY or GetClass(Spawn)== MYSTIC or GetClass(Spawn)== DEFILER then
  77. FaceTarget(NPC, Spawn)
  78. if not HasQuest(Spawn,armor1) and not HasCompletedQuest(Spawn,armor1) then
  79. Dialog1(NPC,Spawn) -- INITIAL HAIL
  80. elseif HasQuest(Spawn,armor1) and GetQuestStep(Spawn,armor1)~=3 then --INBETWEEN QUESTS (no ready to turn in)
  81. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  82. elseif GetQuestStep(Spawn,armor1)==3 or GetQuestStep(Spawn,armor2)==4 or GetQuestStep(Spawn,armor3)==4 or GetQuestStep(Spawn,armor4)==4 or GetQuestStep(Spawn,armor5)==5 then
  83. Dialog2(NPC,Spawn) -- DEFAULT QUEST TURN-IN AQ1-5
  84. elseif GetQuestStep(Spawn,armor6)==4 then
  85. Dialog4(NPC,Spawn) -- AQ6 TURN-IN
  86. elseif HasCompletedQuest(Spawn,armor1) and not HasQuest(Spawn,armor2) then
  87. Dialog3(NPC,Spawn)
  88. elseif HasQuest(Spawn,armor2) and GetQuestStep(Spawn,armor2)~=4 then
  89. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  90. elseif HasCompletedQuest(Spawn,armor2) and not HasQuest(Spawn,armor3) then
  91. Dialog3(NPC,Spawn)
  92. elseif HasQuest(Spawn,armor3) and GetQuestStep(Spawn,armor3)~=3 then
  93. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  94. elseif HasCompletedQuest(Spawn,armor3) and not HasQuest(Spawn,armor4) then
  95. Dialog3(NPC,Spawn)
  96. elseif HasQuest(Spawn,armor4) and GetQuestStep(Spawn,armor4)~=4 then
  97. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  98. elseif HasCompletedQuest(Spawn,armor4) and not HasQuest(Spawn,armor5) then
  99. Dialog3(NPC,Spawn)
  100. elseif HasQuest(Spawn,armor5) and GetQuestStep(Spawn,armor5)~=5 then
  101. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  102. elseif HasCompletedQuest(Spawn,armor5) and not HasQuest(Spawn,armor6) then
  103. Dialog3(NPC,Spawn)
  104. elseif HasQuest(Spawn,armor6) and GetQuestStep(Spawn,armor6)~=5 then
  105. PlayFlavor(NPC,"","Oh, you're back so soon? I'm sorry those adjustments aren't quite done yet, but I'm getting close. Come back in a little while, and I should have them finished.","ponder", 0, 0, Spawn)
  106. elseif HasCompletedQuest(Spawn,armor6) then --FINISHED RESPONSE
  107. PlayFlavor(NPC,"","The sun truly shines on me today. It's a joy to see you again, dear! And thank you ever so much for all the help. I hope that armor worked well for you and kept you safe. Please stop by anytime and say hello to old Selwyn.","hello", 0, 0, Spawn)
  108. end
  109. else
  110. FaceTarget(NPC, Spawn) --NOT RIGHT CLASS
  111. Dialog.New(NPC, Spawn)
  112. Dialog.AddDialog("I'm sorry, dear. I don't think I'd be able to help you with anything right now. I'm very busy.")
  113. PlayFlavor(NPC,"","","no", 0, 0, Spawn)
  114. Dialog.AddVoiceover("voiceover/english/selwyn_oakheart/qey_south/quests/selwyn_oakheart/selwyn017.mp3", 3697608701, 2678534832)
  115. Dialog.AddOption("Alright.")
  116. Dialog.Start()
  117. end
  118. else --NOT RIGHT LEVEL
  119. FaceTarget(NPC, Spawn)
  120. Dialog.New(NPC, Spawn)
  121. Dialog.AddDialog("I'm sorry, dear. I don't think I'd be able to help you with anything right now. I'm very busy.")
  122. PlayFlavor(NPC,"","","no", 0, 0, Spawn)
  123. Dialog.AddVoiceover("voiceover/english/selwyn_oakheart/qey_south/quests/selwyn_oakheart/selwyn017.mp3", 3697608701, 2678534832)
  124. Dialog.AddOption("Alright.")
  125. Dialog.Start()
  126. end
  127. end
  128. end
  129. --AQ1
  130. function Dialog1(NPC, Spawn)
  131. FaceTarget(NPC, Spawn)
  132. Dialog.New(NPC, Spawn)
  133. PlayFlavor(NPC,"","","hello", 0, 0, Spawn)
  134. Dialog.AddDialog( "Oh my! You're a strong looking one, aren't you? Pleased to meet you. My name is Selwyn. How might I be of help to you today?")
  135. Dialog.AddVoiceover("voiceover/english/selwyn_oakheart/qey_south/quests/selwyn_oakheart/selwyn001.mp3", 390832885, 49061382)
  136. Dialog.AddOption( "I'm looking for some new armor, do you know where I can find some?", "Option1")
  137. Dialog.AddOption("I'm sorry I mistook you for someone else.")
  138. Dialog.Start()
  139. end
  140. function Option1(NPC, Spawn)
  141. FaceTarget(NPC, Spawn)
  142. Dialog.New(NPC, Spawn)
  143. Dialog.AddDialog( "Oh, you are, are you? Well hrm.... you do seem to be about the same build. I had a dear friend give up their adventuring not long ago. I think I could make some adjustments to their old armor and give it to you.")
  144. Dialog.AddOption( "I would be grateful.", "Option2")
  145. Dialog.AddOption("No, I'm not interested right now.")
  146. Dialog.Start()
  147. end
  148. function Option2(NPC, Spawn)
  149. FaceTarget(NPC, Spawn)
  150. Dialog.New(NPC, Spawn)
  151. Dialog.AddDialog( "Well, it may take me a little time, but I think it can be done. While I'm at it though, would you mind taking care of a few errands I have? That'll give me some time to work on the adjustments. Otherwise, I just don't think I'd be able to get around to it.")
  152. Dialog.AddOption( "That sounds reasonable, what do you need done?", "Option3")
  153. Dialog.AddOption("I've changed my mind, I'm not interested thank you.")
  154. Dialog.Start()
  155. end
  156. function Option3(NPC, Spawn)
  157. FaceTarget(NPC, Spawn)
  158. OfferQuest(NPC,Spawn,armor1)
  159. end
  160. function Dialog2(NPC, Spawn) -- Primary turn-in response.
  161. FaceTarget(NPC, Spawn)
  162. Dialog.New(NPC, Spawn)
  163. Dialog.AddDialog( "What did you find? Did you get them all?")
  164. Dialog.AddOption( "I found everything on the list.", "Option4")
  165. Dialog.AddOption("I'm not sure. I'll get back to you.")
  166. Dialog.Start()
  167. end
  168. function Option4(NPC, Spawn)
  169. FaceTarget(NPC, Spawn)
  170. Dialog.New(NPC, Spawn)
  171. PlayFlavor(NPC,"","","happy", 0, 0, Spawn)
  172. Dialog.AddDialog( "Thank you Selwyn it seems a perfect fit.")
  173. Dialog.AddOption("Oh, wonderful! And just in time, I finished with this piece. Try it on and see what you think. If you need any other adjustments, just let me know. Okay, dear?")
  174. Dialog.Start()
  175. if GetQuestStep(Spawn,armor1)==3 then
  176. QuestStepIsComplete(NPC,Spawn,armor1,3)
  177. elseif GetQuestStep(Spawn,armor2)==4 then
  178. QuestStepIsComplete(NPC,Spawn,armor2,4)
  179. elseif GetQuestStep(Spawn,armor3)==3 then
  180. QuestStepIsComplete(NPC,Spawn,armor3,3)
  181. elseif GetQuestStep(Spawn,armor4)==4 then
  182. QuestStepIsComplete(NPC,Spawn,armor4,4)
  183. elseif GetQuestStep(Spawn,armor5)==5 then
  184. QuestStepIsComplete(NPC,Spawn,armor5,5)
  185. end
  186. end
  187. --AQ2-6
  188. function Dialog3(NPC, Spawn)
  189. FaceTarget(NPC, Spawn)
  190. Dialog.New(NPC, Spawn)
  191. Dialog.AddDialog( "So nice to see you again, dear. Would you be able to help an old druid out again? I've been working on the adjustments for the next piece, but so much always seems to pile up.")
  192. if HasCompletedQuest(Spawn,armor1) and not HasQuest(Spawn,armor2) then
  193. Dialog.AddOption( "What can I do to help?", "Option5")
  194. end
  195. if HasCompletedQuest(Spawn,armor2) and not HasQuest(Spawn,armor3) then
  196. Dialog.AddOption( "It would be my pleasure. What needs doing?", "Option6")
  197. end
  198. if HasCompletedQuest(Spawn,armor3) and not HasQuest(Spawn,armor4) then
  199. Dialog.AddOption( "Do you normally do these things yourself?", "Option7")
  200. end
  201. if HasCompletedQuest(Spawn,armor4) and not HasQuest(Spawn,armor5) then
  202. Dialog.AddOption( "You certainly do seem to keep busy Selwyn.", "Option8")
  203. end
  204. if HasCompletedQuest(Spawn,armor5) and not HasQuest(Spawn,armor6) then
  205. Dialog.AddOption( "I would be happy to.", "Option9")
  206. end
  207. Dialog.AddOption("I'm not sure. I'll get back to you.")
  208. Dialog.Start()
  209. end
  210. function Option5(NPC, Spawn)
  211. FaceTarget(NPC, Spawn)
  212. OfferQuest(NPC,Spawn,armor2)
  213. end
  214. function Option6(NPC, Spawn)
  215. FaceTarget(NPC, Spawn)
  216. OfferQuest(NPC,Spawn,armor3)
  217. end
  218. function Option7(NPC, Spawn)
  219. FaceTarget(NPC, Spawn)
  220. OfferQuest(NPC,Spawn,armor4)
  221. end
  222. function Option8(NPC, Spawn)
  223. FaceTarget(NPC, Spawn)
  224. OfferQuest(NPC,Spawn,armor5)
  225. end
  226. function Option9(NPC, Spawn)
  227. FaceTarget(NPC, Spawn)
  228. OfferQuest(NPC,Spawn,armor6)
  229. end
  230. function Dialog4(NPC, Spawn) --AQ6 turnin
  231. FaceTarget(NPC, Spawn)
  232. Dialog.New(NPC, Spawn)
  233. Dialog.AddOption( "Thank you again Selwyn.")
  234. Dialog.AddOption("Oh! I almost forgot, I finished this last piece for you. The new straps and buckles should be a lot better than before. Make sure it's snug. We can't have such nice people like you getting hurt out there in the wilds. You remind me so much of my old friend Erwyn. Well anyway, thank you again.")
  235. QuestStepIsComplete(NPC,Spawn,armor6,5)
  236. Dialog.Start()
  237. end