GildasCedartree.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/GildasCedartree.lua
  3. Script Purpose : Gildas Cedartree
  4. Script Author : Dorbin
  5. Script Date : 07.09.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 = 5612
  54. local armor2 = 5613
  55. local armor3 = 5614
  56. local armor4 = 5615
  57. local armor5 = 5616
  58. local armor6 = 5617
  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)== WIZARD or GetClass(Spawn)== WARLOCK or GetClass(Spawn)== ILLUSIONIST or GetClass(Spawn)== COERCER or GetClass(Spawn)== NECROMANCER or GetClass(Spawn)== CONJUROR 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, 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)==5 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, 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,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, Spawn)
  106. elseif HasCompletedQuest(Spawn,armor6) then --FINISHED RESPONSE
  107. PlayFlavor(NPC,"voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree005.mp3","A pleasure to see you again. Are you done? Or are you taking a break? I know this job is taxing, but you need to finish!","ponder", 242380919, 3536759386, Spawn)
  108. end
  109. else
  110. FaceTarget(NPC, Spawn) --NOT RIGHT CLASS
  111. Dialog.New(NPC, Spawn)
  112. Dialog.AddDialog("Sorry, friend. I can't offer you help at this time. Good day!")
  113. PlayFlavor(NPC,"","","no", 0, 0, Spawn)
  114. Dialog.AddVoiceover("voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree017.mp3", 3941972709, 1584350411)
  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("Sorry, friend. I can't offer you help at this time. Good day!.")
  122. PlayFlavor(NPC,"","","no", 0, 0, Spawn)
  123. Dialog.AddVoiceover("voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree017.mp3", 3941972709, 1584350411)
  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( "The varied paths of magic are not for everyone. Are you here to learn mystical lessons, or can I help you with something else?")
  135. Dialog.AddVoiceover("voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree001.mp3", 1037575406, 3472602833)
  136. Dialog.AddOption( "I was admiring your attire and am curious where I might find similar clothing.", "Option1")
  137. Dialog.AddOption("Nothing right now, but thank you.")
  138. Dialog.Start()
  139. end
  140. function Option1(NPC, Spawn)
  141. FaceTarget(NPC, Spawn)
  142. Dialog.New(NPC, Spawn)
  143. Dialog.AddDialog( "Why, thank you! A friend of mine in Qeynos tailored this for me. Perhaps I can see if she has time to make an extra set for you--if you help me with a few favors.")
  144. Dialog.AddVoiceover("voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree002.mp3", 2359463822, 3639301391)
  145. Dialog.AddOption( "What could I do for you?", "Option2")
  146. Dialog.AddOption("No, I'm not interested right now.")
  147. Dialog.Start()
  148. end
  149. function Option2(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. Dialog.New(NPC, Spawn)
  152. Dialog.AddDialog( "As a Qeynosian wizard, I'm often asked to defend the city with my magical might. Unfortunately, prior commitments require I stay in the city for the next several weeks. If you help with my responsibilities that take me outside the city, I'd be very thankful.")
  153. Dialog.AddVoiceover("voiceover/english/gildas_cedartree/qey_elddar/quests/gildas_cedartree/gildascedartree003.mp3", 4282077641, 830643203)
  154. Dialog.AddOption( "It would be my pleasure to help you.", "Option3")
  155. Dialog.AddOption("I'm sorry, I don't have time right now.")
  156. Dialog.Start()
  157. end
  158. function Option3(NPC, Spawn)
  159. FaceTarget(NPC, Spawn)
  160. OfferQuest(NPC,Spawn,armor1)
  161. end
  162. function Dialog2(NPC, Spawn) -- Primary turn-in response.
  163. FaceTarget(NPC, Spawn)
  164. Dialog.New(NPC, Spawn)
  165. Dialog.AddDialog( "You seem happy to be within the safety of the city walls. I know how you feel. Returning to Qeynos always brings a smile to my face.")
  166. Dialog.AddOption( "It is good to be back, and I have completed the tasks you asked of me.", "Option4")
  167. Dialog.AddOption("Hmm. I must be distracted. I will be back.")
  168. Dialog.Start()
  169. end
  170. function Option4(NPC, Spawn)
  171. FaceTarget(NPC, Spawn)
  172. Dialog.New(NPC, Spawn)
  173. PlayFlavor(NPC,"","","nod", 0, 0, Spawn)
  174. Dialog.AddDialog( "I will. Thank you Gildas.")
  175. Dialog.AddOption("Excellent! Qeynos and I thank you for your service. I spoke to my friend, and she finished this up for you. I hope it fits. Let me know if you have any more time--mage's work is never done!")
  176. Dialog.Start()
  177. if GetQuestStep(Spawn,armor1)==3 then
  178. QuestStepIsComplete(NPC,Spawn,armor1,3)
  179. elseif GetQuestStep(Spawn,armor2)==4 then
  180. QuestStepIsComplete(NPC,Spawn,armor2,4)
  181. elseif GetQuestStep(Spawn,armor3)==3 then
  182. QuestStepIsComplete(NPC,Spawn,armor3,3)
  183. elseif GetQuestStep(Spawn,armor4)==4 then
  184. QuestStepIsComplete(NPC,Spawn,armor4,4)
  185. elseif GetQuestStep(Spawn,armor5)==5 then
  186. QuestStepIsComplete(NPC,Spawn,armor5,5)
  187. end
  188. end
  189. --AQ2-6
  190. function Dialog3(NPC, Spawn)
  191. FaceTarget(NPC, Spawn)
  192. Dialog.New(NPC, Spawn)
  193. Dialog.AddDialog( "It's good to see you. It seems you are no more worse for wear. I still can't leave the city. Would you do me another favor?")
  194. if HasCompletedQuest(Spawn,armor1) and not HasQuest(Spawn,armor2) then
  195. Dialog.AddOption( "I can, what is it that needs to be done?", "Option5")
  196. end
  197. if HasCompletedQuest(Spawn,armor2) and not HasQuest(Spawn,armor3) then
  198. Dialog.AddOption( "Qeynos seems to need a lot of work to keep it safe.", "Option6")
  199. end
  200. if HasCompletedQuest(Spawn,armor3) and not HasQuest(Spawn,armor4) then
  201. Dialog.AddOption( "What can I do to help?", "Option7")
  202. end
  203. if HasCompletedQuest(Spawn,armor4) and not HasQuest(Spawn,armor5) then
  204. Dialog.AddOption( "Certainly.", "Option8")
  205. end
  206. if HasCompletedQuest(Spawn,armor5) and not HasQuest(Spawn,armor6) then
  207. Dialog.AddOption( "I can help you one last time.", "Option9")
  208. end
  209. Dialog.AddOption("I'm not sure. I'll get back to you.")
  210. Dialog.Start()
  211. end
  212. function Option5(NPC, Spawn)
  213. FaceTarget(NPC, Spawn)
  214. OfferQuest(NPC,Spawn,armor2)
  215. end
  216. function Option6(NPC, Spawn)
  217. FaceTarget(NPC, Spawn)
  218. OfferQuest(NPC,Spawn,armor3)
  219. end
  220. function Option7(NPC, Spawn)
  221. FaceTarget(NPC, Spawn)
  222. OfferQuest(NPC,Spawn,armor4)
  223. end
  224. function Option8(NPC, Spawn)
  225. FaceTarget(NPC, Spawn)
  226. OfferQuest(NPC,Spawn,armor5)
  227. end
  228. function Option9(NPC, Spawn)
  229. FaceTarget(NPC, Spawn)
  230. OfferQuest(NPC,Spawn,armor6)
  231. end
  232. function Dialog4(NPC, Spawn) --AQ6 turnin
  233. FaceTarget(NPC, Spawn)
  234. Dialog.New(NPC, Spawn)
  235. Dialog.AddOption( "Thank you.")
  236. Dialog.AddOption("That is good news. You exceeded my expectations. The robe is complete, and I must say it is some of her finest work. Quite a reward but well deserved. Again, Qeynos and I thank you for your services.")
  237. QuestStepIsComplete(NPC,Spawn,armor6,5)
  238. Dialog.Start()
  239. end