9
3

CrazyLowin.lua 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. --[[
  2. Script Name : SpawnScripts/QeynosHarbor/CrazyLowin.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.14 01:06:35
  5. Script Purpose :
  6. :
  7. --]]
  8. local AttackTimer = false -- determines if the cat will hiss at players. Disabled when 'sleeping'.
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC,Spawn)
  20. if AttackTimer == false then
  21. if math.random(1,100) <=33 then
  22. AttackTimer = true
  23. FaceTarget(NPC,Spawn)
  24. PlayFlavor(NPC, "", "", "attack", 0, 0)
  25. AddTimer(NPC,25000,"AttackTimerReset")
  26. end
  27. end
  28. end
  29. function AttackTimerReset(NPC,Spawn)
  30. AttackTimer = false
  31. end
  32. function Sleep(NPC)
  33. local choice = math.random(1,2)
  34. if choice == 1 then
  35. AttackTimer = true
  36. SpawnSet(NPC, "action_state", 540)
  37. AddTimer(NPC, 22000, "Wake")
  38. elseif choice ==2 then
  39. end
  40. end
  41. function Wake(NPC)
  42. SpawnSet(NPC, "action_state", 0)
  43. AttackTimer = false
  44. end
  45. function waypoints(NPC)
  46. MovementLoopAddLocation(NPC, 768.72, -20.77, -17.33, 6, 0)
  47. MovementLoopAddLocation(NPC, 769.75, -20.64, -26, 6, 0)
  48. MovementLoopAddLocation(NPC, 769.17, -20.64, -27.71, 1, 1)
  49. MovementLoopAddLocation(NPC, 769.17, -20.64, -27.71, 1, 25,"Sleep")
  50. MovementLoopAddLocation(NPC, 767.71, -20.65, -29.44, 6, 0)
  51. MovementLoopAddLocation(NPC, 767.89, -20.67, -33.84, 6, 0)
  52. MovementLoopAddLocation(NPC, 765.47, -21.69, -49.18, 6, 0)
  53. MovementLoopAddLocation(NPC, 746.25, -21.39, -44.55, 1, 0)
  54. MovementLoopAddLocation(NPC, 735.85, -21.03, -38.8, 1, 1)
  55. MovementLoopAddLocation(NPC, 735.85, -21.03, -38.8, 1, 25,"Sleep")
  56. MovementLoopAddLocation(NPC, 735.81, -21.03, -37.42, 6, 0)
  57. MovementLoopAddLocation(NPC, 736.11, -21.03, -34.15, 6, 0)
  58. MovementLoopAddLocation(NPC, 729.42, -20.69, -7.85, 1, 1)
  59. MovementLoopAddLocation(NPC, 729.42, -20.69, -7.85, 1, 25,"Sleep")
  60. MovementLoopAddLocation(NPC, 730.78, -20.73, -8.08, 1, 0)
  61. MovementLoopAddLocation(NPC, 731.43, -20.76, -8.89, 1, 1)
  62. MovementLoopAddLocation(NPC, 731.43, -20.76, -8.89, 1, 25,"Sleep")
  63. MovementLoopAddLocation(NPC, 720.13, -21.39, -57.94, 6, 0)
  64. MovementLoopAddLocation(NPC, 731.88, -20.73, -74.1, 6, 0)
  65. MovementLoopAddLocation(NPC, 736.91, -20.55, -77.99, 1, 1)
  66. MovementLoopAddLocation(NPC, 736.91, -20.55, -77.99, 6, 25,"Sleep")
  67. MovementLoopAddLocation(NPC, 742.52, -20.63, -75.22, 6, 0)
  68. MovementLoopAddLocation(NPC, 744.38, -20.68, -72, 6, 0)
  69. MovementLoopAddLocation(NPC, 745.18, -20.75, -71.25, 1, 1)
  70. MovementLoopAddLocation(NPC, 745.18, -20.75, -71.25, 6, 25,"Sleep")
  71. MovementLoopAddLocation(NPC, 742.46, -20.76, -69.5, 6, 0)
  72. MovementLoopAddLocation(NPC, 740.99, -20.8, -68.56, 6, 0)
  73. MovementLoopAddLocation(NPC, 740.2, -20.94, -66.48, 6, 0)
  74. MovementLoopAddLocation(NPC, 747.32, -21.23, -63.23, 6, 0)
  75. MovementLoopAddLocation(NPC, 751.5, -21.37, -61.53, 6, 0)
  76. MovementLoopAddLocation(NPC, 771.71, -20.85, -68.63, 6, 0)
  77. MovementLoopAddLocation(NPC, 784.02, -20.94, -68.67, 6, 0)
  78. MovementLoopAddLocation(NPC, 796.38, -20.97, -52.36, 1, 1)
  79. MovementLoopAddLocation(NPC, 796.38, -20.97, -52.36, 6, 25,"Sleep")
  80. MovementLoopAddLocation(NPC, 798.06, -20.87, -51.75, 6, 0)
  81. MovementLoopAddLocation(NPC, 802.57, -20.67, -51.79, 1, 1)
  82. MovementLoopAddLocation(NPC, 802.57, -20.67, -51.79, 6, 25,"Sleep")
  83. MovementLoopAddLocation(NPC, 794.91, -21.02, -53.08, 6, 0)
  84. MovementLoopAddLocation(NPC, 788.62, -21.08, -50.16, 6, 0)
  85. MovementLoopAddLocation(NPC, 779.91, -20.64, -32.93, 6, 0)
  86. MovementLoopAddLocation(NPC, 775.87, -20.64, -21.91, 6, 0)
  87. MovementLoopAddLocation(NPC, 774.08, -20.64, -12.1, 6, 0)
  88. MovementLoopAddLocation(NPC, 763.49, -20.64, 3.24, 6, 0)
  89. MovementLoopAddLocation(NPC, 739.63, -20.64, 5.96, 1, 1)
  90. MovementLoopAddLocation(NPC, 739.63, -20.64, 5.96, 1, 25,"Sleep")
  91. MovementLoopAddLocation(NPC, 749.84, -21.05, 2.7, 1, 0)
  92. MovementLoopAddLocation(NPC, 758.63, -20.64, 9.31, 1, 0)
  93. MovementLoopAddLocation(NPC, 773.15, -20.64, 18.16, 1, 1)
  94. MovementLoopAddLocation(NPC, 773.15, -20.64, 18.16, 6, 25,"Sleep")
  95. MovementLoopAddLocation(NPC, 768.91, -20.64, 11.09, 6, 0)
  96. MovementLoopAddLocation(NPC, 756.84, -21.05, -4.27, 6, 0)
  97. MovementLoopAddLocation(NPC, 753.71, -20.98, -20.34, 6, 0)
  98. MovementLoopAddLocation(NPC, 741.3, -21.03, -33.64, 1, 1)
  99. MovementLoopAddLocation(NPC, 741.3, -21.03, -33.64, 6, 25,"Sleep")
  100. MovementLoopAddLocation(NPC, 736.76, -21.03, -33.64, 1, 0)
  101. MovementLoopAddLocation(NPC, 694.74, -20.54, -35.94, 1, 1)
  102. MovementLoopAddLocation(NPC, 694.74, -20.54, -35.94, 6, 25,"Sleep")
  103. MovementLoopAddLocation(NPC, 692.35, -20.74, -35.06, 6, 0)
  104. MovementLoopAddLocation(NPC, 692.35, -20.74, -31.46, 6, 0)
  105. MovementLoopAddLocation(NPC, 698.49, -20.35, -7.63, 6, 0)
  106. MovementLoopAddLocation(NPC, 706.17, -20.02, 0.76, 6, 0)
  107. MovementLoopAddLocation(NPC, 732.19, -19.83, 1.49, 6, 0)
  108. MovementLoopAddLocation(NPC, 741.59, -20.99, -3.8, 1, 1)
  109. MovementLoopAddLocation(NPC, 741.59, -20.99, -3.8, 1, 25,"Sleep")
  110. MovementLoopAddLocation(NPC, 732.19, -19.83, 1.49, 6, 0)
  111. MovementLoopAddLocation(NPC, 706.17, -20.02, 0.76, 6, 0)
  112. MovementLoopAddLocation(NPC, 698.49, -20.35, -7.63, 6, 0)
  113. MovementLoopAddLocation(NPC, 692.35, -20.74, -31.46, 6, 0)
  114. MovementLoopAddLocation(NPC, 692.35, -20.74, -35.06, 6, 0)
  115. MovementLoopAddLocation(NPC, 694.74, -20.54, -35.94, 1, 1)
  116. MovementLoopAddLocation(NPC, 694.74, -20.54, -35.94, 6, 25,"Sleep")
  117. MovementLoopAddLocation(NPC, 736.76, -21.03, -33.64, 6, 0)
  118. MovementLoopAddLocation(NPC, 741.3, -21.03, -33.64, 1, 1)
  119. MovementLoopAddLocation(NPC, 741.3, -21.03, -33.64, 6, 25,"Sleep")
  120. MovementLoopAddLocation(NPC, 753.71, -20.98, -20.34, 6, 0)
  121. MovementLoopAddLocation(NPC, 756.84, -21.05, -4.27, 6, 0)
  122. MovementLoopAddLocation(NPC, 768.91, -20.64, 11.09, 6, 0)
  123. MovementLoopAddLocation(NPC, 773.15, -20.64, 18.16, 1, 1)
  124. MovementLoopAddLocation(NPC, 773.15, -20.64, 18.16, 6, 25,"Sleep")
  125. MovementLoopAddLocation(NPC, 758.63, -20.64, 9.31, 6, 0)
  126. MovementLoopAddLocation(NPC, 749.84, -21.05, 2.7, 6, 0)
  127. MovementLoopAddLocation(NPC, 739.63, -20.64, 5.96, 1, 1)
  128. MovementLoopAddLocation(NPC, 739.63, -20.64, 5.96, 6, 25,"Sleep")
  129. MovementLoopAddLocation(NPC, 763.49, -20.64, 3.24, 6, 0)
  130. MovementLoopAddLocation(NPC, 774.08, -20.64, -12.1, 6, 0)
  131. MovementLoopAddLocation(NPC, 775.87, -20.64, -21.91, 6, 0)
  132. MovementLoopAddLocation(NPC, 779.91, -20.64, -32.93, 6, 0)
  133. MovementLoopAddLocation(NPC, 788.62, -21.08, -50.16, 6, 0)
  134. MovementLoopAddLocation(NPC, 794.91, -21.02, -53.08, 6, 0)
  135. MovementLoopAddLocation(NPC, 802.57, -20.67, -51.79, 1, 1)
  136. MovementLoopAddLocation(NPC, 802.57, -20.67, -51.79, 6, 25,"Sleep")
  137. MovementLoopAddLocation(NPC, 798.06, -20.87, -51.75, 6, 0)
  138. MovementLoopAddLocation(NPC, 796.38, -20.97, -52.36, 1, 1)
  139. MovementLoopAddLocation(NPC, 796.38, -20.97, -52.36, 6, 25,"Sleep")
  140. MovementLoopAddLocation(NPC, 784.02, -20.94, -68.67, 6, 0)
  141. MovementLoopAddLocation(NPC, 771.71, -20.85, -68.63, 6, 0)
  142. MovementLoopAddLocation(NPC, 751.5, -21.37, -61.53, 6, 0)
  143. MovementLoopAddLocation(NPC, 747.32, -21.23, -63.23, 6, 0)
  144. MovementLoopAddLocation(NPC, 740.2, -20.94, -66.48, 6, 0)
  145. MovementLoopAddLocation(NPC, 740.99, -20.8, -68.56, 6, 0)
  146. MovementLoopAddLocation(NPC, 742.46, -20.76, -69.5, 6, 0)
  147. MovementLoopAddLocation(NPC, 745.18, -20.75, -71.25, 1, 1)
  148. MovementLoopAddLocation(NPC, 745.18, -20.75, -71.25, 6, 25,"Sleep")
  149. MovementLoopAddLocation(NPC, 744.38, -20.68, -72, 6, 0)
  150. MovementLoopAddLocation(NPC, 742.52, -20.63, -75.22, 6, 0)
  151. MovementLoopAddLocation(NPC, 736.91, -20.55, -77.99, 1, 1)
  152. MovementLoopAddLocation(NPC, 736.91, -20.55, -77.99, 6, 25,"Sleep")
  153. MovementLoopAddLocation(NPC, 731.88, -20.73, -74.1, 6, 0)
  154. MovementLoopAddLocation(NPC, 720.13, -21.39, -57.94, 6, 0)
  155. MovementLoopAddLocation(NPC, 731.43, -20.76, -8.89, 1, 1)
  156. MovementLoopAddLocation(NPC, 731.43, -20.76, -8.89, 6, 25,"Sleep")
  157. MovementLoopAddLocation(NPC, 730.78, -20.73, -8.08, 6, 0)
  158. MovementLoopAddLocation(NPC, 729.42, -20.69, -7.85, 1, 1)
  159. MovementLoopAddLocation(NPC, 729.42, -20.69, -7.85, 6, 25,"Sleep")
  160. MovementLoopAddLocation(NPC, 736.11, -21.03, -34.15, 6, 0)
  161. MovementLoopAddLocation(NPC, 735.81, -21.03, -37.42, 6, 0)
  162. MovementLoopAddLocation(NPC, 735.85, -21.03, -38.8, 1, 1)
  163. MovementLoopAddLocation(NPC, 735.85, -21.03, -38.8, 6, 25,"Sleep")
  164. MovementLoopAddLocation(NPC, 746.25, -21.39, -44.55, 6, 0)
  165. MovementLoopAddLocation(NPC, 765.47, -21.69, -49.18, 6, 0)
  166. MovementLoopAddLocation(NPC, 767.89, -20.67, -33.84, 6, 0)
  167. MovementLoopAddLocation(NPC, 767.71, -20.65, -29.44, 6, 0)
  168. MovementLoopAddLocation(NPC, 769.17, -20.64, -27.71, 1, 1)
  169. MovementLoopAddLocation(NPC, 769.17, -20.64, -27.71, 6, 25,"Sleep")
  170. MovementLoopAddLocation(NPC, 769.75, -20.64, -26, 6, 0)
  171. MovementLoopAddLocation(NPC, 768.72, -20.77, -17.33, 6, 0)
  172. end