Talliak.lua 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/Talliak.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.19 11:06:17
  5. Script Purpose :
  6. :
  7. --]]
  8. local AttackTimer = false
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC,3, "InRange", "LeaveRange")
  12. end
  13. function hailed(NPC, Spawn)
  14. if AttackTimer == false then
  15. AttackTimer = true
  16. FaceTarget(NPC,Spawn)
  17. PlayFlavor(NPC, "", "", "attack", 0, 0)
  18. AddTimer(NPC,10000,"AttackTimerReset")
  19. end
  20. end
  21. function InRange(NPC,Spawn)
  22. if AttackTimer == false then
  23. if math.random(1,100) <=20 then
  24. AttackTimer = true
  25. FaceTarget(NPC,Spawn)
  26. PlayFlavor(NPC, "", "", "attack", 0, 0)
  27. AddTimer(NPC,25000,"AttackTimerReset")
  28. end
  29. end
  30. end
  31. function Sleep(NPC)
  32. local choice = math.random(1,2)
  33. if choice == 1 then
  34. SpawnSet(NPC, "action_state", 540)
  35. AddTimer(NPC, 22000, "Wake")
  36. AttackTimer = true
  37. elseif choice ==2 then
  38. end
  39. end
  40. function Wake(NPC)
  41. SpawnSet(NPC, "action_state", 0)
  42. AttackTimer = false
  43. end
  44. function AttackTimerReset(NPC,Spawn)
  45. AttackTimer = false
  46. end
  47. function respawn(NPC)
  48. spawn(NPC)
  49. end
  50. function spawn(NPC)
  51. waypoints(NPC)
  52. end
  53. function hailed(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. end
  56. function respawn(NPC)
  57. spawn(NPC)
  58. end
  59. function waypoints(NPC)
  60. MovementLoopAddLocation(NPC, 678.78, -24.63, 353.04, 1, 2)
  61. MovementLoopAddLocation(NPC, 678.78, -24.63, 353.04, 1, 25,"Sleep")
  62. MovementLoopAddLocation(NPC, 666.66, -24.76, 347.3, 1, 15)
  63. MovementLoopAddLocation(NPC, 668.49, -24.19, 344.69, 1, 0)
  64. MovementLoopAddLocation(NPC, 668.39, -23.53, 342.42, 1, 0)
  65. MovementLoopAddLocation(NPC, 657.13, -22.38, 334.51, 1, 0)
  66. MovementLoopAddLocation(NPC, 654.92, -22.34, 333.42, 1, 15)
  67. MovementLoopAddLocation(NPC, 658.29, -22.25, 324.47, 1, 0)
  68. MovementLoopAddLocation(NPC, 656.19, -22.25, 321.86, 1, 2)
  69. MovementLoopAddLocation(NPC, 656.19, -22.25, 321.86, 1, 25,"Sleep")
  70. MovementLoopAddLocation(NPC, 658.02, -22.26, 325.11, 1, 0)
  71. MovementLoopAddLocation(NPC, 657.79, -22.26, 325.77, 1, 0)
  72. MovementLoopAddLocation(NPC, 649.37, -22.32, 333.87, 1, 0)
  73. MovementLoopAddLocation(NPC, 638.36, -22.33, 349.1, 1, 0)
  74. MovementLoopAddLocation(NPC, 639.09, -22.38, 353.51, 1, 2)
  75. MovementLoopAddLocation(NPC, 634.38, -22.43, 362.08, 1, 0)
  76. MovementLoopAddLocation(NPC, 634.55, -22.31, 370.15, 1, 0)
  77. MovementLoopAddLocation(NPC, 633.25, -22.35, 370.49, 1, 0)
  78. MovementLoopAddLocation(NPC, 625.99, -25.01, 369.51, 1, 0)
  79. MovementLoopAddLocation(NPC, 619.12, -25.85, 370.89, 1, 0)
  80. MovementLoopAddLocation(NPC, 616.52, -26.01, 368.42, 1, 0)
  81. MovementLoopAddLocation(NPC, 612.58, -26.08, 365.53, 1, 15)
  82. MovementLoopAddLocation(NPC, 619.57, -25.52, 366.73, 1, 1)
  83. MovementLoopAddLocation(NPC, 619.57, -25.52, 366.73, 1, 25,"Sleep")
  84. MovementLoopAddLocation(NPC, 621.29, -25.41, 367.24, 1, 0)
  85. MovementLoopAddLocation(NPC, 621.67, -25.46, 368.99, 1, 0)
  86. MovementLoopAddLocation(NPC, 619.61, -25.82, 371.46, 1, 0)
  87. MovementLoopAddLocation(NPC, 612.44, -26.39, 373.62, 1, 0)
  88. MovementLoopAddLocation(NPC, 610, -25.64, 369.86, 1, 0)
  89. MovementLoopAddLocation(NPC, 608.25, -24.39, 367.18, 1, 0)
  90. MovementLoopAddLocation(NPC, 607.55, -23.61, 365.54, 1, 0)
  91. MovementLoopAddLocation(NPC, 606.89, -22.19, 362.37, 1, 0)
  92. MovementLoopAddLocation(NPC, 606.77, -20.8, 358.07, 1, 0)
  93. MovementLoopAddLocation(NPC, 607.97, -20.66, 353.75, 1, 1)
  94. MovementLoopAddLocation(NPC, 607.97, -20.66, 353.75, 1, 25,"Sleep")
  95. MovementLoopAddLocation(NPC, 605.22, -20.55, 350.09, 1, 0)
  96. MovementLoopAddLocation(NPC, 610.51, -20.51, 334.1, 1, 0)
  97. MovementLoopAddLocation(NPC, 605, -20.39, 325.97, 1, 15)
  98. MovementLoopAddLocation(NPC, 609.42, -20.5, 323.84, 1, 0)
  99. MovementLoopAddLocation(NPC, 616.87, -20.54, 317.4, 1, 0)
  100. MovementLoopAddLocation(NPC, 632.11, -20.73, 305.72, 1, 0)
  101. MovementLoopAddLocation(NPC, 634.76, -20.64, 302.47, 1, 0)
  102. MovementLoopAddLocation(NPC, 647.18, -20.4, 293.54, 1, 1)
  103. MovementLoopAddLocation(NPC, 647.18, -20.4, 293.54, 1, 25,"Sleep")
  104. MovementLoopAddLocation(NPC, 647.49, -20.44, 294.51, 1, 0)
  105. MovementLoopAddLocation(NPC, 649.16, -20.44, 297.4, 1, 0)
  106. MovementLoopAddLocation(NPC, 654.59, -20.42, 300.15, 1, 0)
  107. MovementLoopAddLocation(NPC, 656.18, -20.42, 302.71, 1, 0)
  108. MovementLoopAddLocation(NPC, 662.27, -20.44, 318.63, 1, 1)
  109. MovementLoopAddLocation(NPC, 662.27, -20.44, 318.63, 1, 25,"Sleep")
  110. MovementLoopAddLocation(NPC, 664.71, -20.44, 319.95, 1, 0)
  111. MovementLoopAddLocation(NPC, 665.52, -20.44, 323.04, 1, 0)
  112. MovementLoopAddLocation(NPC, 665.3, -20.44, 325.1, 1, 0)
  113. MovementLoopAddLocation(NPC, 661.1, -21.27, 327.73, 1, 0)
  114. MovementLoopAddLocation(NPC, 658.4, -22.28, 328.12, 1, 0)
  115. MovementLoopAddLocation(NPC, 658.55, -22.35, 332.92, 1, 0)
  116. MovementLoopAddLocation(NPC, 661.48, -22.52, 337.13, 1, 0)
  117. MovementLoopAddLocation(NPC, 663.62, -22.65, 339.54, 1, 0)
  118. MovementLoopAddLocation(NPC, 667.69, -23.71, 343.16, 1, 0)
  119. MovementLoopAddLocation(NPC, 666.64, -24.67, 345.78, 1, 0)
  120. MovementLoopAddLocation(NPC, 664.43, -24.83, 350.49, 1, 15)
  121. MovementLoopAddLocation(NPC, 665.01, -24.83, 351.76, 1, 0)
  122. MovementLoopAddLocation(NPC, 667.05, -24.82, 352.25, 1, 0)
  123. MovementLoopAddLocation(NPC, 681.81, -24.81, 359.22, 1, 1)
  124. MovementLoopAddLocation(NPC, 681.81, -24.81, 359.22, 1, 25,"Sleep")
  125. MovementLoopAddLocation(NPC, 679.13, -24.74, 356.64, 1, 0)
  126. MovementLoopAddLocation(NPC, 681.81, -24.81, 359.22, 1, 1)
  127. MovementLoopAddLocation(NPC, 681.81, -24.81, 359.22, 1, 25,"Sleep")
  128. MovementLoopAddLocation(NPC, 667.05, -24.82, 352.25, 1, 0)
  129. MovementLoopAddLocation(NPC, 665.01, -24.83, 351.76, 1, 0)
  130. MovementLoopAddLocation(NPC, 664.43, -24.83, 350.49, 1, 15)
  131. MovementLoopAddLocation(NPC, 666.64, -24.67, 345.78, 1, 0)
  132. MovementLoopAddLocation(NPC, 667.69, -23.71, 343.16, 1, 0)
  133. MovementLoopAddLocation(NPC, 663.62, -22.65, 339.54, 1, 0)
  134. MovementLoopAddLocation(NPC, 661.48, -22.52, 337.13, 1, 0)
  135. MovementLoopAddLocation(NPC, 658.55, -22.35, 332.92, 1, 0)
  136. MovementLoopAddLocation(NPC, 658.4, -22.28, 328.12, 1, 0)
  137. MovementLoopAddLocation(NPC, 661.1, -21.27, 327.73, 1, 0)
  138. MovementLoopAddLocation(NPC, 665.3, -20.44, 325.1, 1, 0)
  139. MovementLoopAddLocation(NPC, 665.52, -20.44, 323.04, 1, 0)
  140. MovementLoopAddLocation(NPC, 664.71, -20.44, 319.95, 1, 0)
  141. MovementLoopAddLocation(NPC, 662.27, -20.44, 318.63, 1, 1)
  142. MovementLoopAddLocation(NPC, 662.27, -20.44, 318.63, 1, 25,"Sleep")
  143. MovementLoopAddLocation(NPC, 656.18, -20.42, 302.71, 1, 0)
  144. MovementLoopAddLocation(NPC, 654.59, -20.42, 300.15, 1, 0)
  145. MovementLoopAddLocation(NPC, 649.16, -20.44, 297.4, 1, 0)
  146. MovementLoopAddLocation(NPC, 647.49, -20.44, 294.51, 1, 0)
  147. MovementLoopAddLocation(NPC, 647.18, -20.4, 293.54, 1, 1)
  148. MovementLoopAddLocation(NPC, 647.18, -20.4, 293.54, 1, 25,"Sleep")
  149. MovementLoopAddLocation(NPC, 634.76, -20.64, 302.47, 1, 0)
  150. MovementLoopAddLocation(NPC, 632.11, -20.73, 305.72, 1, 0)
  151. MovementLoopAddLocation(NPC, 616.87, -20.54, 317.4, 1, 0)
  152. MovementLoopAddLocation(NPC, 609.42, -20.5, 323.84, 1, 0)
  153. MovementLoopAddLocation(NPC, 605, -20.39, 325.97, 1, 15)
  154. MovementLoopAddLocation(NPC, 610.51, -20.51, 334.1, 1, 0)
  155. MovementLoopAddLocation(NPC, 605.22, -20.55, 350.09, 1, 0)
  156. MovementLoopAddLocation(NPC, 607.97, -20.66, 353.75, 1, 25,"Sleep")
  157. MovementLoopAddLocation(NPC, 606.77, -20.8, 358.07, 1, 0)
  158. MovementLoopAddLocation(NPC, 606.89, -22.19, 362.37, 1, 0)
  159. MovementLoopAddLocation(NPC, 607.55, -23.61, 365.54, 1, 0)
  160. MovementLoopAddLocation(NPC, 608.25, -24.39, 367.18, 1, 0)
  161. MovementLoopAddLocation(NPC, 610, -25.64, 369.86, 1, 0)
  162. MovementLoopAddLocation(NPC, 612.44, -26.39, 373.62, 1, 0)
  163. MovementLoopAddLocation(NPC, 619.61, -25.82, 371.46, 1, 0)
  164. MovementLoopAddLocation(NPC, 621.67, -25.46, 368.99, 1, 0)
  165. MovementLoopAddLocation(NPC, 621.29, -25.41, 367.24, 1, 0)
  166. MovementLoopAddLocation(NPC, 619.57, -25.52, 366.73, 1, 1)
  167. MovementLoopAddLocation(NPC, 619.57, -25.52, 366.73, 1, 25,"Sleep")
  168. MovementLoopAddLocation(NPC, 612.58, -26.08, 365.53, 1, 15)
  169. MovementLoopAddLocation(NPC, 616.52, -26.01, 368.42, 1, 0)
  170. MovementLoopAddLocation(NPC, 619.12, -25.85, 370.89, 1, 0)
  171. MovementLoopAddLocation(NPC, 625.99, -25.01, 369.51, 1, 0)
  172. MovementLoopAddLocation(NPC, 633.25, -22.35, 370.49, 1, 0)
  173. MovementLoopAddLocation(NPC, 634.55, -22.31, 370.15, 1, 0)
  174. MovementLoopAddLocation(NPC, 634.38, -22.43, 362.08, 1, 0)
  175. MovementLoopAddLocation(NPC, 639.09, -22.38, 353.51, 1, 0)
  176. MovementLoopAddLocation(NPC, 638.36, -22.33, 349.1, 1, 0)
  177. MovementLoopAddLocation(NPC, 649.37, -22.32, 333.87, 1, 0)
  178. MovementLoopAddLocation(NPC, 657.79, -22.26, 325.77, 1, 0)
  179. MovementLoopAddLocation(NPC, 658.02, -22.26, 325.11, 1, 0)
  180. MovementLoopAddLocation(NPC, 656.19, -22.25, 321.86, 1, 1)
  181. MovementLoopAddLocation(NPC, 656.19, -22.25, 321.86, 1, 25,"Sleep")
  182. MovementLoopAddLocation(NPC, 658.29, -22.25, 324.47, 1, 0)
  183. MovementLoopAddLocation(NPC, 654.92, -22.34, 333.42, 1, 15)
  184. MovementLoopAddLocation(NPC, 657.13, -22.38, 334.51, 1, 0)
  185. MovementLoopAddLocation(NPC, 668.39, -23.53, 342.42, 1, 0)
  186. MovementLoopAddLocation(NPC, 668.49, -24.19, 344.69, 1, 0)
  187. MovementLoopAddLocation(NPC, 666.66, -24.76, 347.3, 1, 15)
  188. MovementLoopAddLocation(NPC, 678.78, -24.63, 353.04, 1, 1)
  189. MovementLoopAddLocation(NPC, 678.78, -24.63, 353.04, 1, 25,"Sleep")
  190. end