CizraJYax.lua 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. --[[
  2. Script Name : SpawnScripts/LongshadowAlley/CizraJYax.lua
  3. Script Purpose : Cizra J`Yax
  4. Script Author : Dorbin
  5. Script Date : 2023.10.14
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. local TimeCheck = false -- used to delay between hail uses
  10. local CalloutTimeCheck = false -- used to delay between callout uses
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. waypoints(NPC)
  14. end
  15. function InRange(NPC, Spawn)
  16. if GetFactionAmount(Spawn,12) <0 then
  17. FaceTarget(NPC, Spawn)
  18. FactionChecking(NPC, Spawn, faction)
  19. else
  20. if MakeRandomInt(1, 100) <= 30 and CalloutTimeCheck == false then
  21. CalloutTimeCheck = true
  22. FaceTarget(NPC, Spawn)
  23. AddTimer(NPC,60000,"ResetCalloutTimer")
  24. Talk(NPC, Spawn)
  25. end
  26. end
  27. end
  28. function ResetTimer(NPC) -- resets hail timer after initial use
  29. TimeCheck = false
  30. end
  31. function ResetCalloutTimer(NPC) -- resets callout timer after use
  32. CalloutTimeCheck = false
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. if GetFactionAmount(Spawn,12) <0 then
  39. FaceTarget(NPC, Spawn)
  40. FactionChecking(NPC, Spawn, faction)
  41. else
  42. if TimeCheck == false then -- checks timer
  43. TimeCheck = true -- turns on timer to stop player spamming
  44. AddTimer(NPC,2500,"ResetTimer")
  45. FaceTarget(NPC, Spawn)
  46. Talk(NPC, Spawn)
  47. end
  48. end
  49. end
  50. function Talk(NPC, Spawn)
  51. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  52. if FP_MageFaction >=10000 then
  53. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  54. else
  55. local choice = MakeRandomInt(1, 2)
  56. if choice == 1 then
  57. BasicTalk(NPC,Spawn)
  58. elseif choice == 2 then
  59. BasicTalk(NPC,Spawn)
  60. elseif choice == 3 then
  61. FactionTalk(NPC,Spawn)
  62. end
  63. end
  64. end
  65. function BasicTalk(NPC,Spawn)
  66. local choice = MakeRandomInt(1, 5)
  67. if choice == 1 then
  68. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_hail_gf_ec2a8705.mp3", "Mindless brutes that feed on the weak make up the ranks of the Freeport Militia.", "", 3674227482, 1789009112, Spawn, 0)
  69. elseif choice == 2 then
  70. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_hail_gf_6ad11033.mp3", "When it comes to arcane knowledge, no one knows more about it than Arcane Scientists.", "", 458970350, 57476188, Spawn, 0)
  71. elseif choice == 3 then
  72. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_hail_gf_dfb5c3b3.mp3", "The Seafuries are just a bunch of ruffians that pirate ships and trade on the black market.", "", 1213807064, 3494632294, Spawn, 0)
  73. elseif choice == 4 then
  74. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_hail_gf_4dd0033.mp3", "How is it any different to overprice your goods than to steal a few coin from an unsuspecting customer? Such are the ways of the Coalition of Tradefolke. Be careful if you ever deal with them.", "", 2508521854, 2690377311, Spawn)
  75. elseif choice == 5 then
  76. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_hail_gf_1035b801.mp3", "The Dismal Rage is such a group of pure evil, that how can they be trusted to heal anyone?", "", 3091455674, 3623617426, Spawn)
  77. end
  78. end
  79. function FactionTalk(NPC,Spawn)
  80. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  81. if FP_MageFaction >=40000 then
  82. FaceTarget(NPC, Spawn)
  83. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_40_gf_c38c736.mp3", "To aid the Academy of Arcane Science is to unleash the force for power that burns within us all!", "cheer", 0, 0, Spawn)
  84. elseif FP_MageFaction >=30000 then
  85. FaceTarget(NPC, Spawn)
  86. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_30_gf_130c3c71.mp3", "You have helped the Academy of Arcane Science rise in power and brought some invaluable assets within these walls.", "thank", 0, 0, Spawn)
  87. elseif FP_MageFaction >=20000 then
  88. FaceTarget(NPC, Spawn)
  89. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_20_gf_7b836853.mp3", "Your actions have assisted the Academy of Arcane Science in its quest for all knowledge!", "", 0, 0, Spawn)
  90. elseif FP_MageFaction >=10000 then
  91. FaceTarget(NPC, Spawn)
  92. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_10_gf_5547196e.mp3", "Your actions have done well for the Academy of Arcane Science, but there is always more to know.", "nod", 0, 0, Spawn)
  93. end
  94. end
  95. function waypoints(NPC)
  96. MovementLoopAddLocation(NPC, -44.22, 1, -0.39, 2, 1)
  97. MovementLoopAddLocation(NPC, -44.22, 1, -0.39, 2, MakeRandomInt(25,30),"EcologyEmotes")
  98. MovementLoopAddLocation(NPC, -44.06, 1, -1.28, 2, 0)
  99. MovementLoopAddLocation(NPC, -44.34, 1, -2.35, 2, 2,"Door1")
  100. MovementLoopAddLocation(NPC, -48.56, 0.81, -5.15, 2, 0)
  101. MovementLoopAddLocation(NPC, -51.3, 1.01, -4.17, 2, 0)
  102. MovementLoopAddLocation(NPC, -53.55, 1.99, 0.64, 2, 0)
  103. MovementLoopAddLocation(NPC, -54.26, 2.44, 5.22, 2, 0)
  104. MovementLoopAddLocation(NPC, -53.21, 3.05, 8.72, 2, 0)
  105. MovementLoopAddLocation(NPC, -52.57, 3.63, 11.07, 2, 0)
  106. MovementLoopAddLocation(NPC, -50.26, 4.14, 14.28, 2, 0)
  107. MovementLoopAddLocation(NPC, -41.84, 4.1, 18.42, 2, 0)
  108. MovementLoopAddLocation(NPC, -36.47, 4.53, 21.84, 2, 0)
  109. MovementLoopAddLocation(NPC, -29.25, 4.31, 24.32, 2, 0)
  110. MovementLoopAddLocation(NPC, -21.23, 4.3, 27.15, 2, 0)
  111. MovementLoopAddLocation(NPC, -21.17, 3.96, 30.7, 2, 0)
  112. MovementLoopAddLocation(NPC, -21.15, 4, 32.04, 2, 2,"Door2")
  113. MovementLoopAddLocation(NPC, -23.99, 4, 37.74, 2, 0)
  114. MovementLoopAddLocation(NPC, -24.17, 4, 40.44, 2, 0)
  115. MovementLoopAddLocation(NPC, -19.46, 4, 43.29, 2, 0)
  116. MovementLoopAddLocation(NPC, -12.22, 4, 46.06, 2, 1)
  117. MovementLoopAddLocation(NPC, -12.22, 4, 46.06, 2, 25,"EcologyEmotes")
  118. MovementLoopAddLocation(NPC, -20.54, 4, 41.69, 2, 0)
  119. MovementLoopAddLocation(NPC, -22.81, 4, 38.43, 2, 2,"Door2")
  120. MovementLoopAddLocation(NPC, -22.78, 4.01, 35.68, 2, 0)
  121. MovementLoopAddLocation(NPC, -20.31, 3.91, 30.83, 2, 0)
  122. MovementLoopAddLocation(NPC, -11.83, 3.32, 30.95, 2, 0)
  123. MovementLoopAddLocation(NPC, -6.17, 3, 31, 2, 0)
  124. MovementLoopAddLocation(NPC, 6.66, 2.87, 27.56, 2, 0)
  125. MovementLoopAddLocation(NPC, 14.67, 1.9, 24.62, 2, 0)
  126. MovementLoopAddLocation(NPC, 18.13, 1.79, 22.67, 2, 0)
  127. MovementLoopAddLocation(NPC, 22.44, 1.35, 17.12, 2, 0)
  128. MovementLoopAddLocation(NPC, 29.85, 0.31, 8.87, 2, 0)
  129. MovementLoopAddLocation(NPC, 34.97, -0.75, 1.44, 2, 0)
  130. MovementLoopAddLocation(NPC, 36.39, -1.3, -4.04, 2, 0)
  131. MovementLoopAddLocation(NPC, 36.48, -1.51, -9.05, 2, 0)
  132. MovementLoopAddLocation(NPC, 42.14, -1.27, -14.85, 2, 1)
  133. MovementLoopAddLocation(NPC, 42.14, -1.27, -14.85, 2, MakeRandomInt(25,30),"EcologyEmotes")
  134. MovementLoopAddLocation(NPC, 37.2, -1.3, -18.3, 2, 0)
  135. MovementLoopAddLocation(NPC, 33.89, -1.29, -20.77, 2, 0)
  136. MovementLoopAddLocation(NPC, 26.43, -1.19, -20.8, 2, 0)
  137. MovementLoopAddLocation(NPC, 20.59, -0.2, -19.19, 2, 0)
  138. MovementLoopAddLocation(NPC, 13.55, 0, -15.88, 2, 0)
  139. MovementLoopAddLocation(NPC, 9.36, 0, -13.9, 2, 0)
  140. MovementLoopAddLocation(NPC, 9.39, 0, -11.18, 2, 0)
  141. MovementLoopAddLocation(NPC, 12.47, 0, -4.04, 2, 0)
  142. MovementLoopAddLocation(NPC, 12.78, 0, -0.4, 2, 0)
  143. MovementLoopAddLocation(NPC, 10.65, 0, 5.22, 2, 0)
  144. MovementLoopAddLocation(NPC, 8.38, 0, 7.67, 2, 0)
  145. MovementLoopAddLocation(NPC, 2.51, 0, 11.59, 2, 0)
  146. MovementLoopAddLocation(NPC, -1.75, 0, 12.13, 2, 0)
  147. MovementLoopAddLocation(NPC, -6.91, 0, 10.87, 2, 0)
  148. MovementLoopAddLocation(NPC, -18.25, 0, 11.78, 2, 1)
  149. MovementLoopAddLocation(NPC, -18.25, 0, 11.78, 2, MakeRandomInt(25,30),"EcologyEmotes")
  150. MovementLoopAddLocation(NPC, -18.25, 0, 11.78, 2, 0)
  151. MovementLoopAddLocation(NPC, -18.66, 0, 12.09, 2, 0)
  152. MovementLoopAddLocation(NPC, -18.05, 0, 12.41, 2, 0)
  153. MovementLoopAddLocation(NPC, -14.38, 0, 20.48, 2, 1)
  154. MovementLoopAddLocation(NPC, -14.38, 0, 20.48, 2, MakeRandomInt(25,30),"EcologyEmotes")
  155. MovementLoopAddLocation(NPC, -14.57, 0, 16.19, 2, 0)
  156. MovementLoopAddLocation(NPC, -15.15, 0, 9.49, 2, 0)
  157. MovementLoopAddLocation(NPC, -14.01, 0, -5.36, 2, 0)
  158. MovementLoopAddLocation(NPC, -13.29, 0, -8.95, 2, 0)
  159. MovementLoopAddLocation(NPC, -15.16, 0, -11.33, 2, 0)
  160. MovementLoopAddLocation(NPC, -22.21, 0.13, -15.23, 2, 0)
  161. MovementLoopAddLocation(NPC, -30, -0.05, -22.45, 2, 0)
  162. MovementLoopAddLocation(NPC, -33.47, -1.01, -26.42, 2, 0)
  163. MovementLoopAddLocation(NPC, -33.26, -1.66, -32.42, 2, 0)
  164. MovementLoopAddLocation(NPC, -33.34, -2.09, -34.52, 2, 0)
  165. MovementLoopAddLocation(NPC, -36.22, -1.91, -33.38, 2, 0)
  166. MovementLoopAddLocation(NPC, -39.4, -1.16, -31.41, 2, 0)
  167. MovementLoopAddLocation(NPC, -41.34, -0.64, -29.56, 2, 0)
  168. MovementLoopAddLocation(NPC, -43.39, -0.35, -27.33, 2, 0)
  169. MovementLoopAddLocation(NPC, -46.53, -0.93, -20.2, 2, 0)
  170. MovementLoopAddLocation(NPC, -48.51, 0.3, -10.26, 2, 0)
  171. MovementLoopAddLocation(NPC, -48.79, 0.73, -6.22, 2, 2,"Door1")
  172. MovementLoopAddLocation(NPC, -43.66, 1, -2.43, 2, 0)
  173. end
  174. function Door1(NPC,Spawn)
  175. local door = GetSpawn(NPC, 1380084)
  176. UseWidget(door)
  177. end
  178. function Door2(NPC,Spawn)
  179. local door = GetSpawn(NPC, 1380077)
  180. UseWidget(door)
  181. end