MarshalGlorfel.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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 BBQCitizen = 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)==8 or GetQuestStep (Spawn,CVQCitizen)==8 or GetQuestStep (Spawn,GQCitizen)==8 or GetQuestStep (Spawn,NQCitizen)==8 or GetQuestStep (Spawn,SCQCitizen)==8 or GetQuestStep (Spawn,WWQCitizen)==8 then
  35. Dialog2(NPC,Spawn)
  36. elseif GetQuestStep(Spawn,BQCitizen)<=5 and GetQuestStep(Spawn,BQCitizen)>=3 or GetQuestStep(Spawn,CVQCitizen)<=5 and GetQuestStep(Spawn,CVQCitizen)>=3 or GetQuestStep(Spawn,GQCitizen)<=5 and GetQuestStep(Spawn,GQCitizen)>=3 or GetQuestStep(Spawn,NQCitizen)<=5 and GetQuestStep(Spawn,NQCitizen)>=3 or GetQuestStep(Spawn,SCQCitizen)<=5 and GetQuestStep(Spawn,SCQCitizen)>=3 or GetQuestStep(Spawn,WWQCitizen)<=5 and GetQuestStep(Spawn,WWQCitizen)>=3 then
  37. Dialog3(NPC,Spawn)
  38. DoorCheck(NPC,Spawn)
  39. elseif HasCompletedQuest(Spawn,QCitizen) then
  40. Dialog2(NPC,Spawn)
  41. else
  42. FaceTarget(NPC, Spawn)
  43. 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)
  44. end
  45. end
  46. function Dialog1(NPC,Spawn)
  47. FaceTarget(NPC, Spawn)
  48. Dialog.New(NPC, Spawn)
  49. 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.")
  50. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel001.mp3", 1972383345, 185623710)
  51. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  52. Dialog.AddOption("Who would want to do that?", "Option1A")
  53. Dialog.AddOption("Wouldn't they just be allowed to leave?", "Option1Aa")
  54. Dialog.Start()
  55. end
  56. function Option1A(NPC,Spawn)
  57. FaceTarget(NPC, Spawn)
  58. Dialog.New(NPC, Spawn)
  59. 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.")
  60. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel002.mp3", 1674795503, 1640631237)
  61. Dialog.AddOption("[continue]", "Option1B")
  62. Dialog.Start()
  63. end
  64. function Option1Aa (NPC,Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. 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.")
  68. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel003.mp3", 932259166, 3680508066)
  69. PlayFlavor(NPC,"","","boggle",0,0,Spawn)
  70. Dialog.AddOption("[continue]", "Option1B")
  71. Dialog.Start()
  72. end
  73. function Option1B(NPC,Spawn)
  74. FaceTarget(NPC, Spawn)
  75. Dialog.New(NPC, Spawn)
  76. 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.")
  77. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel004.mp3", 1462903596, 2724798765)
  78. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  79. Dialog.AddOption("Which company was it?", "Option1C")
  80. Dialog.Start()
  81. end
  82. function Option1C(NPC,Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Dialog.New(NPC, Spawn)
  85. 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.")
  86. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel005.mp3", 3056107447, 1822754190)
  87. Dialog.AddOption("By judgment, you mean save who I can and kill the rest?", "Option1D")
  88. Dialog.AddOption("They're all guilty of treason and will pay the price.", "Option1Fa")
  89. Dialog.Start()
  90. end
  91. function Option1D(NPC,Spawn)
  92. FaceTarget(NPC, Spawn)
  93. Dialog.New(NPC, Spawn)
  94. 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.")
  95. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel006.mp3", 3980894706, 4254118210)
  96. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  97. Dialog.AddOption("I will not disappoint.", "Option1E")
  98. Dialog.Start()
  99. end
  100. function Option1E(NPC,Spawn)
  101. FaceTarget(NPC, Spawn)
  102. Dialog.New(NPC, Spawn)
  103. Dialog.AddDialog("So, what's the first thing ya do when ye come across one of em?")
  104. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel008.mp3", 344841247, 3075235208)
  105. Dialog.AddOption("Speak with them, and convince them of the error of their ways.", "Option1F")
  106. Dialog.AddOption("A little bit of torture serves them right!", "Option1Fa")
  107. Dialog.AddOption("Kill them!", "Option1Fb")
  108. Dialog.Start()
  109. end
  110. function Option1Fa(NPC,Spawn) --Evil
  111. FaceTarget(NPC, Spawn)
  112. Dialog.New(NPC, Spawn)
  113. 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.")
  114. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel007.mp3", 3117666178, 1750353665)
  115. PlayFlavor(NPC,"","","wince",0,0,Spawn)
  116. Dialog.AddOption("And I'll make sure they suffer a slow and painful death for what they've done.", "Option1Fb")
  117. Dialog.AddOption("Sound advice.", "Option1F")
  118. Dialog.Start()
  119. end
  120. function Option1Fb(NPC,Spawn) --Evil Fail
  121. FaceTarget(NPC, Spawn)
  122. Dialog.New(NPC, Spawn)
  123. Dialog.AddDialog("I think you got more to learn before you're ready to become a citizen of the city.")
  124. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel010.mp3", 799396705,3625137136)
  125. PlayFlavor(NPC,"","","no",0,0,Spawn)
  126. Dialog.AddOption("Noooo! I'm ready now!")
  127. Dialog.Start()
  128. AddTimer(NPC,4500,"FailureExit",1,Spawn)
  129. end
  130. function Option1F(NPC,Spawn)
  131. FaceTarget(NPC, Spawn)
  132. Dialog.New(NPC, Spawn)
  133. 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!")
  134. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel009.mp3", 3980894706, 4254118210)
  135. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  136. Dialog.AddOption("Let us begin, Marshal.")
  137. Dialog.Start()
  138. if HasQuest(Spawn,BQCitizen) then
  139. SetStepComplete(Spawn,BQCitizen,3)
  140. elseif HasQuest(Spawn,CVQCitizen) then
  141. SetStepComplete(Spawn,CVQCitizen,3)
  142. elseif HasQuest(Spawn,GQCitizen) then
  143. SetStepComplete(Spawn,GQCitizen,3)
  144. elseif HasQuest(Spawn,NQCitizen) then
  145. SetStepComplete(Spawn,NQCitizen,3)
  146. elseif HasQuest(Spawn,SCQCitizen) then
  147. SetStepComplete(Spawn,SCQCitizen,3)
  148. elseif HasQuest(Spawn,WWQCitizen) then
  149. SetStepComplete(Spawn,WWQCitizen,3)
  150. end
  151. DoorCheck(NPC,Spawn)
  152. end
  153. function DoorCheck(NPC,Spawn)
  154. Door = GetSpawn(NPC,22101355)
  155. if Door ~= nil then
  156. Despawn(Door)
  157. end
  158. end
  159. function Dialog2(NPC,Spawn)
  160. FaceTarget(NPC, Spawn)
  161. Dialog.New(NPC, Spawn)
  162. 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!")
  163. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel013.mp3", 3736500157, 2254163136)
  164. PlayFlavor(NPC,"","","thanks",0,0,Spawn)
  165. Dialog.AddOption("I'm just glad I could serve Qeynos.", "Option2A")
  166. Dialog.AddOption("Now that I am a citizen, what can I do now?", "Option2A")
  167. Dialog.Start()
  168. if HasQuest(Spawn,BQCitizen) then
  169. SetStepComplete(Spawn,BQCitizen,8)
  170. elseif HasQuest(Spawn,CVQCitizen) then
  171. SetStepComplete(Spawn,CVQCitizen,8)
  172. elseif HasQuest(Spawn,GQCitizen) then
  173. SetStepComplete(Spawn,GQCitizen,8)
  174. elseif HasQuest(Spawn,NQCitizen) then
  175. SetStepComplete(Spawn,NQCitizen,8)
  176. elseif HasQuest(Spawn,SCQCitizen) then
  177. SetStepComplete(Spawn,SCQCitizen,8)
  178. elseif HasQuest(Spawn,WWQCitizen) then
  179. SetStepComplete(Spawn,WWQCitizen,8)
  180. end
  181. end
  182. function Option2A(NPC,Spawn)
  183. FaceTarget(NPC, Spawn)
  184. Dialog.New(NPC, Spawn)
  185. Dialog.AddDialog("If yer lookin' for people to help, there are plenty of 'em within the city gates with things for ya to do!")
  186. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel014.mp3", 3906614612, 3182552932)
  187. Dialog.AddOption("Thanks, I'll see what I can find.","Done")
  188. Dialog.Start()
  189. end
  190. function Dialog3(NPC,Spawn)
  191. FaceTarget(NPC, Spawn)
  192. Dialog.New(NPC, Spawn)
  193. Dialog.AddDialog("What're ya waiting for? Their judgment awaits!")
  194. PlayFlavor(NPC, "","", "no", 0,0, Spawn)
  195. Dialog.AddVoiceover("voiceover/english/marshal_glorfel/qey_catacomb_epic01/marshalglorfel011.mp3", 0, 0)
  196. Dialog.AddOption("Ok, ok!")
  197. Dialog.Start()
  198. end
  199. function Done(NPC,Spawn)
  200. PlayFlavor(NPC,"","","salute",0,0,Spawn)
  201. end
  202. function FailureExit(NPC,Spawn)
  203. if GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  204. BBShire = GetZone("Baubbleshire")
  205. Zone(BBShire,Spawn,819.46, -20.60, -525.61, 200.47)
  206. elseif GetRace(Spawn)== 0 or GetRace(Spawn)== 2 then
  207. Gray = GetZone("graystone")
  208. Zone(Gray,Spawn,865.03, -25.45, -97.91, 357.68)
  209. elseif GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  210. CV = GetZone("castleview")
  211. Zone(CV,Spawn,729.01, -21.10, -124.36, 290.81)
  212. elseif GetRace(Spawn)== 9 or GetRace(Spawn)== 11 then
  213. Net = GetZone("nettleville")
  214. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  215. elseif GetRace(Spawn)== 3 or GetRace(Spawn)== 8 then
  216. SC = GetZone("starcrest",704.07, -20.38, 264.40, 269.84)
  217. Zone(SC,Spawn)
  218. elseif GetRace(Spawn)== 15 or GetRace(Spawn)== 16 or GetRace(Spawn)== 6 then
  219. WW = GetZone("willowwood")
  220. Zone(WW,Spawn,809.96, -21.30, -566.02, 323.13)
  221. else
  222. Net = GetZone("nettleville")
  223. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  224. end
  225. end