9
3

ArbbetorTAvi.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. --[[
  2. Script Name : SpawnScripts/FreeportCitizenshipTrialChamber/ArbbetorTAvi.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.22 06:06:39
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local BBFCitizen = 5866 --BigBend
  10. local Beg_FCitizen = 5867--Beggar's Court
  11. local LA_FCitizen = 5868--Longshadow
  12. local Scale_FCitizen = 5869--ScaleYard
  13. local Stone_FCitizen = 5870--Stonestair
  14. local Temp_FCitizen = 5871--TempltSt
  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,BBFCitizen )==3 or GetQuestStep (Spawn,Beg_FCitizen )==3 or GetQuestStep (Spawn,LA_FCitizen)==3 or GetQuestStep (Spawn,Scale_FCitizen )==3 or GetQuestStep (Spawn,Stone_FCitizen )==3 or GetQuestStep (Spawn,Temp_FCitizen)==3 then
  24. FaceTarget(NPC, Spawn)
  25. PlayFlavor(NPC, "voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetor_tavi_callout_5ab3b4e6.mp3","Hey you! Get over here!", "point", 3348850018,53224247, 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,BBFCitizen )==3 or GetQuestStep (Spawn,Beg_FCitizen )==3 or GetQuestStep (Spawn,LA_FCitizen)==3 or GetQuestStep (Spawn,Scale_FCitizen )==3 or GetQuestStep (Spawn,Stone_FCitizen )==3 or GetQuestStep (Spawn,Temp_FCitizen)==3 then
  33. Dialog1(NPC,Spawn)
  34. elseif GetQuestStep (Spawn,BBFCitizen )==5 or GetQuestStep (Spawn,Beg_FCitizen )==5 or GetQuestStep (Spawn,LA_FCitizen)==5 or GetQuestStep (Spawn,Scale_FCitizen )==5 or GetQuestStep (Spawn,Stone_FCitizen )==5 or GetQuestStep (Spawn,Temp_FCitizen)==5 then
  35. Dialog2(NPC,Spawn)
  36. elseif GetQuestStep(Spawn,BBFCitizen )==4 or
  37. GetQuestStep(Spawn,Beg_FCitizen )==4 or
  38. GetQuestStep(Spawn,LA_FCitizen)==4 or
  39. GetQuestStep(Spawn,Scale_FCitizen )==4 or
  40. GetQuestStep(Spawn,Stone_FCitizen )==4 or
  41. GetQuestStep(Spawn,Temp_FCitizen)==4 then
  42. Dialog3(NPC,Spawn)
  43. DoorCheck(NPC,Spawn)
  44. elseif HasCompletedQuest(Spawn,BBFCitizen ) or HasCompletedQuest(Spawn,Beg_FCitizen ) or HasCompletedQuest(Spawn,LA_FCitizen) or HasCompletedQuest(Spawn,Scale_FCitizen ) or HasCompletedQuest(Spawn,Stone_FCitizen ) or HasCompletedQuest(Spawn,Temp_FCitizen) then
  45. Dialog2(NPC,Spawn)
  46. else
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC, "voiceover/english/erudite_eco_good_1/ft/erudite/erudite_eco_good_1_notcitizen_gf_48350e59.mp3","You're not allowed in here! Off with you until you've proven yourself to complete this trial.", "glare", 3405287024, 2122169059, Spawn)
  49. end
  50. end
  51. function DoorCheck(NPC,Spawn)
  52. Door = GetSpawn(NPC,1640023)
  53. if Door ~= nil then
  54. Despawn(Door)
  55. end
  56. local zone = GetZone(NPC)
  57. if GetSpawnByLocationID(zone,133785371) ~=nil then
  58. Despawn(GetSpawnByLocationID(zone,133785371))
  59. end
  60. end
  61. function Dialog1(NPC,Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("Well, well... I've been expecting you. You're not quite what I hoped, given T'Kirr's glowing recommendation, but you'll do.")
  65. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi001.mp3", 1917752715, 2073406033)
  66. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  67. Dialog.AddOption("Do? What do you mean?", "Option1A")
  68. Dialog.Start()
  69. end
  70. function Option1A (NPC,Spawn)
  71. FaceTarget(NPC, Spawn)
  72. Dialog.New(NPC, Spawn)
  73. Dialog.AddDialog("You're here to become a citizen, aren't you?")
  74. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi002.mp3", 2786599552, 1370339276)
  75. PlayFlavor(NPC,"","","",0,0,Spawn)
  76. Dialog.AddOption("Of course.", "Option1B")
  77. Dialog.Start()
  78. end
  79. function Option1B(NPC,Spawn)
  80. FaceTarget(NPC, Spawn)
  81. Dialog.New(NPC, Spawn)
  82. Dialog.AddDialog("Then stop talking and start listening. The Overlord has little time for those who don't know when to hold their tongue.")
  83. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi003.mp3", 543002968, 1965375267)
  84. PlayFlavor(NPC,"","","scold",0,0,Spawn)
  85. Dialog.AddOption("Speak to me like that again...", "Option1Fb")
  86. Dialog.AddOption("...", "Option1C")
  87. Dialog.Start()
  88. end
  89. function Option1C(NPC,Spawn)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. Dialog.AddDialog("I see you learn quickly. Now let's move on.")
  93. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi005.mp3", 194269005, 133004706)
  94. Dialog.AddOption("[continue]", "Option1D")
  95. Dialog.Start()
  96. end
  97. function Option1D(NPC,Spawn)
  98. FaceTarget(NPC, Spawn)
  99. Dialog.New(NPC, Spawn)
  100. Dialog.AddDialog("I've discovered a den of traitorous dogs that must be punished. The Overlord's will cannot be questioned. These beasts must suffer a terrible fate.")
  101. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi006.mp3", 476682468, 1543848106)
  102. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  103. Dialog.AddOption("I am to interrorgate them? Kill them, perhaps?", "Option1E")
  104. Dialog.AddOption("What do I get out of this?", "Option1Ea")
  105. Dialog.Start()
  106. end
  107. function Option1Ea(NPC,Spawn) --Evil
  108. FaceTarget(NPC, Spawn)
  109. Dialog.New(NPC, Spawn)
  110. Dialog.AddDialog("The honor of living among the elite, the citizens of Freeport. And, of course, you get to move out of this pit and away from the refugee trash, though with your attitude...")
  111. -- Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi004.mp3", 922126162, 3879014430)
  112. PlayFlavor(NPC,"","","stare",0,0,Spawn)
  113. Dialog.AddOption("I just don't understand why I should do YOUR job!", "Option1Fb")
  114. Dialog.AddOption("[continue]", "Option1F")
  115. Dialog.Start()
  116. end
  117. function Option1E(NPC,Spawn)
  118. FaceTarget(NPC, Spawn)
  119. Dialog.New(NPC, Spawn)
  120. Dialog.AddDialog("Indeed you are.")
  121. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi007.mp3", 1995736381, 541616666)
  122. Dialog.AddOption("[Continue]", "Option1F")
  123. Dialog.Start()
  124. end
  125. function Option1F(NPC,Spawn)
  126. FaceTarget(NPC, Spawn)
  127. Dialog.New(NPC, Spawn)
  128. Dialog.AddDialog("As I was saying ... We ... err... I will determine your worth by how you take care of these misguided fools.")
  129. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi006.mp3", 2699197105, 566046082)
  130. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  131. Dialog.AddOption("I am ready to serve my Overlord.", "Option1C")
  132. Dialog.Start()
  133. end
  134. function Option1Fa(NPC,Spawn) --Evil
  135. FaceTarget(NPC, Spawn)
  136. Dialog.New(NPC, Spawn)
  137. Dialog.AddDialog("Or you'll what? The Overlord brooks no insolence and neither do I. You'll find little tolerance for back talk here. Let's get on with this.")
  138. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi004.mp3", 922126162, 3879014430)
  139. PlayFlavor(NPC,"","","stare",0,0,Spawn)
  140. Dialog.AddOption("No one tells me what to do! My greatness knows no bounds!", "Option1Fb")
  141. Dialog.AddOption("[Listen quietly]", "Option1C")
  142. Dialog.Start()
  143. end
  144. function Option1Fb(NPC,Spawn) --Evil Fail
  145. FaceTarget(NPC, Spawn)
  146. Dialog.New(NPC, Spawn)
  147. Dialog.AddDialog("Fool! The Overlord is watching you as we speak.")
  148. Dialog.AddVoiceover("voiceover/english/optional2/darkelf_eco_evil_3/ft/darkelf/darkelf_eco_evil_3_notcitizen_gf_e5838bd0.mp3", 644059683, 1813641447)
  149. PlayFlavor(NPC,"","","boggle",0,0,Spawn)
  150. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  151. Dialog.AddOption("Ummm... I should be going.")
  152. Dialog.Start()
  153. SendPopUpMessage(Spawn,"The Overlord finds your obedience lacking.",250,50,50)
  154. AddTimer(NPC,4500,"FailureExit",1,Spawn)
  155. end
  156. function Option1F(NPC,Spawn)
  157. FaceTarget(NPC, Spawn)
  158. Dialog.New(NPC, Spawn)
  159. Dialog.AddDialog("Go forth. Punish them as they deserve and as the Overlord commands. Your reward lies on the far side: entrance to the great city of Freeport.")
  160. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi010.mp3", 3234477305, 2227612151)
  161. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  162. Dialog.AddOption("Thank you Abbetor.")
  163. Dialog.Start()
  164. DoorCheck(NPC,Spawn)
  165. if HasQuest(Spawn,BBFCitizen ) then
  166. SetStepComplete(Spawn,BBFCitizen ,3)
  167. elseif HasQuest(Spawn,Beg_FCitizen) then
  168. SetStepComplete(Spawn,Beg_FCitizen,3)
  169. elseif HasQuest(Spawn,LA_FCitizen) then
  170. SetStepComplete(Spawn,LA_FCitizen,3)
  171. elseif HasQuest(Spawn,Scale_FCitizen) then
  172. SetStepComplete(Spawn,Scale_FCitizen,3)
  173. elseif HasQuest(Spawn,Stone_FCitizen) then
  174. SetStepComplete(Spawn,Stone_FCitizen,3)
  175. elseif HasQuest(Spawn,Temp_FCitizen) then
  176. SetStepComplete(Spawn,Temp_FCitizen,3)
  177. end
  178. if HasQuest(Spawn,5860) and GetQuestStep(Spawn,5860)==13 then
  179. SetStepComplete(Spawn,5860,13)
  180. elseif HasQuest(Spawn,5861) and GetQuestStep(Spawn,5861)==13 then
  181. SetStepComplete(Spawn,5861,13)
  182. elseif HasQuest(Spawn,5862) and GetQuestStep(Spawn,5862)==13 then
  183. SetStepComplete(Spawn,5862,13)
  184. elseif HasQuest(Spawn,5863) and GetQuestStep(Spawn,5863)==13 then
  185. SetStepComplete(Spawn,5863,13)
  186. elseif HasQuest(Spawn,5864) and GetQuestStep(Spawn,5864)==13 then
  187. SetStepComplete(Spawn,5864,13)
  188. elseif HasQuest(Spawn,5859) and GetQuestStep(Spawn,5859)==13 then
  189. SetStepComplete(Spawn,5859,13)
  190. end
  191. end
  192. function Dialog2(NPC,Spawn)
  193. FaceTarget(NPC, Spawn)
  194. Dialog.New(NPC, Spawn)
  195. Dialog.AddDialog("You surprised me... Your paperwork is signed, offically making you a citizen of Freeport. Let your actions continue to prove true to the Overlord, and we won't have to meet down here again under different circumstances...") --FABRICATED
  196. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_3_1033.mp3", 0, 0)
  197. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  198. Dialog.AddOption("Those traitors got what they deserved.")
  199. Dialog.AddOption("By The Overlord's will.")
  200. Dialog.AddOption("As a citizen, what can I do now?", "Option2A")
  201. Dialog.Start()
  202. if HasQuest(Spawn,5860) and GetQuestStep(Spawn,5860)==14 then
  203. SetStepComplete(Spawn,5860,14)
  204. elseif HasQuest(Spawn,5861) and GetQuestStep(Spawn,5861)==14 then
  205. SetStepComplete(Spawn,5861,14)
  206. elseif HasQuest(Spawn,5862) and GetQuestStep(Spawn,5862)==14 then
  207. SetStepComplete(Spawn,5862,14)
  208. elseif HasQuest(Spawn,5863) and GetQuestStep(Spawn,5863)==14 then
  209. SetStepComplete(Spawn,5863,14)
  210. elseif HasQuest(Spawn,5864) and GetQuestStep(Spawn,5864)==14 then
  211. SetStepComplete(Spawn,5864,14)
  212. elseif HasQuest(Spawn,5859) and GetQuestStep(Spawn,5859)==14 then
  213. SetStepComplete(Spawn,5859,14)
  214. end
  215. if HasQuest(Spawn,BBFCitizen ) then
  216. SetStepComplete(Spawn,BBFCitizen ,5)
  217. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  218. AddTimer(NPC,500,"Citizen",1,Spawn)
  219. elseif HasQuest(Spawn,Beg_FCitizen ) then
  220. SetStepComplete(Spawn,Beg_FCitizen ,5)
  221. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  222. AddTimer(NPC,500,"Citizen",1,Spawn)
  223. elseif HasQuest(Spawn,LA_FCitizen) then
  224. SetStepComplete(Spawn,LA_FCitizen,5)
  225. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  226. AddTimer(NPC,500,"Citizen",1,Spawn)
  227. elseif HasQuest(Spawn,Scale_FCitizen ) then
  228. SetStepComplete(Spawn,Scale_FCitizen ,5)
  229. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  230. AddTimer(NPC,500,"Citizen",1,Spawn)
  231. elseif HasQuest(Spawn,Stone_FCitizen ) then
  232. SetStepComplete(Spawn,Stone_FCitizen ,5)
  233. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  234. AddTimer(NPC,500,"Citizen",1,Spawn)
  235. elseif HasQuest(Spawn,Temp_FCitizen) then
  236. SetStepComplete(Spawn,Temp_FCitizen,5)
  237. AddSpellBookEntry(Spawn, 8057, 1) --CALL TO FREEPORT
  238. AddTimer(NPC,500,"Citizen",1,Spawn)
  239. end
  240. end
  241. function Citizen(NPC,Spawn)
  242. SendMessage(Spawn, "You are now a Citizen of Freeport!","yellow")
  243. SendPopUpMessage(Spawn, "You are now a Citizen of Freeport!",250,250,250)
  244. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  245. ApplySpellVisual(Spawn, 324)
  246. end
  247. function Option2A(NPC,Spawn)
  248. FaceTarget(NPC, Spawn)
  249. Dialog.New(NPC, Spawn)
  250. Dialog.AddDialog("I'll offer you one warning: Watch your step and your purse in Freeport. This city is full of questionable characters who would love to relieve you of your coin and your life. Now be on your way.")--FABRICATED
  251. Dialog.AddVoiceover("voiceover/english/julie_danerous/fprt_east/100_questjuliedanerou_multhail1_6195b062.mp3", 3623154907, 3385551552)
  252. Dialog.AddOption("I'll keep that in mind.","Done")
  253. Dialog.Start()
  254. end
  255. function Dialog3(NPC,Spawn)
  256. FaceTarget(NPC, Spawn)
  257. Dialog.New(NPC, Spawn)
  258. Dialog.AddDialog("Why are you speaking to me? Finish your task!")
  259. PlayFlavor(NPC, "","", "no", 0,0, Spawn)
  260. Dialog.AddVoiceover("voiceover/english/abbetor_t_avi/fprt_sewer_epic08/abbetortavi012.mp3", 3529749208, 569435182)
  261. Dialog.AddOption("Ok, ok!")
  262. Dialog.Start()
  263. end
  264. function Done(NPC,Spawn)
  265. PlayFlavor(NPC,"","","salute_freeport",0,0,Spawn)
  266. end
  267. function FailureExit(NPC,Spawn)
  268. CloseConversation(NPC,Spawn)
  269. Race = GetRace(Spawn)
  270. -- Erudite / Kerra
  271. if Race == 3 or Race == 11 then
  272. ZoneRef = GetZone("Stonestair")
  273. Zone(ZoneRef,Spawn,3.24, -4.37, -98.46, 185.35)
  274. -- Ratonga / Gnome
  275. elseif Race == 5 or Race == 13 then
  276. ZoneRef = GetZone("TempleSt")
  277. Zone(ZoneRef,Spawn,21.81, 2.92, 21.37, 190.87)
  278. -- Human / Half Elf
  279. elseif Race == 9 or Race == 6 then
  280. ZoneRef = GetZone("BeggarsCourt")
  281. Zone(ZoneRef,Spawn,61.07, -7.08, 111.67, 339.27)
  282. -- Orge / Troll
  283. elseif Race == 12 or Race == 14 then
  284. ZoneRef = GetZone("BigBend")
  285. Zone(ZoneRef,Spawn,94.12, -2.00, 2.53, 98)
  286. -- Dark Elf
  287. elseif Race == 1 or Race == 19 or Race == 17 then
  288. ZoneRef = GetZone("longshadow")
  289. Zone(ZoneRef,Spawn,4.22, 3.00, 71.07, 353.87)
  290. -- Barbarian / Iksar / Sarnak
  291. elseif Race == 0 or Race == 10 or Race == 18 then
  292. ZoneRef = GetZone("ScaleYard")
  293. Zone(ZoneRef,Spawn,-6.78, -5.63, -12.96, 194.63)
  294. else
  295. ZoneRef = GetZone("BeggarsCourt")
  296. Zone(ZoneRef,Spawn,58.67, -7.08, 112.61, 352.60)
  297. end
  298. end