NFreeportWanders.lua 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. --[[
  2. Script Name : SpawnScripts/NorthFreeport/NFreeportWanders.lua
  3. Script Purpose : Waypoint Path for All wanderers in North Freeport
  4. Script Author : Cynnar
  5. Script Date : 6/1/2018 03:06:35 PM
  6. Script Notes : Needs to add in split paths and to call function to spawn next wanderer
  7. --]]
  8. local path
  9. function waypoints(NPC)
  10. MovementLoopAddLocation(NPC, -223.06, -57.78, -150.9, 2, math.random(0, 6))
  11. MovementLoopAddLocation(NPC, -220.03, -58.83, -159.56, 2, 0)
  12. MovementLoopAddLocation(NPC, -217.61, -58.83, -163.77, 2, 0)
  13. MovementLoopAddLocation(NPC, -214.34, -58.83, -167.83, 2, 0)
  14. MovementLoopAddLocation(NPC, -211.29, -58.83, -170.3, 2, 0)
  15. MovementLoopAddLocation(NPC, -207.02, -58.83, -173.07, 2, 0)
  16. MovementLoopAddLocation(NPC, -204.05, -58.83, -176.46, 2, 0)
  17. MovementLoopAddLocation(NPC, -202.67, -58.83, -179.64, 2, 0)
  18. MovementLoopAddLocation(NPC, -201.81, -58.83, -184.29, 2, 0)
  19. MovementLoopAddLocation(NPC, -201, -58.83, -188.08, 2, 0)
  20. MovementLoopAddLocation(NPC, -199.43, -58.83, -192.25, 2, 0)
  21. MovementLoopAddLocation(NPC, -196.22, -58.83, -198.53, 2, 0)
  22. MovementLoopAddLocation(NPC, -194.02, -58.83, -204.38, 2, 0)
  23. MovementLoopAddLocation(NPC, -191.54, -58.83, -209.47, 2, 0)
  24. MovementLoopAddLocation(NPC, -186.05, -58.82, -215.92, 2, 0)
  25. MovementLoopAddLocation(NPC, -181, -58.8, -219.54, 2, 0)
  26. MovementLoopAddLocation(NPC, -175.8, -58.79, -222.26, 2, 0)
  27. path = math.random(0, 1)
  28. if path == 1 then
  29. path_1(NPC)
  30. else
  31. path_2(NPC)
  32. end
  33. MovementLoopAddLocation(NPC, -73, -34.59, -334.7, 2, 0)
  34. MovementLoopAddLocation(NPC, -53.33, -27.3, -335.17, 2, 0)
  35. MovementLoopAddLocation(NPC, -50.4, -27.31, -333.36, 2, 0)
  36. MovementLoopAddLocation(NPC, -47.94, -27.31, -330.74, 2, 0)
  37. MovementLoopAddLocation(NPC, -47.65, -27.3, -328.31, 2, 0)
  38. MovementLoopAddLocation(NPC, -46.37, -20.06, -310.13, 2, 0)
  39. path = math.random(0, 1)
  40. if path == 1 then
  41. path_M_0(NPC)
  42. end
  43. MovementLoopAddLocation(NPC, -46.98, -20.05, -296.12, 2, 0)
  44. path = math.random(0, 1)
  45. if path == 1 then
  46. path_M_1(NPC)
  47. else
  48. path_M_2(NPC)
  49. end
  50. MovementLoopAddLocation(NPC, -42.07, -13.95, -191.72, 2, 0, "changegrid_Going_Up")
  51. -- the below path needs tweaking but will allow me ot find the grid changes and add them
  52. MovementLoopAddLocation(NPC, -42.07, -13.95, -191.72, 2, 2)
  53. MovementLoopAddLocation(NPC, -44.22, -12.42, -184.67, 2, 2)
  54. MovementLoopAddLocation(NPC, -42.9, -11.68, -181.09, 2, 2)
  55. MovementLoopAddLocation(NPC, -40.47, -11.42, -179.79, 2, 2)
  56. MovementLoopAddLocation(NPC, -28.82, -10.91, -176.8, 2, 2)
  57. MovementLoopAddLocation(NPC, -26.46, -10.58, -174.76, 2, 2)
  58. MovementLoopAddLocation(NPC, -25.6, -10.12, -171.74, 2, 2)
  59. MovementLoopAddLocation(NPC, -25.8, -9.93, -170.37, 2, 2)
  60. MovementLoopAddLocation(NPC, -47.69, -9.49, -99.06, 2, 2)
  61. MovementLoopAddLocation(NPC, -46.82, -9.89, -92.37, 2, 2)
  62. MovementLoopAddLocation(NPC, -44.55, -10.45, -88.97, 2, 2)
  63. MovementLoopAddLocation(NPC, -36.56, -12.33, -80.55, 2, 2)
  64. MovementLoopAddLocation(NPC, -32.14, -13.03, -71.58, 2, 2)
  65. MovementLoopAddLocation(NPC, -30.6, -12.68, -64.69, 2, 2)
  66. MovementLoopAddLocation(NPC, -30.6, -13.02, -58.91, 2, 2)
  67. MovementLoopAddLocation(NPC, -28.83, -14.73, -54.39, 2, 2)
  68. MovementLoopAddLocation(NPC, -28.48, -16.29, -51.51, 2, 2)
  69. MovementLoopAddLocation(NPC, -28.99, -18.09, -48.72, 2, 2)
  70. MovementLoopAddLocation(NPC, -31.58, -20.22, -45.22, 2, 2)
  71. MovementLoopAddLocation(NPC, -40.76, -24.37, -41.55, 2, 2)
  72. MovementLoopAddLocation(NPC, -92.31, -24.37, -51.34, 2, 2)
  73. MovementLoopAddLocation(NPC, -108.18, -24.37, -52.2, 2, 2)
  74. MovementLoopAddLocation(NPC, -152.46, -23.84, -57.33, 2, 2)
  75. -- turn around now
  76. MovementLoopAddLocation(NPC, -152.46, -23.84, -57.33, 2, 2)
  77. MovementLoopAddLocation(NPC, -108.18, -24.37, -52.2, 2, 2)
  78. MovementLoopAddLocation(NPC, -92.31, -24.37, -51.34, 2, 2)
  79. MovementLoopAddLocation(NPC, -40.76, -24.37, -41.55, 2, 2)
  80. MovementLoopAddLocation(NPC, -31.58, -20.22, -45.22, 2, 2)
  81. MovementLoopAddLocation(NPC, -28.99, -18.09, -48.72, 2, 2)
  82. MovementLoopAddLocation(NPC, -28.48, -16.29, -51.51, 2, 2)
  83. MovementLoopAddLocation(NPC, -28.83, -14.73, -54.39, 2, 2)
  84. MovementLoopAddLocation(NPC, -30.6, -13.02, -58.91, 2, 2)
  85. MovementLoopAddLocation(NPC, -30.6, -12.68, -64.69, 2, 2)
  86. MovementLoopAddLocation(NPC, -32.14, -13.03, -71.58, 2, 2)
  87. MovementLoopAddLocation(NPC, -36.56, -12.33, -80.55, 2, 2)
  88. MovementLoopAddLocation(NPC, -44.55, -10.45, -88.97, 2, 2)
  89. MovementLoopAddLocation(NPC, -46.82, -9.89, -92.37, 2, 2)
  90. MovementLoopAddLocation(NPC, -47.69, -9.49, -99.06, 2, 2)
  91. MovementLoopAddLocation(NPC, -25.8, -9.93, -170.37, 2, 2)
  92. MovementLoopAddLocation(NPC, -25.6, -10.12, -171.74, 2, 2)
  93. MovementLoopAddLocation(NPC, -26.46, -10.58, -174.76, 2, 2)
  94. MovementLoopAddLocation(NPC, -28.82, -10.91, -176.8, 2, 2)
  95. MovementLoopAddLocation(NPC, -40.47, -11.42, -179.79, 2, 2)
  96. MovementLoopAddLocation(NPC, -42.9, -11.68, -181.09, 2, 2)
  97. MovementLoopAddLocation(NPC, -44.22, -12.42, -184.67, 2, 2)
  98. MovementLoopAddLocation(NPC, -42.07, -13.95, -191.72, 2, 2)
  99. -- the below path changes grid going back down
  100. MovementLoopAddLocation(NPC, -42.07, -13.95, -191.72, 2, 0, "changegrid_Going_Down")
  101. MovementLoopAddLocation(NPC, -38.19, -17.6, -206.13, 2, 0)
  102. MovementLoopAddLocation(NPC, -41.59, -20.05, -306.7, 2, 0)
  103. MovementLoopAddLocation(NPC, -49.14, -27.31, -332.17, 2, 0)
  104. MovementLoopAddLocation(NPC, -75.35, -34.59, -332.93, 2, 0)
  105. MovementLoopAddLocation(NPC, -78.64, -34.59, -300.55, 2, 0)
  106. MovementLoopAddLocation(NPC, -79.65, -34.59, -284.7, 2, 0)
  107. MovementLoopAddLocation(NPC, -83.56, -34.59, -272.71, 2, 0)
  108. MovementLoopAddLocation(NPC, -74.37, -34.59, -268.9, 2, 0)
  109. MovementLoopAddLocation(NPC, -71.68, -34.64, -259.61, 2, 0)
  110. MovementLoopAddLocation(NPC, -74.49, -40.33, -239.88, 2, 0)
  111. MovementLoopAddLocation(NPC, -98.38, -40.33, -242.16, 2, 0)
  112. MovementLoopAddLocation(NPC, -115.83, -40.33, -239.26, 2, 0)
  113. MovementLoopAddLocation(NPC, -119.98, -40.33, -227.42, 2, 0)
  114. MovementLoopAddLocation(NPC, -125.8, -40.33, -210.82, 2, 0)
  115. MovementLoopAddLocation(NPC, -123.43, -40.33, -204.9, 2, 0)
  116. MovementLoopAddLocation(NPC, -110.43, -45.45, -198.73, 2, 0)
  117. MovementLoopAddLocation(NPC, -108.38, -46.05, -191.29, 2, 0)
  118. MovementLoopAddLocation(NPC, -119.97, -46.05, -190.14, 2, 0)
  119. MovementLoopAddLocation(NPC, -134.06, -51.8, -202.83, 2, 0)
  120. MovementLoopAddLocation(NPC, -145.69, -51.71, -213.04, 2, 0)
  121. MovementLoopAddLocation(NPC, -172.27, -58.78, -223.46, 2, 0)
  122. MovementLoopAddLocation(NPC, -187.94, -58.82, -214.02, 2, 0)
  123. MovementLoopAddLocation(NPC, -194.25, -58.83, -203.97, 2, 0)
  124. MovementLoopAddLocation(NPC, -196.73, -58.83, -196.44, 2, 0)
  125. MovementLoopAddLocation(NPC, -201.38, -58.83, -190.06, 2, 0)
  126. MovementLoopAddLocation(NPC, -202.34, -58.83, -183.87, 2, 0)
  127. MovementLoopAddLocation(NPC, -203.25, -58.83, -177.99, 2, 0)
  128. MovementLoopAddLocation(NPC, -206.57, -58.83, -173.18, 2, 0)
  129. MovementLoopAddLocation(NPC, -211.24, -58.83, -170.33, 2, 0)
  130. MovementLoopAddLocation(NPC, -218.61, -58.83, -162.67, 2, 0)
  131. MovementLoopAddLocation(NPC, -221.69, -57.94, -154.27, 2, 0)
  132. MovementLoopAddLocation(NPC, -221.94, -57.78, -150.45, 2, 0, "depop")
  133. end
  134. --------------------------------------------------------------------------------------
  135. -- Path 1
  136. --------------------------------------------------------------------------------------
  137. function path_1(NPC)
  138. MovementLoopAddLocation(NPC, -169.9, -58.78, -222.94, 2, 0)
  139. MovementLoopAddLocation(NPC, -164.11, -58.73, -221.04, 2, 0)
  140. MovementLoopAddLocation(NPC, -147.45, -51.53, -211.51, 2, 0)
  141. MovementLoopAddLocation(NPC, -143.90, -51.67, -209.39, 2, 0)
  142. path = math.random(0, 2)
  143. if path == 1 then
  144. path_1_0(NPC)
  145. elseif path == 2 then
  146. path_1_A(NPC)
  147. else
  148. path_1_B(NPC)
  149. end
  150. end
  151. --------------------------------------------------------------------------------------
  152. -- Path 1 (0)
  153. --------------------------------------------------------------------------------------
  154. function path_1_0(NPC)
  155. MovementLoopAddLocation(NPC, -143.18, -51.79, -204.42, 2, 0)
  156. MovementLoopAddLocation(NPC, -149.44, -51.83, -196.63, 2, 0)
  157. MovementLoopAddLocation(NPC, -156.32, -52.58, -186.63, 2, 0)
  158. MovementLoopAddLocation(NPC, -164.31, -54.34, -170.32, 2, 0)
  159. MovementLoopAddLocation(NPC, -169.77, -55.19, -155.41, 2, 0)
  160. MovementLoopAddLocation(NPC, -172.41, -55.69, -143.41, 2, 0)
  161. MovementLoopAddLocation(NPC, -172.44, -56.14, -123.56, 2, 0)
  162. MovementLoopAddLocation(NPC, -167.41, -56.14, -115.27, 2, 0)
  163. MovementLoopAddLocation(NPC, -175.67, -56.14, -120.51, 2, 0)
  164. MovementLoopAddLocation(NPC, -175.78, -56.14, -120.31, 2, 3, "convointeract")
  165. MovementLoopAddLocation(NPC, -172.41, -55.69, -143.41, 2, 0)
  166. MovementLoopAddLocation(NPC, -169.77, -55.19, -155.41, 2, 0)
  167. MovementLoopAddLocation(NPC, -164.31, -54.34, -170.32, 2, 0)
  168. MovementLoopAddLocation(NPC, -156.32, -52.58, -186.63, 2, 0)
  169. MovementLoopAddLocation(NPC, -149.44, -51.83, -196.63, 2, 0)
  170. MovementLoopAddLocation(NPC, -143.18, -51.79, -204.42, 2, 0)
  171. path = math.random(0, 1)
  172. if path == 1 then
  173. path_1_A(NPC)
  174. else
  175. path_1_B(NPC)
  176. end
  177. end
  178. --------------------------------------------------------------------------------------
  179. -- Path 1 (A)
  180. --------------------------------------------------------------------------------------
  181. function path_1_A(NPC)
  182. MovementLoopAddLocation(NPC, -133.61, -51.81, -202.18, 2, 0)
  183. MovementLoopAddLocation(NPC, -122.51, -46.09, -193.1, 2, 2)
  184. path = math.random(0, 1)
  185. if path == 1 then
  186. path_1_A0(NPC)
  187. else
  188. path_1_A1(NPC)
  189. end
  190. end
  191. function path_1_A0(NPC)
  192. MovementLoopAddLocation(NPC, -120.89, -46.06, -186.65, 2, 0)
  193. MovementLoopAddLocation(NPC, -122.83, -46.07, -183.89, 2, 0)
  194. MovementLoopAddLocation(NPC, -124.63, -46.07, -183.15, 2, 0)
  195. MovementLoopAddLocation(NPC, -126.41, -46.08, -183.44, 2, 0)
  196. MovementLoopAddLocation(NPC, -129.31, -46.08, -184.69, 2, 0)
  197. MovementLoopAddLocation(NPC, -132.83, -46.08, -185.38, 2, 0)
  198. MovementLoopAddLocation(NPC, -136.46, -46.08, -185.39, 2, 0)
  199. MovementLoopAddLocation(NPC, -140.57, -46.08, -184.19, 2, 0)
  200. MovementLoopAddLocation(NPC, -143.16, -46.08, -181.62, 2, 0)
  201. MovementLoopAddLocation(NPC, -144.91, -46.08, -178.82, 2, 0)
  202. MovementLoopAddLocation(NPC, -146.21, -46.08, -174.25, 2, 0)
  203. MovementLoopAddLocation(NPC, -147.28, -43.42, -168.09, 2, 0)
  204. MovementLoopAddLocation(NPC, -141.45, -41.22, -161.81, 2, 0)
  205. MovementLoopAddLocation(NPC, -142.81, -41.22, -159.03, 2, 0)
  206. MovementLoopAddLocation(NPC, -148.79, -41.22, -145.75, 2, 3)
  207. MovementLoopAddLocation(NPC, -149.24, -41.22, -145.09, 2, 0, "depop")
  208. end
  209. function path_1_A1(NPC)
  210. MovementLoopAddLocation(NPC, -110.71, -46.04, -192.08, 2, 0)
  211. MovementLoopAddLocation(NPC, -108.34, -46.03, -194.76, 2, 0)
  212. MovementLoopAddLocation(NPC, -110.44, -45.46, -197.94, 2, 0)
  213. MovementLoopAddLocation(NPC, -123.47, -40.33, -205.4, 2, 0)
  214. MovementLoopAddLocation(NPC, -125.64, -40.33, -208.7, 2, 0)
  215. MovementLoopAddLocation(NPC, -124.99, -40.33, -212.61, 2, 0)
  216. MovementLoopAddLocation(NPC, -117.79, -40.33, -235.84, 2, 0)
  217. MovementLoopAddLocation(NPC, -115.56, -40.33, -238.77, 2, 0)
  218. MovementLoopAddLocation(NPC, -112.1, -40.33, -240.96, 2, 0)
  219. MovementLoopAddLocation(NPC, -108.02, -40.33, -242.18, 2, 0)
  220. MovementLoopAddLocation(NPC, -91.14, -40.33, -242.24, 2, 0)
  221. MovementLoopAddLocation(NPC, -85.75, -40.33, -238.90, 2, 3)
  222. path = math.random(0, 1)
  223. if path == 1 then
  224. path_1_A1_A(NPC)
  225. else
  226. path_1_A1_B(NPC)
  227. end
  228. end
  229. function path_1_A1_A(NPC)
  230. MovementLoopAddLocation(NPC, -74.84, -40.33, -241.43, 2, 0)
  231. MovementLoopAddLocation(NPC, -73.28, -34.62, -260.18, 2, 0)
  232. MovementLoopAddLocation(NPC, -74.05, -34.6, -263.5, 2, 0)
  233. MovementLoopAddLocation(NPC, -75.97, -34.6, -266.3, 2, 0)
  234. MovementLoopAddLocation(NPC, -79.11, -34.59, -268.7, 2, 0)
  235. MovementLoopAddLocation(NPC, -82.26, -34.59, -272.47, 2, 0)
  236. MovementLoopAddLocation(NPC, -84, -34.59, -276.38, 2, 0)
  237. MovementLoopAddLocation(NPC, -82.66, -34.59, -282.19, 2, 0)
  238. MovementLoopAddLocation(NPC, -81.11, -34.59, -287.45, 2, 0)
  239. MovementLoopAddLocation(NPC, -79.72, -34.59, -293.65, 2, 0)
  240. MovementLoopAddLocation(NPC, -77.75, -34.59, -307.03, 2, 0)
  241. MovementLoopAddLocation(NPC, -76.54, -34.59, -333.41, 2, 0)
  242. end
  243. function path_1_A1_B(NPC)
  244. MovementLoopAddLocation(NPC, -88.36, -40.34, -250.34, 2, 0)
  245. MovementLoopAddLocation(NPC, -93.29, -40.37, -255.67, 2, 0)
  246. MovementLoopAddLocation(NPC, -112.39, -46.05, -262.74, 2, 0)
  247. MovementLoopAddLocation(NPC, -119.67, -45.91, -264.97, 2, 3)
  248. path_1_B2(NPC)
  249. end
  250. --------------------------------------------------------------------------------------
  251. -- Path 1 B
  252. --------------------------------------------------------------------------------------
  253. function path_1_B(NPC)
  254. MovementLoopAddLocation(NPC, -138.63, -51.52, -211.31, 2, 0)
  255. MovementLoopAddLocation(NPC, -134.5, -50.34, -222.11, 2, 0)
  256. MovementLoopAddLocation(NPC, -133.05, -49.66, -228.59, 2, 0)
  257. MovementLoopAddLocation(NPC, -119.67, -45.91, -264.97, 2, 3)
  258. path = math.random(0, 1)
  259. if path == 1 then
  260. path_1_B1(NPC)
  261. else
  262. path_1_B2(NPC)
  263. end
  264. end
  265. function path_1_B1(NPC)
  266. MovementLoopAddLocation(NPC, -112.39, -46.05, -262.74, 2, 0)
  267. MovementLoopAddLocation(NPC, -93.29, -40.37, -255.67, 2, 0)
  268. MovementLoopAddLocation(NPC, -88.36, -40.34, -250.34, 2, 0)
  269. MovementLoopAddLocation(NPC, -85.75, -40.33, -238.90, 2, 0)
  270. path_1_A1_A(NPC)
  271. end
  272. function path_1_B2(NPC)
  273. MovementLoopAddLocation(NPC, -117.41, -45.67, -272.94, 2, 0)
  274. MovementLoopAddLocation(NPC, -112.23, -44.38, -287.58, 2, 0)
  275. MovementLoopAddLocation(NPC, -108.43, -43.63, -294.92, 2, 0)
  276. MovementLoopAddLocation(NPC, -106.37, -42.82, -301.29, 2, 0)
  277. MovementLoopAddLocation(NPC, -106.04, -42, -311.79, 2, 0)
  278. MovementLoopAddLocation(NPC, -106.52, -40.64, -329.87, 2, 0)
  279. MovementLoopAddLocation(NPC, -105.83, -34.63, -353.16, 2, 0)
  280. MovementLoopAddLocation(NPC, -94.85, -34.6, -353.04, 2, 0)
  281. MovementLoopAddLocation(NPC, -87.51, -34.59, -348.76, 2, 0)
  282. MovementLoopAddLocation(NPC, -85.22, -34.59, -344.25, 2, 0)
  283. MovementLoopAddLocation(NPC, -79.49, -34.59, -340.59, 2, 0)
  284. end
  285. --------------------------------------------------------------------------------------
  286. -- Path 2
  287. --------------------------------------------------------------------------------------
  288. function path_2(NPC)
  289. MovementLoopAddLocation(NPC, -174.11, -58.78, -225.87, 2, 0)
  290. MovementLoopAddLocation(NPC, -175.66, -58.78, -229.59, 2, 0)
  291. MovementLoopAddLocation(NPC, -175.1, -58.78, -232.62, 2, 0)
  292. MovementLoopAddLocation(NPC, -172.73, -58.79, -239.34, 2, 0)
  293. MovementLoopAddLocation(NPC, -170.44, -58.79, -244.27, 2, 0)
  294. MovementLoopAddLocation(NPC, -165.02, -58.71, -261.07, 2, 0)
  295. MovementLoopAddLocation(NPC, -160.2, -53.04, -276.76, 2, 0)
  296. path = math.random(0, 1)
  297. if path == 1 then
  298. path_2_A(NPC)
  299. else
  300. path_2_B(NPC)
  301. end
  302. end
  303. --------------------------------------------------------------------------------------
  304. -- Path 2 (A)
  305. --------------------------------------------------------------------------------------
  306. function path_2_A(NPC)
  307. MovementLoopAddLocation(NPC, -156.08, -53.06, -279.01, 2, 0)
  308. MovementLoopAddLocation(NPC, -149.76 -53.01, -275.14, 2, 0)
  309. MovementLoopAddLocation(NPC, -118.51, -45.90, -265.65, 2, 5)
  310. path = math.random(0, 1)
  311. if path == 1 then
  312. path_1_B1(NPC)
  313. else
  314. path_1_B2(NPC)
  315. end
  316. end
  317. --------------------------------------------------------------------------------------
  318. -- Path 2 (B)
  319. --------------------------------------------------------------------------------------
  320. function path_2_B(NPC)
  321. MovementLoopAddLocation(NPC, -158.68, -53.07, -281.49, 2, 0)
  322. MovementLoopAddLocation(NPC, -158.3, -53.12, -292.75, 2, 0)
  323. MovementLoopAddLocation(NPC, -156.89, -53.12, -306.44, 2, 0)
  324. MovementLoopAddLocation(NPC, -153.09, -53.12, -317.94, 2, 0)
  325. MovementLoopAddLocation(NPC, -142.21, -53.12, -329.3, 2, 0)
  326. MovementLoopAddLocation(NPC, -139, -53.12, -336.57, 2, 0)
  327. MovementLoopAddLocation(NPC, -139.12, -53.12, -344.84, 2, 0)
  328. MovementLoopAddLocation(NPC, -140.95, -53.12, -352.35, 2, 0)
  329. MovementLoopAddLocation(NPC, -146.84, -53.12, -367.32, 2, 3, "convointeract")
  330. MovementLoopAddLocation(NPC, -140.95, -53.12, -352.35, 2, 0)
  331. MovementLoopAddLocation(NPC, -139.12, -53.12, -344.84, 2, 0)
  332. MovementLoopAddLocation(NPC, -139, -53.12, -336.57, 2, 0)
  333. MovementLoopAddLocation(NPC, -142.21, -53.12, -329.3, 2, 0)
  334. MovementLoopAddLocation(NPC, -153.09, -53.12, -317.94, 2, 0)
  335. MovementLoopAddLocation(NPC, -156.89, -53.12, -306.44, 2, 0)
  336. MovementLoopAddLocation(NPC, -158.3, -53.12, -292.75, 2, 0)
  337. MovementLoopAddLocation(NPC, -158.68, -53.07, -281.49, 2, 0)
  338. MovementLoopAddLocation(NPC, -156.08, -53.06, -279.01, 2, 0)
  339. MovementLoopAddLocation(NPC, -149.76 -53.01, -275.14, 2, 0)
  340. MovementLoopAddLocation(NPC, -118.51, -45.90, -265.65, 2, 5)
  341. path = math.random(0, 1)
  342. if path == 1 then
  343. path_1_B1(NPC)
  344. else
  345. path_1_B2(NPC)
  346. end
  347. end
  348. --------------------------------------------------------------------------------------
  349. -- path M (second floor)
  350. --------------------------------------------------------------------------------------
  351. function path_M_0(NPC)
  352. MovementLoopAddLocation(NPC, -39.22, -20.05, -303.54, 2, 0)
  353. MovementLoopAddLocation(NPC, -33.18, -20.05, -302.24, 2, 0)
  354. MovementLoopAddLocation(NPC, -8.05, -20.05, -301.9, 2, 0)
  355. MovementLoopAddLocation(NPC, -5.43, -20.05, -303.81, 2, 0)
  356. MovementLoopAddLocation(NPC, -5.08, -20.05, -304.57, 2, 0)
  357. MovementLoopAddLocation(NPC, -5.43, -20.05, -303.81, 2, 0)
  358. MovementLoopAddLocation(NPC, -8.05, -20.05, -301.9, 2, 0)
  359. MovementLoopAddLocation(NPC, -33.18, -20.05, -302.24, 2, 0)
  360. MovementLoopAddLocation(NPC, -39.22, -20.05, -303.54, 2, 0)
  361. MovementLoopAddLocation(NPC, -46.98, -20.05, -296.12, 2, 0)
  362. end
  363. function path_M_1(NPC)
  364. MovementLoopAddLocation(NPC, -50.48, -20.05, -291.21, 2, 0)
  365. MovementLoopAddLocation(NPC, -54.83, -20.05, -289.07, 2, 0)
  366. MovementLoopAddLocation(NPC, -57.27, -20.05, -286.83, 2, 0)
  367. MovementLoopAddLocation(NPC, -59.01, -20.05, -279.63, 2, 0)
  368. MovementLoopAddLocation(NPC, -58.28, -20.05, -273.66, 2, 0)
  369. MovementLoopAddLocation(NPC, -53.34, -20.05, -268.11, 2, 0)
  370. MovementLoopAddLocation(NPC, -51.46, -20.05, -262.82, 2, 0)
  371. MovementLoopAddLocation(NPC, -52.4, -20.05, -265.51, 2, 0)
  372. path = math.random(0, 1)
  373. if path == 1 then
  374. path_M_1_2(NPC)
  375. else
  376. path_M_2_1(NPC)
  377. end
  378. end
  379. function path_M_2(NPC)
  380. MovementLoopAddLocation(NPC, -45.22, -19.99, -292.82, 2, 0)
  381. MovementLoopAddLocation(NPC, -44.02, -20.05, -291.21, 2, 0)
  382. MovementLoopAddLocation(NPC, -41.55, -20.05, -289.99, 2, 0)
  383. MovementLoopAddLocation(NPC, -39.02, -20.05, -289.4, 2, 0)
  384. MovementLoopAddLocation(NPC, -36.53, -20.05, -287.74, 2, 0)
  385. MovementLoopAddLocation(NPC, -35.85, -20.05, -286.19, 2, 0)
  386. MovementLoopAddLocation(NPC, -35.46, -20.05, -283.84, 2, 0)
  387. MovementLoopAddLocation(NPC, -35.78, -20.05, -272.98, 2, 0)
  388. MovementLoopAddLocation(NPC, -36.46, -20.05, -271.23, 2, 0)
  389. MovementLoopAddLocation(NPC, -39.76, -20.05, -266.08, 2, 0)
  390. path = math.random(0, 1)
  391. if path == 1 then
  392. path_M_1_2(NPC)
  393. else
  394. path_M_2_1(NPC)
  395. end
  396. end
  397. function path_M_1_2(NPC)
  398. MovementLoopAddLocation(NPC, -46.65, -20.05, -262.10, 2, 0, math.random(3, 12))
  399. MovementLoopAddLocation(NPC, -52.4, -20.05, -257.83, 2, 0)
  400. MovementLoopAddLocation(NPC, -53.92, -20.05, -254.64, 2, 0)
  401. MovementLoopAddLocation(NPC, -57.09, -20.05, -251.29, 2, 0)
  402. MovementLoopAddLocation(NPC, -57.7, -20.05, -249.34, 2, 0)
  403. MovementLoopAddLocation(NPC, -58.47, -20.05, -246.06, 2, 0)
  404. MovementLoopAddLocation(NPC, -58.61, -20.05, -239.32, 2, 0)
  405. MovementLoopAddLocation(NPC, -57.63, -20.05, -236.31, 2, 0)
  406. MovementLoopAddLocation(NPC, -55.64, -20.05, -234.06, 2, 0)
  407. MovementLoopAddLocation(NPC, -48.08, -20.07, -225.36, 2, 0)
  408. MovementLoopAddLocation(NPC, -39.74, -18.02, -209.19, 2, 0)
  409. end
  410. function path_M_2_1(NPC)
  411. MovementLoopAddLocation(NPC, -46.65, -20.05, -262.10, 2, 0, math.random(3, 12))
  412. MovementLoopAddLocation(NPC, -39.55, -20.05, -259, 2, 0)
  413. MovementLoopAddLocation(NPC, -36.7, -20.05, -254.18, 2, 0)
  414. MovementLoopAddLocation(NPC, -35.61, -20.05, -251.85, 2, 0)
  415. MovementLoopAddLocation(NPC, -35.64, -20.05, -238.73, 2, 0)
  416. MovementLoopAddLocation(NPC, -35.54, -19.27, -215.97, 2, 0)
  417. end
  418. --------------------------------------------------------------------------------------
  419. -- Despawn
  420. --------------------------------------------------------------------------------------
  421. function depop(NPC)
  422. Despawn(NPC)
  423. end
  424. --------------------------------------------------------------------------------------
  425. -- NPC Interaction conversations and other functions
  426. --------------------------------------------------------------------------------------
  427. function convointeract(NPC)
  428. local spawn2 = GetSpawn(NPC, 1440070)
  429. if spawn2 ~= nil then
  430. AddTimer(spawn2, 5000, "Talk")
  431. end
  432. end
  433. --------------------------------------------------------------------------------------
  434. -- NPC Change Grid
  435. --------------------------------------------------------------------------------------
  436. function changegrid_Going_Up(NPC)
  437. SetGridID(NPC, 157236824)
  438. end
  439. function changegrid_Going_Down(NPC)
  440. SetGridID(NPC, 840463424)
  441. end