GarvenTralk.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/GarvenTralk.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.05 05:09:08
  5. Script Purpose : Garven Tralk's dialog for commoner's and first quest on Isle of Refuge
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local IsleIntro = 5725
  10. local FighterGI = 5726
  11. local PriestGI = 5727
  12. local MageGI = 5728
  13. local ScoutGI = 5729
  14. local Fighter2 = 5731
  15. local Priest2 = 5732
  16. local Mage2 = 5733
  17. local Scout2 = 5730
  18. function spawn(NPC)
  19. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  20. ProvidesQuest(NPC,FighterGI)
  21. ProvidesQuest(NPC,PriestGI)
  22. ProvidesQuest(NPC,MageGI)
  23. ProvidesQuest(NPC,ScoutGI)
  24. ProvidesQuest(NPC,Fighter2)
  25. ProvidesQuest(NPC,Priest2)
  26. ProvidesQuest(NPC,Mage2)
  27. ProvidesQuest(NPC,Scout2)
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. if HasQuest(Spawn,IsleIntro) and not HasCompletedQuest(Spawn,IsleIntro) then
  32. Dialog1(NPC,Spawn)--CLASS SELECTION
  33. elseif HasCompletedQuest(Spawn,IsleIntro) and
  34. not HasQuest(Spawn, FighterGI) and not HasCompletedQuest(Spawn, FighterGI)
  35. and not HasQuest(Spawn, PriestGI) and not HasCompletedQuest(Spawn, PriestGI)
  36. and not HasQuest(Spawn, MageGI) and not HasCompletedQuest(Spawn, MageGI)
  37. and not HasQuest(Spawn, ScoutGI) and not HasCompletedQuest(Spawn, ScoutGI) then
  38. Dialog2(NPC,Spawn)--START OF GRUTTOOTH INVASION (DIALOG1 LEADS TO THIS ALSO)
  39. elseif GetQuestStep(Spawn, FighterGI)~=3 and HasCompletedQuest(Spawn,IsleIntro) and not HasCompletedQuest(Spawn, FighterGI) --IN BETWEEN STEPS
  40. and GetQuestStep(Spawn, PriestGI)~=3 and HasCompletedQuest(Spawn,IsleIntro) and not HasCompletedQuest(Spawn, PriestGI)
  41. and GetQuestStep(Spawn, MageGI)~=3 and HasCompletedQuest(Spawn,IsleIntro) and not HasCompletedQuest(Spawn, MageGI)
  42. and GetQuestStep(Spawn, ScoutGI)~=3 and HasCompletedQuest(Spawn,IsleIntro)and not HasCompletedQuest(Spawn, ScoutGI) then
  43. PlayFlavor(NPC,"voiceover/english/garven_tralk/tutorial_island02/garventralk009.mp3", "I know you may think this is none of your affair, but trust me, if you want to get off this island alive and well you have no choice. Come back to me after you've defeated at least one Gruttooth invader and maybe I can help you out.", "nod", 3552772782, 395294110, Spawn, 0) --FINAL HAIL
  44. elseif GetQuestStep(Spawn, FighterGI)==3 then --FINAL GRUTTOOTH INVASION STEP & IF PLAYER DOES NOT HAVE NEXT QUEST
  45. Dialog3F(NPC,Spawn)
  46. elseif not HasQuest(Spawn, Fighter2) and HasCompletedQuest(Spawn, FighterGI) and not HasCompletedQuest(Spawn, Fighter2) then
  47. Dialog3F(NPC,Spawn)
  48. elseif GetQuestStep(Spawn, PriestGI)==3 then
  49. Dialog3P(NPC,Spawn)
  50. elseif not HasQuest(Spawn, Priest2) and HasCompletedQuest(Spawn, PriestGI) and not HasCompletedQuest(Spawn, Priest2) then
  51. Dialog3P(NPC,Spawn)
  52. elseif GetQuestStep(Spawn, MageGI)==3 then
  53. Dialog3M(NPC,Spawn)
  54. elseif not HasQuest(Spawn, Mage2) and HasCompletedQuest(Spawn, MageGI) and not HasCompletedQuest(Spawn, Mage2) then
  55. Dialog3M(NPC,Spawn)
  56. elseif GetQuestStep(Spawn, ScoutGI)==3 then
  57. Dialog3S(NPC,Spawn)
  58. elseif not HasQuest(Spawn, Scout2) and HasCompletedQuest(Spawn, ScoutGI) and not HasCompletedQuest(Spawn, Scout2) then
  59. Dialog3S(NPC,Spawn)
  60. else
  61. --FINAL HAIL
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("If we don't get refugees with some degree of skill soon we'll have to pull out of here.")
  65. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk001.mp3",1755275352, 190331174)
  66. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  67. Dialog.AddOption("Good luck with that.")
  68. Dialog.Start()
  69. end
  70. end
  71. function InRange(NPC,Spawn)
  72. if HasQuest(Spawn,IsleIntro) and not HasCompletedQuest (Spawn,IsleIntro) then
  73. FaceTarget(NPC, Spawn)
  74. PlayFlavor(NPC, "voiceover/english/garven_tralk/tutorial_island02_fvo_onaoienter.mp3", "You there! Stop standing around like a drunken sailor and get over here!", "beckon", 4010256509, 3318344012, Spawn, 0)
  75. end
  76. end
  77. function respawn(NPC)
  78. spawn(NPC)
  79. end
  80. function Dialog1(NPC,Spawn)
  81. FaceTarget(NPC, Spawn)
  82. Dialog.New(NPC, Spawn)
  83. Dialog.AddDialog("I'll make this quick because we have no time for pleasantries. Welcome to the Isle of Refuge. Name and profession please?")
  84. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk002.mp3", 1422110417, 3383506524)
  85. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Fighter.", "Fighter")
  86. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Priest.", "Priest")
  87. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Mage.", "Mage")
  88. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Scout.", "Scout")
  89. Dialog.Start()
  90. end
  91. function Scout(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. Dialog.New(NPC, Spawn)
  94. Dialog.AddDialog("A scout, eh? Good. We can use someone with a cool head and a keen eye with all the goblins causing trouble around here. As a scout, you'll use your stealth and speed to sneak up on opponents and take them out quickly. Watch yourself though, because if you're not quick enough, a good strong blow will certainly take its toll on you. You think you can handle that?")
  95. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk006.mp3",3084961366, 1162504968)
  96. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  97. Dialog.AddOption("Yes.", "YesS")
  98. Dialog.AddOption("No, I don't think I'm a scout after all. ", "No")
  99. Dialog.Start()
  100. end
  101. function YesS(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. SetStepComplete(Spawn,IsleIntro,1)
  104. SetAdventureClass(Spawn,31)
  105. SendMessage(Spawn, "Congratulations! You have chosen the path of the Scout.","yellow")
  106. OfferQuest(NPC,Spawn,ScoutGI)
  107. if GetLevel(Spawn)<3 then
  108. SetPlayerLevel(Spawn,3)
  109. end
  110. end
  111. function Priest(NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. Dialog.New(NPC, Spawn)
  114. Dialog.AddDialog("A priest, eh? Well, I'm not a religious man myself, but it can't hurt to have a little divine wrath on our side with all these goblins about. As a priest, your first duty should be healing and blessing your comrades using divine power.")
  115. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk005.mp3",3178428692, 3357533426)
  116. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  117. Dialog.AddOption("Yes.", "PContinue")
  118. Dialog.AddOption("No, I don't think I'm a priest after all. ", "No")
  119. Dialog.Start()
  120. end
  121. function PContinue(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. Dialog.New(NPC, Spawn)
  124. Dialog.AddDialog("Though, most priests I've seen are no strangers to combat, and you should be able to take a pretty good beating and walk away. You think you can handle that?")
  125. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk016.mp3",1887135280, 3302385767)
  126. Dialog.AddOption("Yes.", "YesP")
  127. Dialog.AddOption("No, I don't think I'm a priest after all. ", "No")
  128. Dialog.Start()
  129. end
  130. function YesP(NPC, Spawn)
  131. FaceTarget(NPC, Spawn)
  132. SetAdventureClass(Spawn,11)
  133. SetStepComplete(Spawn,IsleIntro,1)
  134. SendMessage(Player, "Congratulations! You have chosen the path of the Priest.","yellow")
  135. OfferQuest(NPC,Spawn,PriestGI)
  136. SetStepComplete()
  137. if GetLevel(Spawn)<3 then
  138. SetPlayerLevel(Spawn,3)
  139. end
  140. end
  141. function PContinue2(NPC, Spawn)
  142. FaceTarget(NPC, Spawn)
  143. Dialog.New(NPC, Spawn)
  144. SetStepComplete(Spawn,IsleIntro,1)
  145. SetAdventureClass(Spawn,11)
  146. Dialog.AddDialog("I know you may think this is none of your affair, but trust me, if you want to get off this island alive and well you have no choice. Come back to me after you've defeated at least one Gruttooth invader and maybe I can help you out.")
  147. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk009.mp3",3552772782, 395294110)
  148. PlayFlavor(NPC, "", "", "shrug", 0, 0, Spawn)
  149. Dialog.AddOption("Very well.")
  150. Dialog.Start()
  151. end
  152. function Mage(NPC, Spawn)
  153. FaceTarget(NPC, Spawn)
  154. Dialog.New(NPC, Spawn)
  155. Dialog.AddDialog("A mage, eh? Well, I suppose we can use another finger wiggler to blast those goblins. As a mage, you'll want to keep out of harm's way, casting spells at your opponents from afar while using your skills to bolster the strengths of your comrades. You think you can handle that?")
  156. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk004.mp3",4064296698, 2344383493)
  157. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  158. Dialog.AddOption("Yes.", "YesM")
  159. Dialog.AddOption("No, I don't think I'm a mage after all. ", "No")
  160. Dialog.Start()
  161. end
  162. function YesM(NPC, Spawn)
  163. FaceTarget(NPC, Spawn)
  164. SetStepComplete(Spawn,IsleIntro,1)
  165. SendMessage(Spawn, "Congratulations! You have chosen the path of the Mage.","yellow")
  166. SetAdventureClass(Spawn,21)
  167. OfferQuest(NPC,Spawn,MageGI)
  168. if GetLevel(Spawn)<3 then
  169. SetPlayerLevel(Spawn,3)
  170. end
  171. end
  172. function Fighter(NPC, Spawn)
  173. FaceTarget(NPC, Spawn)
  174. Dialog.New(NPC, Spawn)
  175. Dialog.AddDialog("A fighter, eh? Good. We could always use another blade to stick it to them goblins. As a fighter, you'll be in the thick of battle most of the time protecting your comrades from harm and relying on your equipment and combat skills to see you through it. Are you sure you can handle that?")
  176. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk003.mp3",2483812804, 239361223)
  177. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  178. Dialog.AddOption("Yes.", "YesF")
  179. Dialog.AddOption("No, I don't think I'm a fighter after all. ", "No")
  180. Dialog.Start()
  181. end
  182. function YesF(NPC, Spawn)
  183. FaceTarget(NPC, Spawn)
  184. SetStepComplete(Spawn,IsleIntro,1)
  185. SetAdventureClass(Spawn,1)
  186. SendMessage(Spawn, "Congratulations! You have chosen the path of the Fighter.","yellow")
  187. OfferQuest(NPC,Spawn,FighterGI)
  188. if GetLevel(Spawn)<3 then
  189. SetPlayerLevel(Spawn,3)
  190. end
  191. end
  192. function No(NPC, Spawn)
  193. FaceTarget(NPC, Spawn)
  194. Dialog.New(NPC, Spawn)
  195. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  196. Dialog.AddDialog("Yes, I didn't think you looked the type. So what is your profession?")
  197. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Fighter.", "Fighter")
  198. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Priest.", "Priest")
  199. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Mage.", "Mage")
  200. Dialog.AddOption("My name is "..GetName(Spawn)..". I am a Scout.", "Scout")
  201. Dialog.Start()
  202. end
  203. function Dialog2(NPC,Spawn)
  204. -- if HasCompletedQuest(Spawn, IsleIntro) then
  205. if GetClass(Spawn) == 1 then
  206. OfferQuest(NPC, Spawn,FighterGI)
  207. elseif GetClass(Spawn) == 31 then
  208. OfferQuest(NPC, Spawn,ScoutGI)
  209. elseif GetClass(Spawn) == 21 then
  210. OfferQuest(NPC, Spawn,MageGI)
  211. elseif GetClass(Spawn) == 11 then
  212. OfferQuest(NPC, Spawn,PriestGI)
  213. end
  214. end
  215. function Dialog3F(NPC, Spawn)
  216. FaceTarget(NPC, Spawn)
  217. Dialog.New(NPC, Spawn)
  218. Dialog.AddDialog("Well done, you might make it off this island after all. I'll tell you what. Take this pair of gloves for your help, you're sure to need all the protection you can get for the duration of your stay here. Now if you actually want to get off this island and see one of the big cities one day, I suggest you talk to Braksan Steelforge. He's in charge of all the new fighters and can be found at the forge in town. Good luck to you.")
  219. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk011.mp3",2701236419, 2048899466)
  220. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  221. Dialog.AddOption("Thanks.", "thanksF")
  222. Dialog.Start()
  223. end
  224. function Dialog3P(NPC, Spawn)
  225. FaceTarget(NPC, Spawn)
  226. Dialog.New(NPC, Spawn)
  227. if GetQuestStep(Spawn, PriestGI)==3 then
  228. SetStepComplete(Spawn,PriestGI,3)
  229. end
  230. Dialog.AddDialog("Well done, you might make it off this island after all. I'll tell you what. Take this pair of gloves for your help, you're sure to need all the protection you can get for the duration of your stay here. Now if you actually want to get off this island and see one of the big cities one day, I suggest you talk to Nathinia Sparklebright. She's in charge of all the new priests and can usually be found meditating by the fountain in town. Good luck to you.")
  231. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk013.mp3",2629138790, 804939192)
  232. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  233. Dialog.AddOption("Thanks.", "thanksP")
  234. Dialog.Start()
  235. end
  236. function Dialog3M(NPC, Spawn)
  237. FaceTarget(NPC, Spawn)
  238. Dialog.New(NPC, Spawn)
  239. if GetQuestStep(Spawn, MageGI)==3 then
  240. SetStepComplete(Spawn,MageGI,3)
  241. end
  242. Dialog.AddDialog("Well done, you might make it off this island after all. I'll tell you what. Take this pair of gloves for your help, you're sure to need all the protection you can get for the duration of your stay here. Now if you actually want to get off this island and see one of the big cities one day, I suggest you talk to Mizan Vaeoulin. He's in charge of all the new mages and can be found inside the wizard tower in town. Good luck to you.")
  243. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk012.mp3", 1248305011, 3683529392)
  244. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  245. Dialog.AddOption("Thanks.", "thanksM")
  246. Dialog.Start()
  247. end
  248. function Dialog3S(NPC, Spawn)
  249. FaceTarget(NPC, Spawn)
  250. Dialog.New(NPC, Spawn)
  251. if GetQuestStep(Spawn, ScoutGI)==3 then
  252. SetStepComplete(Spawn,ScoutGI,3)
  253. end
  254. Dialog.AddDialog("Well done, you might make it off this island after all. I'll tell you what. Take this pair of gloves for your help, you're sure to need all the protection you can get for the duration of your stay here. Now if you actually want to get off this island and see one of the big cities one day, I suggest you talk to Vladiminn. That wily ratonga is in charge of all the new scouts and can usually be found at the archery range in town. Good luck to you.")
  255. Dialog.AddVoiceover("voiceover/english/garven_tralk/tutorial_island02/garventralk014.mp3", 3569991620, 129801619)
  256. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  257. Dialog.AddOption("Thanks.", "thanksS")
  258. Dialog.Start()
  259. end
  260. function thanksF(NPC,Spawn)
  261. if GetQuestStep(Spawn, FighterGI)==3 then
  262. SetStepComplete(Spawn,FighterGI,3)
  263. end
  264. if not HasQuest(Spawn,Fighter2) and not HasCompletedQuest(Spawn,Fighter2)then
  265. OfferQuest(NPC, Spawn,Fighter2)
  266. end
  267. end
  268. function thanksP(NPC,Spawn)
  269. if GetQuestStep(Spawn, PriestGI)==3 then
  270. SetStepComplete(Spawn,PriestGI,3)
  271. end
  272. if not HasQuest(Spawn,Priest2) and not HasCompletedQuest(Spawn,Priest2)then
  273. OfferQuest(NPC, Spawn,Priest2)
  274. end
  275. end
  276. function thanksM(NPC,Spawn)
  277. if GetQuestStep(Spawn, MageGI)==3 then
  278. SetStepComplete(Spawn,MageGI,3)
  279. end
  280. if not HasQuest(Spawn,Mage2) and not HasCompletedQuest(Spawn,Mage2)then
  281. OfferQuest(NPC, Spawn,Mage2)
  282. end
  283. end
  284. function thanksS(NPC,Spawn)
  285. if GetQuestStep(Spawn, ScoutGI)==3 then
  286. SetStepComplete(Spawn,ScoutGI,3)
  287. end
  288. if not HasQuest(Spawn,Scout2) and not HasCompletedQuest(Spawn,Scout2)then
  289. OfferQuest(NPC, Spawn,Scout2)
  290. end
  291. end