9
3

NFreeportWanders.lua 21 KB

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