9
3

MarshalGlorfel.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. --[[
  2. Script Name : SpawnScripts/Qeynos Citizenship Trial Chamber/MarshalGlorfel.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.30 05:08:52
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local BQCitizen = 5718
  10. local CVQCitizen = 5719
  11. local GQCitizen = 5720
  12. local NQCitizen = 5721
  13. local SCQCitizen = 5722
  14. local WWQCitizen = 5723
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function InRange(NPC, Spawn)
  22. SetTarget(NPC,Spawn)
  23. if GetQuestStep (Spawn,BQCitizen)==3 or GetQuestStep (Spawn,CVQCitizen)==3 or GetQuestStep (Spawn,GQCitizen)==3 or GetQuestStep (Spawn,NQCitizen)==3 or GetQuestStep (Spawn,SCQCitizen)==3 or GetQuestStep (Spawn,WWQCitizen)==3 then
  24. FaceTarget(NPC, Spawn)
  25. PlayFlavor(NPC, "","Ahh, yer just in time!", "hello", 0,0, Spawn)
  26. end
  27. end
  28. function LeaveRange(NPC, Spawn)
  29. SetTarget(NPC,nil)
  30. end
  31. function hailed(NPC, Spawn)
  32. if GetQuestStep (Spawn,BQCitizen)==3 or GetQuestStep (Spawn,CVQCitizen)==3 or GetQuestStep (Spawn,GQCitizen)==3 or GetQuestStep (Spawn,NQCitizen)==3 or GetQuestStep (Spawn,SCQCitizen)==3 or GetQuestStep (Spawn,WWQCitizen)==3 then
  33. Dialog1(NPC,Spawn)
  34. elseif GetQuestStep (Spawn,BQCitizen)==5 or GetQuestStep (Spawn,CVQCitizen)==5 or GetQuestStep (Spawn,GQCitizen)==5 or GetQuestStep (Spawn,NQCitizen)==5 or GetQuestStep (Spawn,SCQCitizen)==5 or GetQuestStep (Spawn,WWQCitizen)==5 then
  35. Dialog2(NPC,Spawn)
  36. elseif GetQuestStep(Spawn,BQCitizen)==4 or
  37. GetQuestStep(Spawn,CVQCitizen)>=4 or
  38. GetQuestStep(Spawn,GQCitizen)>=4 or
  39. GetQuestStep(Spawn,NQCitizen)>=4 or
  40. GetQuestStep(Spawn,SCQCitizen)>=4 or
  41. GetQuestStep(Spawn,WWQCitizen)>=4 then
  42. Dialog3(NPC,Spawn)
  43. DoorCheck(NPC,Spawn)
  44. elseif HasCompletedQuest(Spawn,BQCitizen) or HasCompletedQuest(Spawn,CVQCitizen) or HasCompletedQuest(Spawn,GQCitizen) or HasCompletedQuest(Spawn,NQCitizen) or HasCompletedQuest(Spawn,SCQCitizen) or HasCompletedQuest(Spawn,WWQCitizen) then
  45. Dialog2(NPC,Spawn)
  46. else
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_48350e59.mp3","Hey! You're not allowed in here! Off with ya until you've proven yourself to complete this trial.", "glare", 1734668326, 429140096, Spawn)
  49. end
  50. end
  51. function Dialog1(NPC,Spawn)
  52. FaceTarget(NPC, Spawn)
  53. Dialog.New(NPC, Spawn)
  54. Dialog.AddDialog("Ya see, we got a problem with a group who decided to break away from Qeynos, and I heard of the fine things ya did on the Island of Refuge.")
  55. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel001.mp3", 1972383345, 185623710)
  56. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  57. Dialog.AddOption("Who would want to do that?", "Option1A")
  58. Dialog.AddOption("Wouldn't they just be allowed to leave?", "Option1Aa")
  59. Dialog.Start()
  60. end
  61. function Option1A(NPC,Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("Some people are too set in their ways to live in our open society, or else they've been lured away to Freeport by the promise of wealth that they'll never receive.")
  65. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel002.mp3", 1674795503, 1640631237)
  66. Dialog.AddOption("[continue]", "Option1B")
  67. Dialog.Start()
  68. end
  69. function Option1Aa (NPC,Spawn)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("Of course, they're allowed to leave. Problem is, these folks have been plottin' the murder of one of our fine citizens, and we can't have that.")
  73. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel003.mp3", 932259166, 3680508066)
  74. PlayFlavor(NPC,"","","boggle",0,0,Spawn)
  75. Dialog.AddOption("[continue]", "Option1B")
  76. Dialog.Start()
  77. end
  78. function Option1B(NPC,Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("These murderous scoundrels planned to slay our very own Baron Ironforge. Though their plans never came to fruition, Baron Ironforge still lives due only to the heroics of one of Qeynos' fine adventuring companies and a keg of imported halfling ale.")
  82. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel004.mp3", 1462903596, 2724798765)
  83. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  84. Dialog.AddOption("Which company was it?", "Option1C")
  85. Dialog.Start()
  86. end
  87. function Option1C(NPC,Spawn)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("Twas the great Halfer's Company. Not a one among 'em that's not a halfling or half elf. Strange lot, indeed! At any rate, we need to teach these ruffians a lesson. We'll leave this to yer judgment, if you can return the senses to any of these traitors, by all means, do so.")
  91. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel005.mp3", 3056107447, 1822754190)
  92. Dialog.AddOption("By judgment, you mean save who I can and kill the rest?", "Option1D")
  93. Dialog.AddOption("They're all guilty of treason and will pay the price.", "Option1Fa")
  94. Dialog.Start()
  95. end
  96. function Option1D(NPC,Spawn)
  97. FaceTarget(NPC, Spawn)
  98. Dialog.New(NPC, Spawn)
  99. Dialog.AddDialog("That's right! Those who mean ill will to our people mustn't live, even if they're off to Freeport. It's your job to succeed where one of our knights failed.")
  100. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel006.mp3", 3980894706, 4254118210)
  101. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  102. Dialog.AddOption("I will not disappoint.", "Option1E")
  103. Dialog.Start()
  104. end
  105. function Option1E(NPC,Spawn)
  106. FaceTarget(NPC, Spawn)
  107. Dialog.New(NPC, Spawn)
  108. Dialog.AddDialog("So, what's the first thing ya do when ye come across one of em?")
  109. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel008.mp3", 344841247, 3075235208)
  110. Dialog.AddOption("Speak with them, and convince them of the error of their ways.", "Option1F")
  111. Dialog.AddOption("A little bit of torture serves them right!", "Option1Fa")
  112. Dialog.AddOption("Kill them!", "Option1Fb")
  113. Dialog.Start()
  114. end
  115. function Option1Fa(NPC,Spawn) --Evil
  116. FaceTarget(NPC, Spawn)
  117. Dialog.New(NPC, Spawn)
  118. Dialog.AddDialog("Whoa, now! Ya sound a bit like the enemy. Be careful that when yer meting out yer judgment that ya don't become like those yer fixin' to judge.")
  119. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel007.mp3", 3117666178, 1750353665)
  120. PlayFlavor(NPC,"","","wince",0,0,Spawn)
  121. Dialog.AddOption("And I'll make sure they suffer a slow and painful death for what they've done.", "Option1Fb")
  122. Dialog.AddOption("Sound advice.", "Option1F")
  123. Dialog.Start()
  124. end
  125. function Option1Fb(NPC,Spawn) --Evil Fail
  126. FaceTarget(NPC, Spawn)
  127. Dialog.New(NPC, Spawn)
  128. Dialog.AddDialog("I think you got more to learn before you're ready to become a citizen of the city.")
  129. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel010.mp3", 799396705,3625137136)
  130. PlayFlavor(NPC,"","","no",0,0,Spawn)
  131. Dialog.AddOption("Noooo! I'm ready now!")
  132. Dialog.Start()
  133. AddTimer(NPC,4500,"FailureExit",1,Spawn)
  134. end
  135. function Option1F(NPC,Spawn)
  136. FaceTarget(NPC, Spawn)
  137. Dialog.New(NPC, Spawn)
  138. Dialog.AddDialog("I think ya got it! Let it be known, you got the full backing of the law, if push comes to shove. We'll understand if you can't make them see the light of reason, just so long as ya give it a shot. If you can prove yourself here, we'll welcome you, with open arms, into the city as a citizen!")
  139. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel009.mp3", 882916375, 603737297)
  140. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  141. Dialog.AddOption("Let us begin, Marshal.")
  142. Dialog.Start()
  143. if HasQuest(Spawn,BQCitizen) then
  144. SetStepComplete(Spawn,BQCitizen,3)
  145. elseif HasQuest(Spawn,CVQCitizen) then
  146. SetStepComplete(Spawn,CVQCitizen,3)
  147. elseif HasQuest(Spawn,GQCitizen) then
  148. SetStepComplete(Spawn,GQCitizen,3)
  149. elseif HasQuest(Spawn,NQCitizen) then
  150. SetStepComplete(Spawn,NQCitizen,3)
  151. elseif HasQuest(Spawn,SCQCitizen) then
  152. SetStepComplete(Spawn,SCQCitizen,3)
  153. elseif HasQuest(Spawn,WWQCitizen) then
  154. SetStepComplete(Spawn,WWQCitizen,3)
  155. end
  156. if HasQuest(Spawn,5760) and GetQuestStep(Spawn,5760)==13 then
  157. SetStepComplete(Spawn,5760,13)
  158. elseif HasQuest(Spawn,5761) and GetQuestStep(Spawn,5761)==13 then
  159. SetStepComplete(Spawn,5761,13)
  160. elseif HasQuest(Spawn,5762) and GetQuestStep(Spawn,5762)==13 then
  161. SetStepComplete(Spawn,5762,13)
  162. elseif HasQuest(Spawn,5763) and GetQuestStep(Spawn,5763)==13 then
  163. SetStepComplete(Spawn,5763,13)
  164. elseif HasQuest(Spawn,5764) and GetQuestStep(Spawn,5764)==13 then
  165. SetStepComplete(Spawn,5764,13)
  166. elseif HasQuest(Spawn,5765) and GetQuestStep(Spawn,5765)==13 then
  167. SetStepComplete(Spawn,5765,13)
  168. end
  169. DoorCheck(NPC,Spawn)
  170. end
  171. function DoorCheck(NPC,Spawn)
  172. Door = GetSpawn(NPC,8250015)
  173. if Door ~= nil then
  174. Despawn(Door)
  175. end
  176. end
  177. function Dialog2(NPC,Spawn)
  178. FaceTarget(NPC, Spawn)
  179. Dialog.New(NPC, Spawn)
  180. Dialog.AddDialog("Well done! Ya proved yourself worthy of being a citizen! You can enter the city through that other door if ya wish! Course, all the other gates will be open too ya as well!")
  181. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel013.mp3", 3736500157, 2254163136)
  182. PlayFlavor(NPC,"","","thanks",0,0,Spawn)
  183. Dialog.AddOption("I'm just glad I could serve Qeynos.")
  184. Dialog.AddOption("As a citizen, what can I do now?", "Option2A")
  185. Dialog.Start()
  186. if HasQuest(Spawn,BQCitizen) and GetQuestStep(Spawn,BQCitizen)==5 then
  187. SetStepComplete(Spawn,BQCitizen,5)
  188. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  189. AddTimer(NPC,500,"Citizen",1,Spawn)
  190. elseif HasQuest(Spawn,CVQCitizen) and GetQuestStep(Spawn,CVQCitizen)==5 then
  191. SetStepComplete(Spawn,CVQCitizen,5)
  192. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  193. AddTimer(NPC,500,"Citizen",1,Spawn)
  194. elseif HasQuest(Spawn,GQCitizen) and GetQuestStep(Spawn,GQCitizen)==5 then
  195. SetStepComplete(Spawn,GQCitizen,5)
  196. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  197. AddTimer(NPC,500,"Citizen",1,Spawn)
  198. elseif HasQuest(Spawn,NQCitizen) and GetQuestStep(Spawn,NQCitizen)==5 then
  199. SetStepComplete(Spawn,NQCitizen,5)
  200. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  201. AddTimer(NPC,500,"Citizen",1,Spawn)
  202. elseif HasQuest(Spawn,SCQCitizen) and GetQuestStep(Spawn,SCQCitizen)==5 then
  203. SetStepComplete(Spawn,SCQCitizen,5)
  204. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  205. AddTimer(NPC,500,"Citizen",1,Spawn)
  206. elseif HasQuest(Spawn,WWQCitizen) and GetQuestStep(Spawn,WWQCitizen)==5 then
  207. SetStepComplete(Spawn,WWQCitizen,5)
  208. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO QEYNOS
  209. AddTimer(NPC,500,"Citizen",1,Spawn)
  210. end
  211. if HasQuest(Spawn,5760) and GetQuestStep(Spawn,5760)==14 then
  212. SetStepComplete(Spawn,5760,14)
  213. elseif HasQuest(Spawn,5761) and GetQuestStep(Spawn,5761)==14 then
  214. SetStepComplete(Spawn,5761,14)
  215. elseif HasQuest(Spawn,5762) and GetQuestStep(Spawn,5762)==14 then
  216. SetStepComplete(Spawn,5762,14)
  217. elseif HasQuest(Spawn,5763) and GetQuestStep(Spawn,5763)==14 then
  218. SetStepComplete(Spawn,5763,14)
  219. elseif HasQuest(Spawn,5764) and GetQuestStep(Spawn,5764)==14 then
  220. SetStepComplete(Spawn,5764,14)
  221. elseif HasQuest(Spawn,5765) and GetQuestStep(Spawn,5765)==14 then
  222. SetStepComplete(Spawn,5765,14)
  223. end
  224. end
  225. function Citizen(NPC,Spawn)
  226. SendMessage(Spawn, "You are now a Citizen of Qeynos!","yellow")
  227. SendPopUpMessage(Spawn, "You are now a Citizen of Qeynos!",250,250,250)
  228. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  229. ApplySpellVisual(Spawn, 324)
  230. end
  231. function Option2A(NPC,Spawn)
  232. FaceTarget(NPC, Spawn)
  233. Dialog.New(NPC, Spawn)
  234. Dialog.AddDialog("If yer lookin' for people to help, there are plenty of 'em within the city gates with things for ya to do!")
  235. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel014.mp3", 3906614612, 3182552932)
  236. Dialog.AddOption("Thanks, I'll see what I can find.","Done")
  237. Dialog.Start()
  238. end
  239. function Dialog3(NPC,Spawn)
  240. FaceTarget(NPC, Spawn)
  241. Dialog.New(NPC, Spawn)
  242. Dialog.AddDialog("What're ya waiting for? Their judgment awaits!")
  243. PlayFlavor(NPC, "","", "no", 0,0, Spawn)
  244. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel011.mp3", 0, 0)
  245. Dialog.AddOption("Ok, ok!")
  246. Dialog.Start()
  247. end
  248. function Done(NPC,Spawn)
  249. PlayFlavor(NPC,"","","salute",0,0,Spawn)
  250. end
  251. function FailureExit(NPC,Spawn)
  252. if GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  253. BBShire = GetZone("Baubbleshire")
  254. Zone(BBShire,Spawn,819.46, -20.60, -525.61, 200.47)
  255. elseif GetRace(Spawn)== 0 or GetRace(Spawn)== 2 then
  256. Gray = GetZone("graystone")
  257. Zone(Gray,Spawn,865.03, -25.45, -97.91, 357.68)
  258. elseif GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  259. CV = GetZone("castleview")
  260. Zone(CV,Spawn,729.01, -21.10, -124.36, 290.81)
  261. elseif GetRace(Spawn)== 9 or GetRace(Spawn)== 11 then
  262. Net = GetZone("nettleville")
  263. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  264. elseif GetRace(Spawn)== 3 or GetRace(Spawn)== 8 then
  265. SC = GetZone("starcrest")
  266. Zone(SC,Spawn,704.07, -20.38, 264.40, 269.84)
  267. elseif GetRace(Spawn)== 15 or GetRace(Spawn)== 16 or GetRace(Spawn)== 6 then
  268. WW = GetZone("willowwood")
  269. Zone(WW,Spawn,809.96, -21.30, -566.02, 323.13)
  270. else
  271. Net = GetZone("nettleville")
  272. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  273. end
  274. end