9
3

aFreeportpartisan.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. --[[
  2. Script Name : SpawnScripts/QeynosCitizenshipTrialChamber/aFreeportpartisan.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.31 05:08:02
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/CombatModule"
  10. local BQCitizen = 5718
  11. local CVQCitizen = 5719
  12. local GQCitizen = 5720
  13. local NQCitizen = 5721
  14. local SCQCitizen = 5722
  15. local WWQCitizen = 5723
  16. function spawn(NPC, Spawn)
  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, "","Hello, friend. You look like a sensible Qeynosian!", "", 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. PlayAnimation(NPC,"539")
  34. Dialog.New(NPC, Spawn)
  35. Dialog.AddDialog("Qeynos has all our exits blocked, but perhaps you can find a way to get me through!")
  36. Dialog.AddVoiceover("voiceover/english/a_freeport_partisan/qey_catacomb_epic01/bribingtraitor000.mp3", 3482178504, 3473502837)
  37. Dialog.AddOption("How would I do that?", "Dialog2")
  38. Dialog.AddOption("You must be punished for your crimes!", "AttackTimer")
  39. Dialog.Start()
  40. end
  41. function Dialog2(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("I made arrangements to transfer my wealth to the Freeport Reserve, but mayhaps I can spare some coins if you let me go.")
  45. Dialog.AddVoiceover("voiceover/english/a_freeport_partisan/qey_catacomb_epic01/bribingtraitor001.mp3", 4211876752, 3637644957)
  46. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  47. Dialog.AddOption("Perhaps. I need to think upon this further.")
  48. Dialog.AddOption("I'm not sure I can trust you. You're here as a traitor.", "Dialog3")
  49. Dialog.AddOption("Coin cannot cover what you've done!", "AttackTimer")
  50. Dialog.AddOption("No, there can be no bribery.", "AttackTimer")
  51. Dialog.Start()
  52. end
  53. function Dialog3(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. Dialog.New(NPC, Spawn)
  56. Dialog.AddDialog("I'm not asking you to trust my word ... trust my gold!")
  57. Dialog.AddVoiceover("voiceover/english/a_freeport_partisan/qey_catacomb_epic01/bribingtraitor002.mp3", 298356076, 2184308899)
  58. PlayFlavor(NPC,"","","whome",0,0,Spawn)
  59. Dialog.AddOption("A bribe, eh? I'm interested.","Fail")
  60. Dialog.AddOption("Tempting, but I have a duty to Qeynos. You must face judgement for your deeds.", "AttackTimer")
  61. Dialog.AddOption("No way!", "AttackTimer")
  62. Dialog.Start()
  63. end
  64. function AttackTimer(NPC,Spawn)
  65. AddTimer(NPC,1200,"Attacking",1,Spawn)
  66. end
  67. function Attacking(NPC,Spawn)
  68. SpawnSet(NPC,"attackable",1)
  69. SpawnSet(NPC,"show_level",1)
  70. AddPrimaryEntityCommand(Spawn,NPC,"",0,"")
  71. AddPrimaryEntityCommand(Spawn,NPC,"attack",10000,"attack")
  72. SendUpdateDefaultCommand(NPC,10000,"attack")
  73. Attack(NPC,Spawn)
  74. end
  75. function Fail(NPC,Spawn)
  76. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  77. SendPopUpMessage(Spawn,"One who represents the city of Qeynos does not accept bribes.",255,50,50)
  78. SendMessage(Spawn,"One who represents the city of Qeynos does not accept bribes.","red")
  79. AddTimer(NPC,4500,"FailureExit",1,Spawn)
  80. end
  81. function FailureExit(NPC,Spawn)
  82. if GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  83. BBShire = GetZone("Baubbleshire")
  84. Zone(BBShire,Spawn,819.46, -20.60, -525.61, 200.47)
  85. elseif GetRace(Spawn)== 0 or GetRace(Spawn)== 2 then
  86. Gray = GetZone("graystone")
  87. Zone(Gray,Spawn,865.03, -25.45, -97.91, 357.68)
  88. elseif GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  89. CV = GetZone("castleview")
  90. Zone(CV,Spawn,729.01, -21.10, -124.36, 290.81)
  91. elseif GetRace(Spawn)== 9 or GetRace(Spawn)== 11 then
  92. Net = GetZone("nettleville")
  93. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  94. elseif GetRace(Spawn)== 3 or GetRace(Spawn)== 8 then
  95. SC = GetZone("starcrest")
  96. Zone(SC,Spawn,704.07, -20.38, 264.40, 269.84)
  97. elseif GetRace(Spawn)== 15 or GetRace(Spawn)== 16 or GetRace(Spawn)== 6 then
  98. WW = GetZone("willowwood")
  99. Zone(WW,Spawn,809.96, -21.30, -566.02, 323.13)
  100. else
  101. Net = GetZone("nettleville")
  102. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  103. end
  104. end
  105. function aggro(NPC,Spawn)
  106. SpawnSet(NPC,"attackable",1)
  107. SpawnSet(NPC,"show_level",1)
  108. SpawnSet(NPC,"command_primary",11)
  109. SpawnSet(NPC,"action_state",0)
  110. end
  111. function death(NPC,Spawn)
  112. local Mole = GetSpawn(NPC,8250011)
  113. local Refu = GetSpawn(NPC,8250012)
  114. local Part = GetSpawn(NPC,8250013)
  115. local Tavi = GetSpawn(NPC,8250014)
  116. if Mole == nil or not IsAlive(Mole) then
  117. if Refu == nil or not IsAlive(Refu) then
  118. if Part == nil or not IsAlive(Part) then
  119. if Tavi == nil or not IsAlive(Tavi) then
  120. if HasQuest(Spawn,BQCitizen) then
  121. SetStepComplete(Spawn,BQCitizen,4)
  122. elseif HasQuest(Spawn,CVQCitizen) then
  123. SetStepComplete(Spawn,CVQCitizen,4)
  124. elseif HasQuest(Spawn,GQCitizen) then
  125. SetStepComplete(Spawn,GQCitizen,4)
  126. elseif HasQuest(Spawn,NQCitizen) then
  127. SetStepComplete(Spawn,NQCitizen,4)
  128. elseif HasQuest(Spawn,SCQCitizen) then
  129. SetStepComplete(Spawn,SCQCitizen,4)
  130. elseif HasQuest(Spawn,WWQCitizen) then
  131. SetStepComplete(Spawn,WWQCitizen,4)
  132. end
  133. end
  134. end
  135. end
  136. end
  137. end
  138. function victory(NPC,Spawn)
  139. AddTimer(NPC,2500,"FailureExit",1,Spawn)
  140. end