VorsharLFaz.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. --[[
  2. Script Name : SpawnScripts/Longshadow/VorsharLFaz.lua
  3. Script Purpose : Vorshar L`Faz
  4. Script Author : Dorbin
  5. Script Date : 2022.10.13
  6. --]]
  7. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  8. local TimeCheck = false -- used to delay between hail uses
  9. local CalloutTimeCheck = false -- used to delay between callout uses
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. waypoints(NPC)
  13. end
  14. function InRange(NPC, Spawn)
  15. if GetFactionAmount(Spawn,12) <0 then
  16. FaceTarget(NPC, Spawn)
  17. FactionChecking(NPC, Spawn, faction)
  18. else
  19. if MakeRandomInt(1, 100) <= 30 and CalloutTimeCheck == false then
  20. CalloutTimeCheck = true
  21. FaceTarget(NPC, Spawn)
  22. AddTimer(NPC,60000,"ResetCalloutTimer")
  23. Talk(NPC, Spawn)
  24. end
  25. end
  26. end
  27. function ResetTimer(NPC) -- resets hail timer after initial use
  28. TimeCheck = false
  29. end
  30. function ResetCalloutTimer(NPC) -- resets callout timer after use
  31. CalloutTimeCheck = false
  32. end
  33. function respawn(NPC)
  34. spawn(NPC)
  35. end
  36. function hailed(NPC, Spawn)
  37. if GetFactionAmount(Spawn,12) <0 then
  38. FaceTarget(NPC, Spawn)
  39. FactionChecking(NPC, Spawn, faction)
  40. else
  41. if TimeCheck == false then -- checks timer
  42. TimeCheck = true -- turns on timer to stop player spamming
  43. AddTimer(NPC,2500,"ResetTimer")
  44. FaceTarget(NPC, Spawn)
  45. Talk(NPC, Spawn)
  46. end
  47. end
  48. end
  49. function Talk(NPC, Spawn)
  50. local FP_CrafterFaction = GetFactionAmount(Spawn, 101)
  51. if FP_CrafterFaction >=10000 then
  52. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  53. else
  54. local choice = MakeRandomInt(1, 2)
  55. if choice == 1 then
  56. BasicTalk(NPC,Spawn)
  57. elseif choice == 2 then
  58. BasicTalk(NPC,Spawn)
  59. elseif choice == 3 then
  60. FactionTalk(NPC,Spawn)
  61. end
  62. end
  63. end
  64. function BasicTalk(NPC,Spawn)
  65. local choice = MakeRandomInt(1, 5)
  66. if choice == 1 then
  67. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_hail_gm_a8fbb723.mp3", "The arcane scientists hone their minds through the study of arcane arts, but they will never become as cunning as a skilled trader.", "", 4254147398, 134359674, Spawn)
  68. elseif choice == 2 then
  69. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_hail_gm_cd3a748b.mp3", "The withering hands of the Dismal Rage priests look more like hands of death than hands that can heal people.", "", 2122145851, 2411357575, Spawn)
  70. elseif choice == 3 then
  71. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_hail_gm_263a8bb0.mp3", "Although they serve to protect the city, the individuals of the Freeport Militia are only loyal to their own self interest and nothing more.", "", 3104017481, 741752503, Spawn)
  72. elseif choice == 4 then
  73. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_hail_gm_8702506b.mp3", "Those Seafury Buccaneers wouldn't know what a fair deal was if it hit them on the head.", "", 3039159838, 1799277697, Spawn)
  74. elseif choice == 5 then
  75. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_hail_gm_73c8a151.mp3", "There's nothing that the Coalition of Tradesfolke can't make a profit out of.", "", 1077955965, 3866305338, Spawn)
  76. end
  77. end
  78. function FactionTalk(NPC,Spawn)
  79. local FP_CrafterFaction = GetFactionAmount(Spawn, 101)
  80. if FP_CrafterFaction >=40000 then
  81. FaceTarget(NPC, Spawn)
  82. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_40_gm_3397b8bb.mp3", "The Coalition is fortunate to have your dedication! The sway you wield with them is worthy of awe!", "cheer", 0, 0, Spawn)
  83. elseif FP_CrafterFaction >=30000 then
  84. FaceTarget(NPC, Spawn)
  85. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_30_gm_deefc882.mp3", "You have achieved quite a reputation for your work with the Coalition.", "", 0, 0, Spawn)
  86. elseif FP_CrafterFaction >=20000 then
  87. FaceTarget(NPC, Spawn)
  88. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_20_gm_376317f5.mp3", "Although you still have quite a distance to go, the reputation you have managed to achieve is nevertheless impressive.", "", 2535649617, 1724444157, Spawn)
  89. elseif FP_CrafterFaction >=10000 then
  90. FaceTarget(NPC, Spawn)
  91. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_coalitionoftradesfolke/ft/eco/evil/darkelf_male_eco_evil_coalitionoftradesfolke_10_gm_bda4135a.mp3", "Are you willing to sacrifice yourself for the glory of Freeport, and the profit of the Coalition? Are you willing to endure days locked within a leaky cellar, your fingers bleeding as you work the loom and the forge?", "", 0, 0, Spawn)
  92. end
  93. end
  94. function Drink(NPC)
  95. PlayFlavor(NPC,"","","drinking_idle",0,0)
  96. AddTimer(NPC,8000, "Drink2")
  97. end
  98. function Drink2(NPC)
  99. choice = math.random(1,4)
  100. if choice == 1 then
  101. PlayFlavor(NPC,"","","snicker",0,0)
  102. elseif choice == 2 then
  103. PlayFlavor(NPC,"","","drinking_idle",0,0)
  104. elseif choice == 3 then
  105. PlayFlavor(NPC,"","","sniff",0,0)
  106. else
  107. PlayFlavor(NPC,"","","grumble",0,0)
  108. end
  109. AddTimer(NPC,6000, "Drink3")
  110. end
  111. function Drink3(NPC)
  112. PlayFlavor(NPC,"","","drinking_idle",0,0)
  113. end
  114. function Door1(NPC,Spawn)
  115. local door = GetSpawn(NPC, 1380077)
  116. UseWidget(door)
  117. end
  118. function Door2(NPC,Spawn)
  119. local door = GetSpawn(NPC, 1380084)
  120. UseWidget(door)
  121. end
  122. function waypoints(NPC)
  123. MovementLoopAddLocation(NPC, -10.65, 0, -9.32, 2, 0)
  124. MovementLoopAddLocation(NPC, -7.19, 0.09, -12.52, 2, 0)
  125. MovementLoopAddLocation(NPC, -1.44, 0, -16.95, 2, 0)
  126. MovementLoopAddLocation(NPC, -0.84, 0, -18.25, 2, 0)
  127. MovementLoopAddLocation(NPC, -1.73, 0, -19.28, 2, 0)
  128. MovementLoopAddLocation(NPC, -1.73, 0, -19.28, 2, 1)
  129. MovementLoopAddLocation(NPC, -1.73, 0, -19.28, 2, 18,"Drink")
  130. MovementLoopAddLocation(NPC, -1.73, 0, -19.28, 2, 18,"Drink")
  131. MovementLoopAddLocation(NPC, -1.73, 0, -19.28, 2, 0)
  132. MovementLoopAddLocation(NPC, 2.18, 0, -17.5, 2, 0)
  133. MovementLoopAddLocation(NPC, 5.2, 0.03, -16.12, 2, 0)
  134. MovementLoopAddLocation(NPC, 13.75, 0, -19.66, 2, 0)
  135. MovementLoopAddLocation(NPC, 28, -1.32, -24.03, 2, 0)
  136. MovementLoopAddLocation(NPC, 35.28, -1.46, -22.63, 2, 0)
  137. MovementLoopAddLocation(NPC, 37.88, -1.43, -21.25, 2, 0)
  138. MovementLoopAddLocation(NPC, 40.77, -1.32, -16.38, 2, 0)
  139. MovementLoopAddLocation(NPC, 41.3, -1.34, -3.85, 2, 0)
  140. MovementLoopAddLocation(NPC, 37.27, -0.32, 6.42, 2, 0)
  141. MovementLoopAddLocation(NPC, 31.13, 0.32, 12.03, 2, 0)
  142. MovementLoopAddLocation(NPC, 23.18, 1.41, 20.19, 2, 0)
  143. MovementLoopAddLocation(NPC, 18.47, 1.9, 24.94, 2, 0)
  144. MovementLoopAddLocation(NPC, 11.31, 2.41, 29.18, 2, 0)
  145. MovementLoopAddLocation(NPC, 4.64, 2.9, 31.72, 2, 0)
  146. MovementLoopAddLocation(NPC, 4.93, 3, 34.11, 2, 0)
  147. MovementLoopAddLocation(NPC, 9.25, 3, 43.84, 2, 0)
  148. MovementLoopAddLocation(NPC, 11.17, 3, 49.16, 2, 0)
  149. MovementLoopAddLocation(NPC, 11.38, 3, 53.33, 2, 1)
  150. MovementLoopAddLocation(NPC, 11.38, 3, 53.33, 2, MakeRandomInt(25,30),"EcologyEmotes")
  151. MovementLoopAddLocation(NPC, 11.38, 3, 53.33, 2, 0)
  152. MovementLoopAddLocation(NPC, 7.16, 3, 47.68, 2, 0)
  153. MovementLoopAddLocation(NPC, 4.02, 3, 39.33, 2, 0)
  154. MovementLoopAddLocation(NPC, 1.67, 2.98, 33.35, 2, 0)
  155. MovementLoopAddLocation(NPC, 1.18, 2.93, 32.35, 2, 0)
  156. MovementLoopAddLocation(NPC, -9.52, 3, 33.59, 2, 0)
  157. MovementLoopAddLocation(NPC, -15.36, 3.43, 31.98, 2, 0)
  158. MovementLoopAddLocation(NPC, -18.91, 3.88, 31.15, 2, 0)
  159. MovementLoopAddLocation(NPC, -20.14, 3.99, 31.98, 2, 0)
  160. MovementLoopAddLocation(NPC, -20.14, 3.99, 31.98, 2, 2,"Door1")
  161. MovementLoopAddLocation(NPC, -24.03, 4, 36.84, 2, 0)
  162. MovementLoopAddLocation(NPC, -29.12, 4, 35.32, 2, 0)
  163. MovementLoopAddLocation(NPC, -35.21, 4, 32.81, 2, 1)
  164. MovementLoopAddLocation(NPC, -35.21, 4, 32.81, 2, MakeRandomInt(25,30),"EcologyEmotes")
  165. MovementLoopAddLocation(NPC, -35.21, 4, 32.81, 2, 1)
  166. MovementLoopAddLocation(NPC, -34.91, 4, 33.43, 2, 0)
  167. MovementLoopAddLocation(NPC, -31.54, 4, 34.83, 2, 0)
  168. MovementLoopAddLocation(NPC, -24.33, 4, 37.72, 2, 2,"Door1")
  169. MovementLoopAddLocation(NPC, -24.33, 4, 37.72, 2, 0)
  170. MovementLoopAddLocation(NPC, -20.52, 3.95, 31.12, 2, 0)
  171. MovementLoopAddLocation(NPC, -27.94, 4.25, 27.43, 2, 0)
  172. MovementLoopAddLocation(NPC, -35.69, 4.51, 23.89, 2, 0)
  173. MovementLoopAddLocation(NPC, -45.88, 4.1, 18.89, 2, 0)
  174. MovementLoopAddLocation(NPC, -53.58, 3.75, 14.19, 2, 0)
  175. MovementLoopAddLocation(NPC, -56.52, 2.58, 5.12, 2, 0)
  176. MovementLoopAddLocation(NPC, -55.84, 2.12, 1.23, 2, 0)
  177. MovementLoopAddLocation(NPC, -51.88, 0.68, -6.22, 2, 0)
  178. MovementLoopAddLocation(NPC, -47.93, 0.85, -4.43, 2, 2,"Door2")
  179. MovementLoopAddLocation(NPC, -43.72, 1, -3.25, 2, 0)
  180. MovementLoopAddLocation(NPC, -37.99, 1.5, -1.96, 2, 1)
  181. MovementLoopAddLocation(NPC, -37.99, 1.5, -1.96, 2, MakeRandomInt(25,30),"EcologyEmotes")
  182. MovementLoopAddLocation(NPC, -40.66, 1.5, -1.56, 2, 0)
  183. MovementLoopAddLocation(NPC, -44.48, 1, -2.92, 2, 2,"Door2")
  184. MovementLoopAddLocation(NPC, -48.64, 0.8, -5.06, 2, 0)
  185. MovementLoopAddLocation(NPC, -50.45, -0.08, -13.56, 2, 0)
  186. MovementLoopAddLocation(NPC, -46.5, -0.49, -14.88, 2, 0)
  187. MovementLoopAddLocation(NPC, -44.36, -0.03, -14.72, 2, 0)
  188. MovementLoopAddLocation(NPC, -42.12, 0, -13.19, 2, 0)
  189. MovementLoopAddLocation(NPC, -32.42, 0, -11.3, 2, 0)
  190. MovementLoopAddLocation(NPC, -27.14, 0, -9.15, 2, 0)
  191. MovementLoopAddLocation(NPC, -21.25, 0, -6.74, 2, 0)
  192. MovementLoopAddLocation(NPC, -17.43, 0, -4.78, 2, 0)
  193. MovementLoopAddLocation(NPC, -13.94, 0, -5.86, 2, 0)
  194. end