a_rat_a.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/a_rat_a.lua
  3. Script Purpose : Waypoint Path for arat_a.lua
  4. Script Author : Cynnar
  5. Script Date : 7/8/2018 08:07:43 AM
  6. Script Notes : <special-instructions>
  7. --]]
  8. function spawn(NPC)
  9. waypoints(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. FaceTarget(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function waypoints(NPC)
  18. MovementLoopAddLocation(NPC, 24.95, 5.25, -13.04, 2, 0)
  19. MovementLoopAddLocation(NPC, 29.51, 4.49, -4.96, 2, 5, 0)
  20. local route = math.random(1,4)
  21. if route == 1 then
  22. RouteOne(NPC)
  23. elseif route == 2 then
  24. RouteTwo(NPC)
  25. elseif route == 3 then
  26. RouteThree(NPC)
  27. elseif route == 4 then
  28. RouteFour(NPC)
  29. end
  30. MovementLoopAddLocation(NPC, 34.27, 3.5, 3.44, 2, 0)
  31. MovementLoopAddLocation(NPC, 37.97, 2.18, 9.85, 2, 5, 0)
  32. local route = math.random(1,4)
  33. if route == 1 then
  34. RouteOne(NPC)
  35. elseif route == 2 then
  36. RouteTwo(NPC)
  37. elseif route == 3 then
  38. RouteThree(NPC)
  39. elseif route == 4 then
  40. RouteFour(NPC)
  41. end
  42. MovementLoopAddLocation(NPC, 37.97, 2.18, 9.85, 2, 0)
  43. MovementLoopAddLocation(NPC, 48.17, 3, 1.59, 2, 5, 0)
  44. local route = math.random(1,4)
  45. if route == 1 then
  46. RouteOne(NPC)
  47. elseif route == 2 then
  48. RouteTwo(NPC)
  49. elseif route == 3 then
  50. RouteThree(NPC)
  51. elseif route == 4 then
  52. RouteFour(NPC)
  53. end
  54. MovementLoopAddLocation(NPC, 51.3, 4.75, -11.23, 2, 5, 0)
  55. local route = math.random(1,4)
  56. if route == 1 then
  57. RouteOne(NPC)
  58. elseif route == 2 then
  59. RouteTwo(NPC)
  60. elseif route == 3 then
  61. RouteThree(NPC)
  62. elseif route == 4 then
  63. RouteFour(NPC)
  64. end
  65. MovementLoopAddLocation(NPC, 45.74, 5.25, -15.61, 2, 0)
  66. MovementLoopAddLocation(NPC, 41.37, 5.25, -16.54, 2, 0)
  67. MovementLoopAddLocation(NPC, 37.65, 5.25, -15.89, 2, 0)
  68. MovementLoopAddLocation(NPC, 34.17, 5.25, -12.55, 2, 0)
  69. MovementLoopAddLocation(NPC, 28.42, 5.25, -9.08, 2, 0)
  70. MovementLoopAddLocation(NPC, 17.41, 3.5, -6.64, 2, 5, 0)
  71. local route = math.random(1,4)
  72. if route == 1 then
  73. RouteOne(NPC)
  74. elseif route == 2 then
  75. RouteTwo(NPC)
  76. elseif route == 3 then
  77. RouteThree(NPC)
  78. elseif route == 4 then
  79. RouteFour(NPC)
  80. end
  81. MovementLoopAddLocation(NPC, 12.45, 3.88, -14.56, 2, 5, 0)
  82. local route = math.random(1,4)
  83. if route == 1 then
  84. RouteOne(NPC)
  85. elseif route == 2 then
  86. RouteTwo(NPC)
  87. elseif route == 3 then
  88. RouteThree(NPC)
  89. elseif route == 4 then
  90. RouteFour(NPC)
  91. end
  92. MovementLoopAddLocation(NPC, 16.36, 4.75, -23.02, 2, 5, 0)
  93. local route = math.random(1,4)
  94. if route == 1 then
  95. RouteOne(NPC)
  96. elseif route == 2 then
  97. RouteTwo(NPC)
  98. elseif route == 3 then
  99. RouteThree(NPC)
  100. elseif route == 4 then
  101. RouteFour(NPC)
  102. end
  103. MovementLoopAddLocation(NPC, 3.95, 4.25, -23.47, 2, 5, 0)
  104. local route = math.random(1,4)
  105. if route == 1 then
  106. RouteOne(NPC)
  107. elseif route == 2 then
  108. RouteTwo(NPC)
  109. elseif route == 3 then
  110. RouteThree(NPC)
  111. elseif route == 4 then
  112. RouteFour(NPC)
  113. end
  114. MovementLoopAddLocation(NPC, -4.72, 3.24, -29.14, 2, 5, 0)
  115. local route = math.random(1,4)
  116. if route == 1 then
  117. RouteOne(NPC)
  118. elseif route == 2 then
  119. RouteTwo(NPC)
  120. elseif route == 3 then
  121. RouteThree(NPC)
  122. elseif route == 4 then
  123. RouteFour(NPC)
  124. end
  125. MovementLoopAddLocation(NPC, -7.65, 4, -43.74, 2, 5, 0)
  126. local route = math.random(1,4)
  127. if route == 1 then
  128. RouteOne(NPC)
  129. elseif route == 2 then
  130. RouteTwo(NPC)
  131. elseif route == 3 then
  132. RouteThree(NPC)
  133. elseif route == 4 then
  134. RouteFour(NPC)
  135. end
  136. MovementLoopAddLocation(NPC, -8.79, 4, -49.24, 5, 0)
  137. MovementLoopAddLocation(NPC, -14.78, 4.18, -60.38, 2, 0)
  138. MovementLoopAddLocation(NPC, -20.49, 4.18, -70.93, 2, 0)
  139. MovementLoopAddLocation(NPC, -21.05, 4.18, -74.31, 2, 0)
  140. MovementLoopAddLocation(NPC, -24.93, 4.18, -77.84, 2, 0)
  141. MovementLoopAddLocation(NPC, -26.03, 4.18, -81.13, 2, 0)
  142. MovementLoopAddLocation(NPC, -28.21, 4.18, -84.56, 2, 0)
  143. MovementLoopAddLocation(NPC, -29.13, 4.18, -88.63, 2, 0)
  144. MovementLoopAddLocation(NPC, -29.06, 4.16, -84.84, 2, 0)
  145. MovementLoopAddLocation(NPC, -27.09, 4.17, -80.11, 2, 0)
  146. MovementLoopAddLocation(NPC, -25.69, 4.17, -76.01, 2, 0)
  147. MovementLoopAddLocation(NPC, -21.33, 4.18, -75.09, 2, 0)
  148. MovementLoopAddLocation(NPC, -19.07, 4.18, -70.85, 5, 0)
  149. MovementLoopAddLocation(NPC, -13.68, 4.34, -59, 2, 0)
  150. MovementLoopAddLocation(NPC, -9.89, 4, -51.21, 2, 0)
  151. MovementLoopAddLocation(NPC, -13.96, 4, -47.39, 2, 0)
  152. MovementLoopAddLocation(NPC, -18.03, 4, -45.48, 2, 0)
  153. MovementLoopAddLocation(NPC, -19.44, 4, -40.95, 2, 0)
  154. MovementLoopAddLocation(NPC, -21.04, 4, -38.5, 2, 0)
  155. MovementLoopAddLocation(NPC, -21.16, 4, -36.67, 2, 0)
  156. MovementLoopAddLocation(NPC, -18.25, 3.46, -28.66, 2, 5, 0)
  157. local route = math.random(1,4)
  158. if route == 1 then
  159. RouteOne(NPC)
  160. elseif route == 2 then
  161. RouteTwo(NPC)
  162. elseif route == 3 then
  163. RouteThree(NPC)
  164. elseif route == 4 then
  165. RouteFour(NPC)
  166. end
  167. MovementLoopAddLocation(NPC, -13.49, 3, -16.79, 2, 5, 0)
  168. local route = math.random(1,4)
  169. if route == 1 then
  170. RouteOne(NPC)
  171. elseif route == 2 then
  172. RouteTwo(NPC)
  173. elseif route == 3 then
  174. RouteThree(NPC)
  175. elseif route == 4 then
  176. RouteFour(NPC)
  177. end
  178. MovementLoopAddLocation(NPC, -1.69, 3.5, -5.6, 2, 5, 0)
  179. local route = math.random(1,4)
  180. if route == 1 then
  181. RouteOne(NPC)
  182. elseif route == 2 then
  183. RouteTwo(NPC)
  184. elseif route == 3 then
  185. RouteThree(NPC)
  186. elseif route == 4 then
  187. RouteFour(NPC)
  188. end
  189. MovementLoopAddLocation(NPC, 9.23, 3.25, 6.03, 2, 5, 0)
  190. local route = math.random(1,4)
  191. if route == 1 then
  192. RouteOne(NPC)
  193. elseif route == 2 then
  194. RouteTwo(NPC)
  195. elseif route == 3 then
  196. RouteThree(NPC)
  197. elseif route == 4 then
  198. RouteFour(NPC)
  199. end
  200. MovementLoopAddLocation(NPC, 19.22, 3.5, 8.17, 2, 5, 0)
  201. local route = math.random(1,4)
  202. if route == 1 then
  203. RouteOne(NPC)
  204. elseif route == 2 then
  205. RouteTwo(NPC)
  206. elseif route == 3 then
  207. RouteThree(NPC)
  208. elseif route == 4 then
  209. RouteFour(NPC)
  210. end
  211. MovementLoopAddLocation(NPC, 33.96, 2.75, 8.04, 2, 5, 0)
  212. local route = math.random(1,4)
  213. if route == 1 then
  214. RouteOne(NPC)
  215. elseif route == 2 then
  216. RouteTwo(NPC)
  217. elseif route == 3 then
  218. RouteThree(NPC)
  219. elseif route == 4 then
  220. RouteFour(NPC)
  221. end
  222. MovementLoopAddLocation(NPC, 49.46, 2, 18.51, 2, 0)
  223. MovementLoopAddLocation(NPC, 49.84, 2, 22.47, 2, 0, "depop")
  224. end
  225. function RouteOne(NPC)
  226. local X = GetX(NPC)
  227. local Y = GetY(NPC)
  228. local Z = GetZ(NPC)
  229. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  230. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  231. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  232. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  233. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  234. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  235. end
  236. function RouteTwo(NPC)
  237. local X = GetX(NPC)
  238. local Y = GetY(NPC)
  239. local Z = GetZ(NPC)
  240. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  241. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  242. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  243. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  244. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  245. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  246. end
  247. function RouteThree(NPC)
  248. local X = GetX(NPC)
  249. local Y = GetY(NPC)
  250. local Z = GetZ(NPC)
  251. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  252. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  253. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  254. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  255. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  256. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  257. end
  258. function RouteFour(NPC)
  259. local X = GetX(NPC)
  260. local Y = GetY(NPC)
  261. local Z = GetZ(NPC)
  262. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  263. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  264. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  265. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  266. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  267. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  268. end
  269. function depop(NPC)
  270. Despawn(NPC)
  271. end