aQeynosiandefector.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. --[[
  2. Script Name : SpawnScripts/FreeportCitizenshipTrialChamber/aQeynosiandefector.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.25 02:06:46
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/CombatModule"
  10. local BBCitizen = 5866 --Big Bend
  11. local BCCitizen = 5867 --Beggar's Court
  12. local LACitizen = 5868 --Longshadow Alley
  13. local SYCitizen = 5869 -- Scale Yard
  14. local SBCitizen = 5870 --Stonestair Byway
  15. local TSCitizen = 5871 --Temple St
  16. function spawn(NPC)
  17. combatModule(NPC, Spawn)
  18. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  19. end
  20. function InRange(NPC, Spawn)
  21. if not IsInCombat(NPC) then
  22. PlayFlavor(NPC, "","Please, leave me alone!", "cringe", 0,0, Spawn)
  23. end
  24. end
  25. function hailed(NPC, Spawn)
  26. Dialog1(NPC, Spawn)
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end
  31. function Dialog1(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. Dialog.New(NPC, Spawn)
  34. Dialog.AddDialog("I promise I'll do as the Overlord says!")
  35. PlayFlavor(NPC,"","","cringe",0,0,Spawn)
  36. Dialog.AddVoiceover("voiceover/english/a_qeynosian_defector/fprt_sewer_epic08/feigninghelpless000.mp3", 364977579, 2901182928)
  37. Dialog.AddOption("You lie!", "Dialog2")
  38. Dialog.Start()
  39. end
  40. function Dialog2(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. Dialog.New(NPC, Spawn)
  43. Dialog.AddDialog("I beg of you, no! I have a family!")
  44. Dialog.AddVoiceover("voiceover/english/a_qeynosian_defector/fprt_sewer_epic08/feigninghelpless001.mp3", 3339052683, 3646445209)
  45. PlayFlavor(NPC,"","","beg",0,0,Spawn)
  46. Dialog.AddOption("And where is this family now?", "Dialog3")
  47. Dialog.AddOption("All traitors to the Overlord must die.", "AttackTimer")
  48. Dialog.Start()
  49. end
  50. function Dialog3(NPC, Spawn)
  51. FaceTarget(NPC, Spawn)
  52. Dialog.New(NPC, Spawn)
  53. Dialog.AddDialog("They're back in the villa ... err, district, yes, district! We're simple farmers!")
  54. Dialog.AddVoiceover("voiceover/english/a_freeport_traitor/fprt_sewer_epic08/bribingtraitor002.mp3", 0, 0)
  55. PlayFlavor(NPC,"","","whome",0,0,Spawn)
  56. Dialog.AddOption("I understand. Get out of here, quietly!","Fail")
  57. Dialog.AddOption("Fine. Hide your family, but you're finished.", "Dialog4")
  58. Dialog.AddOption("Keep your secrets and die, traitor!", "AttackTimer")
  59. Dialog.Start()
  60. end
  61. function Dialog4(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("...I understand. If it's a fight ya want, it's a fight you'll get!")
  65. Dialog.AddVoiceover("voiceover/english/a_freeport_traitor/fprt_sewer_epic08/bribingtraitor002.mp3", 0, 0)
  66. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  67. Dialog.AddOption("Prepare to die!", "AttackTimer")
  68. Dialog.Start()
  69. end
  70. function AttackTimer(NPC,Spawn)
  71. AddTimer(NPC,1200,"Attacking",1,Spawn)
  72. end
  73. function Attacking(NPC,Spawn)
  74. SpawnSet(NPC,"attackable",1)
  75. SpawnSet(NPC,"show_level",1)
  76. AddPrimaryEntityCommand(Spawn,NPC,"",0,"")
  77. AddPrimaryEntityCommand(Spawn,NPC,"attack",10000,"attack")
  78. SendUpdateDefaultCommand(NPC,10000,"attack")
  79. Attack(NPC,Spawn)
  80. end
  81. function Fail(NPC,Spawn)
  82. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  83. SendPopUpMessage(Spawn,"Allowing defection from Freeport will not be tolerated!",255,50,50)
  84. SendMessage(Spawn,"Allowing defection from Freeport will not be tolerated!","red")
  85. AddTimer(NPC,4500,"FailureExit",1,Spawn)
  86. end
  87. function FailureExit(NPC,Spawn)
  88. CloseConversation(NPC,Spawn)
  89. Race = GetRace(Spawn)
  90. -- Erudite / Kerra
  91. if Race == 3 or Race == 11 then
  92. ZoneRef = GetZone("Stonestair")
  93. Zone(ZoneRef,Spawn,3.24, -4.37, -98.46, 185.35)
  94. -- Ratonga / Gnome
  95. elseif Race == 5 or Race == 13 then
  96. ZoneRef = GetZone("TempleSt")
  97. Zone(ZoneRef,Spawn,21.81, 2.92, 21.37, 190.87)
  98. -- Human / Half Elf
  99. elseif Race == 9 or Race == 6 then
  100. ZoneRef = GetZone("BeggarsCourt")
  101. Zone(ZoneRef,Spawn,61.07, -7.08, 111.67, 339.27)
  102. -- Orge / Troll
  103. elseif Race == 12 or Race == 14 then
  104. ZoneRef = GetZone("BigBend")
  105. Zone(ZoneRef,Spawn,94.12, -2.00, 2.53, 98)
  106. -- Dark Elf
  107. elseif Race == 1 or Race == 19 or Race == 17 then
  108. ZoneRef = GetZone("longshadow")
  109. Zone(ZoneRef,Spawn,4.22, 3.00, 71.07, 353.87)
  110. -- Barbarian / Iksar / Sarnak
  111. elseif Race == 0 or Race == 10 or Race == 18 then
  112. ZoneRef = GetZone("ScaleYard")
  113. Zone(ZoneRef,Spawn,-6.78, -5.63, -12.96, 194.63)
  114. else
  115. ZoneRef = GetZone("BeggarsCourt")
  116. Zone(ZoneRef,Spawn,58.67, -7.08, 112.61, 352.60)
  117. end
  118. end
  119. function aggro(NPC,Spawn)
  120. SpawnSet(NPC,"attackable",1)
  121. SpawnSet(NPC,"show_level",1)
  122. SpawnSet(NPC,"command_primary",11)
  123. SpawnSet(NPC,"action_state",0)
  124. end
  125. function death(NPC,Spawn)
  126. local Traitor1 = GetSpawn(NPC,1640001)
  127. local Traitor2 = GetSpawn(NPC,1640002)
  128. local Traitor3 = GetSpawn(NPC,1640018)
  129. local Traitor3 = GetSpawn(NPC,1640021)
  130. if Traitor1 == nil or not IsAlive(Traitor1) then
  131. if Traitor2 == nil or not IsAlive(Traitor2) then
  132. if Traitor3 == nil or not IsAlive(Traitor3) then
  133. if Traitor3 == nil or not IsAlive(Traitor3) then
  134. if HasQuest(Spawn,BBCitizen) then
  135. SetStepComplete(Spawn,BBCitizen,4)
  136. elseif HasQuest(Spawn,BCCitizen) then
  137. SetStepComplete(Spawn,BCCitizen,4)
  138. elseif HasQuest(Spawn,LACitizen) then
  139. SetStepComplete(Spawn,LACitizen,4)
  140. elseif HasQuest(Spawn,SYCitizen) then
  141. SetStepComplete(Spawn,SYCitizen,4)
  142. elseif HasQuest(Spawn,SBCitizen) then
  143. SetStepComplete(Spawn,SBCitizen,4)
  144. elseif HasQuest(Spawn,TSCitizen) then
  145. SetStepComplete(Spawn,TSCitizen,4)
  146. end
  147. end
  148. end
  149. end
  150. end
  151. end
  152. function victory(NPC,Spawn)
  153. AddTimer(NPC,2500,"FailureExit",1,Spawn)
  154. end