AQeynosianinfiltrator.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. --[[
  2. Script Name : SpawnScripts/FreeportCitizenshipTrialChamber/AQeynosianinfiltrator.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.25 04:06:45
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. local BBCitizen = 5866 --Big Bend
  10. local BCCitizen = 5867 --Beggar's Court
  11. local LACitizen = 5868 --Longshadow Alley
  12. local SYCitizen = 5869 -- Scale Yard
  13. local SBCitizen = 5870 --Stonestair Byway
  14. local TSCitizen = 5871 --Temple St
  15. function spawn(NPC)
  16. combatModule(NPC, Spawn)
  17. local Level = GetLevel(NPC)
  18. local level1 = 5
  19. local level2 = 6
  20. local difficulty1 = 6
  21. local hp1 = 130
  22. local power1 = 65
  23. local difficulty2 = 6
  24. local hp2 = 150
  25. local power2 = 80
  26. if Level == level1 then
  27. SpawnSet(NPC, "difficulty", difficulty1)
  28. SpawnSet(NPC, "hp", hp1)
  29. SpawnSet(NPC, "power", power1)
  30. elseif Level == level2
  31. then
  32. SpawnSet(NPC, "difficulty", difficulty2)
  33. SpawnSet(NPC, "hp", hp2)
  34. SpawnSet(NPC, "power", power2)
  35. end
  36. waypoints(NPC)
  37. end
  38. function aggro(NPC,Spawn)
  39. choice = MakeRandomInt(1,2)
  40. if choice ==1 then
  41. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_death_gf_610c650e.mp3", "You must flee! I'll try to hold them.", "", 1612338229, 10301262, Spawn, 0)
  42. else
  43. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gf_a68f64b6.mp3", "Alarm! Alarm!", "", 1220383018, 2962002142, Spawn)
  44. end
  45. end
  46. function waypoints(NPC)
  47. MovementLoopAddLocation(NPC, -2.76, 0.40, -21.07, 2, 7)
  48. MovementLoopAddLocation(NPC, -2.76, 0.40, -21.07, 2, 1)
  49. MovementLoopAddLocation(NPC, -1.49, 0.40, -20.09, 2, 0)
  50. MovementLoopAddLocation(NPC, 0.57, 0.37, -18.22, 2, 8)
  51. MovementLoopAddLocation(NPC, 0.09, 0.10, -14.04, 2, 5)
  52. MovementLoopAddLocation(NPC, 0.09, 0.10, -14.04, 2, 1)
  53. MovementLoopAddLocation(NPC, 1.45, 0.43, -17.51, 2, 3)
  54. MovementLoopAddLocation(NPC, -2.34, 0.25, -18.81, 2, 5)
  55. MovementLoopAddLocation(NPC, -2.34, 0.25, -18.81, 2, 1)
  56. end
  57. function respawn(NPC)
  58. spawn(NPC)
  59. end
  60. function victory(NPC,Spawn)
  61. AddTimer(NPC,2500,"FailureExit",1,Spawn)
  62. end
  63. function death(NPC,Spawn)
  64. local Traitor1 = GetSpawn(NPC,1640001)
  65. local Traitor2 = GetSpawn(NPC,1640002)
  66. local Traitor3 = GetSpawn(NPC,1640018)
  67. local Traitor3 = GetSpawn(NPC,1640021)
  68. if Traitor1 == nil or not IsAlive(Traitor1) then
  69. if Traitor2 == nil or not IsAlive(Traitor2) then
  70. if Traitor3 == nil or not IsAlive(Traitor3) then
  71. if Traitor3 == nil or not IsAlive(Traitor3) then
  72. if HasQuest(Spawn,BBCitizen) then
  73. SetStepComplete(Spawn,BBCitizen,4)
  74. elseif HasQuest(Spawn,BCCitizen) then
  75. SetStepComplete(Spawn,BCCitizen,4)
  76. elseif HasQuest(Spawn,LACitizen) then
  77. SetStepComplete(Spawn,LACitizen,4)
  78. elseif HasQuest(Spawn,SYCitizen) then
  79. SetStepComplete(Spawn,SYCitizen,4)
  80. elseif HasQuest(Spawn,SBCitizen) then
  81. SetStepComplete(Spawn,SBCitizen,4)
  82. elseif HasQuest(Spawn,TSCitizen) then
  83. SetStepComplete(Spawn,TSCitizen,4)
  84. end
  85. end
  86. end
  87. end
  88. end
  89. end
  90. function FailureExit(NPC,Spawn)
  91. CloseConversation(NPC,Spawn)
  92. Race = GetRace(Spawn)
  93. -- Erudite / Kerra
  94. if Race == 3 or Race == 11 then
  95. ZoneRef = GetZone("Stonestair")
  96. Zone(ZoneRef,Spawn,3.24, -4.37, -98.46, 185.35)
  97. -- Ratonga / Gnome
  98. elseif Race == 5 or Race == 13 then
  99. ZoneRef = GetZone("TempleSt")
  100. Zone(ZoneRef,Spawn,21.81, 2.92, 21.37, 190.87)
  101. -- Human / Half Elf
  102. elseif Race == 9 or Race == 6 then
  103. ZoneRef = GetZone("BeggarsCourt")
  104. Zone(ZoneRef,Spawn,61.07, -7.08, 111.67, 339.27)
  105. -- Orge / Troll
  106. elseif Race == 12 or Race == 14 then
  107. ZoneRef = GetZone("BigBend")
  108. Zone(ZoneRef,Spawn,94.12, -2.00, 2.53, 98)
  109. -- Dark Elf
  110. elseif Race == 1 or Race == 19 or Race == 17 then
  111. ZoneRef = GetZone("longshadow")
  112. Zone(ZoneRef,Spawn,4.22, 3.00, 71.07, 353.87)
  113. -- Barbarian / Iksar / Sarnak
  114. elseif Race == 0 or Race == 10 or Race == 18 then
  115. ZoneRef = GetZone("ScaleYard")
  116. Zone(ZoneRef,Spawn,-6.78, -5.63, -12.96, 194.63)
  117. else
  118. ZoneRef = GetZone("BeggarsCourt")
  119. Zone(ZoneRef,Spawn,58.67, -7.08, 112.61, 352.60)
  120. end
  121. end