GuardKaladenth.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/GuardKaladenth.lua
  3. Script Author : Rylec
  4. Script Date : 2021.10.07 03:10:58
  5. Script Purpose :
  6. :
  7. --]]
  8. local Tolar = 0
  9. local GuardKaladenthRound = 0
  10. function spawn(NPC)
  11. waypoints01(NPC, Spawn)
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function waypoints01(NPC, Spawn)
  20. -- 594.5 -21.44 -257.44
  21. GuardKaladenthRound = 1
  22. MoveToLocation(NPC, 586.6, -20.75, -257.61, 2)
  23. MoveToLocation(NPC, 567.91, -20.16, -267.01, 2)
  24. MoveToLocation(NPC, 551.11, -20.07, -278.67, 2)
  25. MoveToLocation(NPC, 535.17, -20.19, -281.03, 2, "WalkTowardsTolar")
  26. end
  27. function waypoints02(NPC, Spawn)
  28. MoveToLocation(NPC, 532.86, -20.72, -295.55, 2)
  29. MoveToLocation(NPC, 546.85, -21.18, -306.05, 2)
  30. MoveToLocation(NPC, 554.54, -21.68, -313.88, 2)
  31. MoveToLocation(NPC, 561.72, -21.93, -313.78, 2, "DelayBeforeWaypoints03")
  32. end
  33. function DelayBeforeWaypoints03(NPC, Spawn)
  34. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints03")
  35. end
  36. function waypoints03(NPC, Spawn)
  37. MoveToLocation(NPC, 556.27, -21.76, -314.34, 2)
  38. MoveToLocation(NPC, 544.99, -21.16, -326.12, 2)
  39. MoveToLocation(NPC, 539.46, -20.31, -345.27, 2)
  40. MoveToLocation(NPC, 540.69, -20.02, -351.6, 2, "DelayBeforeWaypoints04")
  41. end
  42. function DelayBeforeWaypoints04(NPC, Spawn)
  43. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints04")
  44. end
  45. function waypoints04(NPC, Spawn)
  46. MoveToLocation(NPC, 557.41, -20.46, -356.75, 2)
  47. MoveToLocation(NPC, 571.4, -21.67, -363.38, 2)
  48. MoveToLocation(NPC, 574.43, -21.63, -364.45, 2)
  49. MoveToLocation(NPC, 576.13, -21.63, -364.76, 2, "DelayBeforeWaypoints05")
  50. end
  51. function DelayBeforeWaypoints05(NPC, Spawn)
  52. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints05")
  53. end
  54. function waypoints05(NPC, Spawn)
  55. GuardKaladenthRound = 2
  56. MoveToLocation(NPC, 572.51, -21.66, -363.25, 2)
  57. MoveToLocation(NPC, 554.27, -20.47, -341.45, 2)
  58. MoveToLocation(NPC, 539.46, -20.96, -329.09, 2)
  59. MoveToLocation(NPC, 531.08, -21.08, -317.15, 2)
  60. MoveToLocation(NPC, 525.95, -20.83, -301.52, 2, "WalkTowardsTolar")
  61. end
  62. function waypoints06(NPC, Spawn)
  63. MoveToLocation(NPC, 538.59, -20.19, -280.36, 2)
  64. MoveToLocation(NPC, 549.06, -20.02, -277.42, 2)
  65. MoveToLocation(NPC, 580.93, -20.83, -259, 2)
  66. MoveToLocation(NPC, 586.29, -20.75, -257.29, 2)
  67. MoveToLocation(NPC, 592.66, -21.19, -256.08, 2, "DelayBeforeWaypoints07")
  68. end
  69. function DelayBeforeWaypoints07(NPC, Spawn)
  70. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints07")
  71. end
  72. function waypoints07(NPC, Spawn)
  73. GuardKaladenthRound = 3
  74. MoveToLocation(NPC, 584.87, -20.74, -257.79, 2)
  75. MoveToLocation(NPC, 550.09, -20.03, -277.9, 2)
  76. MoveToLocation(NPC, 535.17, -20.19, -281.03, 2, "WalkTowardsTolar")
  77. end
  78. function waypoints08(NPC, Spawn)
  79. MoveToLocation(NPC, 526.89, -20.91, -304.36, 2)
  80. MoveToLocation(NPC, 531.85, -21.07, -322.17, 2)
  81. MoveToLocation(NPC, 555.88, -20.4, -350.44, 2)
  82. MoveToLocation(NPC, 566.04, -21.51, -358.19, 2)
  83. MoveToLocation(NPC, 571.22, -21.9, -360.12, 2, "DelayBeforeQueenAntonia")
  84. end
  85. function DelayBeforeQueenAntonia(NPC, Spawn)
  86. AddTimer(NPC, 2000, "QueenAntonia")
  87. end
  88. function QueenAntonia(NPC)
  89. local Antonia = GetSpawn(NPC, 6600268)
  90. if Antonia ~= nil then
  91. FaceTarget(NPC, Antonia)
  92. AddTimer(NPC, MakeRandomInt(5000,15000), "SaluteAntonia")
  93. end
  94. end
  95. function SaluteAntonia(NPC)
  96. local count = MakeRandomInt(1,10)
  97. if count == 1 then
  98. PlayAnimation(NPC, 121) --Bow
  99. AddTimer(NPC, 5000, "waypoints09")
  100. elseif count == 2 then
  101. PlayAnimation(NPC, 10815) --Salute
  102. AddTimer(NPC, 7000, "waypoints09")
  103. elseif count == 3 then
  104. PlayAnimation(NPC, 12030) --Ponder
  105. AddTimer(NPC, 12000, "waypoints09")
  106. else
  107. waypoints09(NPC, Spawn)
  108. end
  109. end
  110. function waypoints09(NPC, Spawn)
  111. MoveToLocation(NPC, 557.45, -19.97, -363.21, 2, "DelayBeforeWaypoints10")
  112. end
  113. function DelayBeforeWaypoints10(NPC, Spawn)
  114. AddTimer(NPC, MakeRandomInt(3000,10000), "AppreciateArchers")
  115. end
  116. function AppreciateArchers(NPC)
  117. local count = MakeRandomInt(1,40)
  118. if count == 1 then
  119. PlayAnimation(NPC, 891) --Yawn
  120. AddTimer(NPC, 7000, "waypoints10")
  121. elseif count == 2 then
  122. PlayAnimation(NPC, 10745) --Agree
  123. AddTimer(NPC, 4000, "waypoints10")
  124. elseif count == 3 then
  125. PlayAnimation(NPC, 10760) --Applaud
  126. AddTimer(NPC, 6500, "waypoints10")
  127. elseif count == 4 then
  128. PlayAnimation(NPC, 11150) --Cheer
  129. AddTimer(NPC, 9000, "waypoints10")
  130. elseif count == 5 then
  131. PlayAnimation(NPC, 11463) --Duck
  132. AddTimer(NPC, 5500, "waypoints10")
  133. elseif count == 6 then
  134. PlayAnimation(NPC, 11682) --Hello
  135. AddTimer(NPC, 4000, "waypoints10")
  136. -- elseif count == 7 then
  137. -- PlayAnimation(NPC, 11683) --Heroic
  138. -- AddTimer(NPC, 6500, "waypoints10")
  139. elseif count == 8 then
  140. PlayAnimation(NPC, 11882) --Nod
  141. AddTimer(NPC, 4000, "waypoints10")
  142. elseif count == 9 then
  143. PlayAnimation(NPC, 11976) --Peer
  144. AddTimer(NPC, 8000, "waypoints10")
  145. elseif count == 10 then
  146. PlayAnimation(NPC, 12030) --Ponder
  147. AddTimer(NPC, 12000, "waypoints10")
  148. elseif count == 11 then
  149. PlayAnimation(NPC, 12031) --Pout
  150. AddTimer(NPC, 4000, "waypoints10")
  151. elseif count == 12 then
  152. PlayAnimation(NPC, 12246) --Sigh
  153. AddTimer(NPC, 4000, "waypoints10")
  154. elseif count == 13 then
  155. PlayAnimation(NPC, 12285) --Smile
  156. AddTimer(NPC, 4000, "waypoints10")
  157. -- elseif count == 14 then
  158. -- PlayAnimation(NPC, 12701) --Growl
  159. -- AddTimer(NPC, 4000, "waypoints10")
  160. elseif count == 15 then
  161. PlayAnimation(NPC, 13008) --Stretch
  162. AddTimer(NPC, 16500, "waypoints10")
  163. elseif count == 16 then
  164. PlayAnimation(NPC, 13056) --Tapfoot
  165. AddTimer(NPC, 12000, "waypoints10")
  166. -- elseif count == 17 then
  167. -- PlayAnimation(NPC, 13064) -- Thumbs Up
  168. -- AddTimer(NPC, 6500, "waypoints10")
  169. else
  170. waypoints10(NPC, Spawn)
  171. end
  172. end
  173. function waypoints10(NPC, Spawn)
  174. MoveToLocation(NPC, 551.37, -20.59, -339.61, 2)
  175. MoveToLocation(NPC, 549.97, -21.32, -323.8, 2)
  176. MoveToLocation(NPC, 556.73, -21.82, -316.15, 2)
  177. MoveToLocation(NPC, 561.12, -21.93, -314.55, 2, "DelayBeforeWaypoints11")
  178. end
  179. function DelayBeforeWaypoints11(NPC, Spawn)
  180. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints11")
  181. end
  182. function waypoints11(NPC, Spawn)
  183. GuardKaladenthRound = 4
  184. MoveToLocation(NPC, 555.2, -21.68, -313.03, 2)
  185. MoveToLocation(NPC, 534.13, -20.76, -296.53, 2, "WalkTowardsTolar")
  186. end
  187. function waypoints12(NPC, Spawn)
  188. MoveToLocation(NPC, 533.65, -20.32, -284.06, 2)
  189. MoveToLocation(NPC, 548.81, -20.02, -277.27, 2)
  190. MoveToLocation(NPC, 583.68, -20.76, -258.02, 2)
  191. MoveToLocation(NPC, 593.11, -21.26, -256.92, 2, "DelayBeforeWaypoints13")
  192. end
  193. function DelayBeforeWaypoints13(NPC, Spawn)
  194. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints13")
  195. end
  196. function waypoints13(NPC, Spawn)
  197. MoveToLocation(NPC, 585.04, -20.74, -257.84, 2)
  198. MoveToLocation(NPC, 548.58, -20.07, -278.76, 2)
  199. MoveToLocation(NPC, 537.42, -20.22, -281.23, 2)
  200. MoveToLocation(NPC, 529.76, -20.52, -288.34, 2)
  201. MoveToLocation(NPC, 527.26, -20.82, -300.68, 2)
  202. MoveToLocation(NPC, 529.72, -21.06, -316.94, 2)
  203. MoveToLocation(NPC, 540.12, -20.77, -334.29, 2)
  204. MoveToLocation(NPC, 571.01, -21.66, -363.32, 2)
  205. MoveToLocation(NPC, 574.12, -21.62, -364.57, 2)
  206. MoveToLocation(NPC, 576.53, -21.63, -364.89, 2,"DelayBeforeWaypoints14")
  207. end
  208. function DelayBeforeWaypoints14(NPC, Spawn)
  209. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints14")
  210. end
  211. function waypoints14(NPC, Spawn)
  212. GuardKaladenthRound = 5
  213. MoveToLocation(NPC, 571, -21.63, -363.9, 2)
  214. MoveToLocation(NPC, 556.44, -20.38, -353.29, 2)
  215. MoveToLocation(NPC, 544.26, -20.79, -334.28, 2)
  216. MoveToLocation(NPC, 530.95, -21.08, -316.32, 2)
  217. MoveToLocation(NPC, 525.95, -20.83, -301.52, 2, "WalkTowardsTolar")
  218. end
  219. function waypoints15(NPC, Spawn)
  220. MoveToLocation(NPC, 529.32, -20.72, -294.82, 2)
  221. MoveToLocation(NPC, 540.27, -20.93, -301.29, 2)
  222. MoveToLocation(NPC, 556.15, -21.74, -313.74, 2)
  223. MoveToLocation(NPC, 561.14, -21.91, -313.77, 2, "DelayBeforeWaypoints16")
  224. end
  225. function DelayBeforeWaypoints16(NPC, Spawn)
  226. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints16")
  227. end
  228. function waypoints16(NPC, Spawn)
  229. MoveToLocation(NPC, 555.33, -21.67, -312.27, 2)
  230. MoveToLocation(NPC, 535.29, -20.78, -297.21, 2)
  231. MoveToLocation(NPC, 532.19, -20.54, -289.54, 2)
  232. MoveToLocation(NPC, 534.96, -20.27, -282.58, 2)
  233. MoveToLocation(NPC, 550.78, -19.98, -276.7, 2)
  234. MoveToLocation(NPC, 583.18, -20.77, -258.08, 2, "DelayBeforeWaypoints17")
  235. end
  236. function DelayBeforeWaypoints17(NPC, Spawn)
  237. AddTimer(NPC, MakeRandomInt(3000,10000), "waypoints17")
  238. end
  239. function waypoints17(NPC, Spawn)
  240. -- 594.5 -21.44 -257.44
  241. GuardKaladenthRound = 1
  242. MoveToLocation(NPC, 567.91, -20.16, -267.01, 2)
  243. MoveToLocation(NPC, 551.11, -20.07, -278.67, 2)
  244. MoveToLocation(NPC, 535.17, -20.19, -281.03, 2, "WalkTowardsTolar")
  245. end
  246. function WalkTowardsTolar(NPC)
  247. local Tolar = GetSpawn(NPC, 6600388)
  248. if GuardKaladenthRound == 1 or GuardKaladenthRound == 3 then
  249. if Tolar ~= nil then
  250. if GetSpawnLocationID(Tolar) == 133772661 then
  251. MoveToLocation(NPC, 520.53, -20.48, -284.46, 2)
  252. AddTimer(NPC, 6500, "FaceGuardTolar")
  253. else
  254. MoveToLocation(NPC, 519.5, -20.75, -289.63, 2)
  255. AddTimer(NPC, 8000, "FaceGuardTolar")
  256. end
  257. else
  258. MoveToLocation(NPC, 519.5, -20.75, -289.63, 2) -- If Tolar is not up
  259. end
  260. elseif GuardKaladenthRound == 2 or GuardKaladenthRound == 5 then
  261. if Tolar ~= nil then
  262. if GetSpawnLocationID(Tolar) == 133772661 then
  263. MoveToLocation(NPC, 520.13, -20.69, -288.13, 2)
  264. AddTimer(NPC, 7000, "FaceGuardTolar")
  265. else
  266. MoveToLocation(NPC, 519.79, -20.81, -293.74, 2)
  267. AddTimer(NPC, 4000, "FaceGuardTolar")
  268. end
  269. else
  270. MoveToLocation(NPC, 519.79, -20.81, -293.74, 2) -- If Tolar is not up
  271. end
  272. elseif GuardKaladenthRound == 4 then
  273. if Tolar ~= nil then
  274. if GetSpawnLocationID(Tolar) == 133772661 then
  275. MoveToLocation(NPC, 520.13, -20.69, -288.13, 2)
  276. AddTimer(NPC, 7000, "FaceGuardTolar")
  277. else
  278. MoveToLocation(NPC, 519.79, -20.81, -293.74, 2)
  279. AddTimer(NPC, 6000, "FaceGuardTolar")
  280. end
  281. else
  282. MoveToLocation(NPC, 519.79, -20.81, -293.74, 2) -- If Tolar is not up
  283. end
  284. end
  285. end
  286. function FaceGuardTolar(NPC)
  287. local Tolar = GetSpawn(NPC, 6600388)
  288. if Tolar ~= nil then
  289. FaceTarget(NPC, Tolar)
  290. AddTimer(NPC, 2000, "SaluteGuardTolar")
  291. end
  292. end
  293. function SaluteGuardTolar(NPC)
  294. local Tolar = GetSpawn(NPC, 6600388)
  295. if Tolar ~= nil then
  296. PlayAnimation(NPC, 12167)
  297. AddTimer(NPC, 1000, "TolarFacesGuardKaladenth")
  298. end
  299. end
  300. function TolarFacesGuardKaladenth(NPC)
  301. local Tolar = GetSpawn(NPC, 6600388)
  302. if Tolar ~= nil then
  303. FaceTarget(Tolar, NPC)
  304. AddTimer(NPC, 500, "TolarSalutesGuardKaladenth")
  305. end
  306. end
  307. function TolarSalutesGuardKaladenth(NPC)
  308. local Tolar = GetSpawn(NPC, 6600388)
  309. if Tolar ~= nil then
  310. PlayAnimation(Tolar, 12167)
  311. end
  312. if GuardKaladenthRound == 1 then
  313. AddTimer(NPC, MakeRandomInt(2000,7000), "waypoints02")
  314. elseif GuardKaladenthRound == 2 then
  315. AddTimer(NPC, MakeRandomInt(2000,7000), "waypoints06")
  316. elseif GuardKaladenthRound == 3 then
  317. AddTimer(NPC, MakeRandomInt(2000,7000), "waypoints08")
  318. elseif GuardKaladenthRound == 4 then
  319. AddTimer(NPC, MakeRandomInt(2000,7000), "waypoints12")
  320. else
  321. AddTimer(NPC, MakeRandomInt(2000,7000), "waypoints15")
  322. end
  323. end