9
3

grittlebone.lua 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. --[[
  2. Script Name : Grittlebone.lua
  3. Script Purpose : Waypoint Path for Grittlebone.lua
  4. Script Author : Devn00b
  5. Script Date : 04/09/2020 02:20:34 AM
  6. Script Notes : Locations collected from Live
  7. --]]
  8. function spawn(NPC)
  9. waypoints(NPC)
  10. SetPlayerProximityFunction(NPC, 4, "InRange", "LeaveRange")
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. if GetRace(Spawn)==11 then --KERRAN RESPONSE
  15. local choice = math.random(1, 2)
  16. if choice == 1 then
  17. PlayFlavor(NPC, "", "", "attack", 0, 0,Spawn)
  18. SendMessage(Spawn, "Grittlebone lunges at your tail threateningly.")
  19. elseif choice == 2 then
  20. SendMessage(Spawn, "Grittlebone growls at you menecingly.")
  21. end
  22. else --NORMAL RESPONSE
  23. --[[ local choice = math.random(1, 2)
  24. if choice == 1 then
  25. SendMessage(Spawn, "The dog cautiously eyes you.")
  26. elseif choice == 2 then
  27. SendMessage(Spawn, "The dog sniffs you curiously.")
  28. end]]--
  29. end
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end
  34. function InRange(NPC, Spawn) --FOLLOW TARGET SCRIPT IS TOO SLOW. DOG WALKS, BUT SPEED IS NOT ADJUSTABLE.
  35. if GetRace(Spawn)==11 or GetFactionAmount(Spawn,11)<-10000 then --KERRAN RESPONSE
  36. if AttackTimer == false then
  37. if FollowTimer == false then
  38. FollowTimer = true
  39. -- SetFollowTarget(NPC,Spawn)
  40. -- if not IsFollowing(NPC) then
  41. -- ToggleFollow(NPC)
  42. -- end
  43. -- SetTarget(NPC,Spawn)
  44. FaceTarget(NPC, Spawn)
  45. PlayFlavor(NPC, "", "", "attack", 0, 0)
  46. local choice = math.random(1, 2)
  47. if choice == 1 then
  48. SendMessage(Spawn, "Grittlebone and eyes you closely.")
  49. elseif choice == 2 then
  50. SendMessage(Spawn, "Grittlebone leers at you with a quivering jowl.")
  51. end
  52. -- AddTimer(NPC,10000,"ResetFollow")
  53. -- AddTimer(NPC,45000,"ResetFollowTimer")
  54. end
  55. end
  56. end
  57. end
  58. function Sleep(NPC)
  59. local choice = math.random(1,2)
  60. if choice == 1 then
  61. SpawnSet(NPC, "action_state", 540)
  62. AddTimer(NPC, 22000, "Wake")
  63. AttackTimer = true
  64. elseif choice ==2 then
  65. end
  66. end
  67. function Wake(NPC)
  68. SpawnSet(NPC, "action_state", 0)
  69. AttackTimer = false
  70. end
  71. function waypoints(NPC)
  72. MovementLoopAddLocation(NPC, 699.65, -21.07, -56.69, 2, math.random(25,36),"Sleep")
  73. MovementLoopAddLocation(NPC, 701.36, -20.64, -17.22, 2, 0)
  74. MovementLoopAddLocation(NPC, 742.06, -21.26, -16.11, 2, 0)
  75. MovementLoopAddLocation(NPC, 757.23, -21, -37.66, 2, 0)
  76. MovementLoopAddLocation(NPC, 802.09, -20.68, -57.13, 2, math.random(25,36),"Sleep")
  77. MovementLoopAddLocation(NPC, 805.38, -20.4, -57.77, 2, 0)
  78. MovementLoopAddLocation(NPC, 876.59, -25.47, -58, 2, 0)
  79. MovementLoopAddLocation(NPC, 884.84, -25.44, -52.25, 2, 0)
  80. MovementLoopAddLocation(NPC, 888.65, -25.42, -47.43, 2, 0)
  81. MovementLoopAddLocation(NPC, 896.08, -25.28, -26.62, 2, 0)
  82. MovementLoopAddLocation(NPC, 901.3, -25.43, -7.69, 2, 0)
  83. MovementLoopAddLocation(NPC, 909.2, -25.49, 17.07, 2, 0)
  84. MovementLoopAddLocation(NPC, 950.04, -25.5, 31.88, 2, 0)
  85. MovementLoopAddLocation(NPC, 954.98, -25.5, 24.78, 2, math.random(25,36),"Sleep")
  86. MovementLoopAddLocation(NPC, 967.68, -25.47, 12.97, 2, math.random(25,36),"Sleep")
  87. MovementLoopAddLocation(NPC, 955.83, -25.5, 24.5, 2, 0)
  88. MovementLoopAddLocation(NPC, 948, -25.5, 32.1, 2, 0)
  89. MovementLoopAddLocation(NPC, 921.54, -25.5, 24.57, 2, math.random(25,36),"Sleep")
  90. MovementLoopAddLocation(NPC, 867.38, -25.39, 54.18, 2, 0)
  91. MovementLoopAddLocation(NPC, 857.78, -25.42, 51.13, 2, math.random(25,36),"Sleep")
  92. MovementLoopAddLocation(NPC, 838.68, -25.47, 85.56, 2, 0)
  93. MovementLoopAddLocation(NPC, 837.52, -25.48, 94.61, 2, 0)
  94. MovementLoopAddLocation(NPC, 848.21, -25.5, 107.24, 2, math.random(25,36),"Sleep")
  95. MovementLoopAddLocation(NPC, 864.3, -25.57, 114.45, 2, math.random(25,36),"Sleep")
  96. MovementLoopAddLocation(NPC, 881.93, -25.5, 76.31, 2, 0)
  97. MovementLoopAddLocation(NPC, 889.81, -25.37, 45.9, 2, 0)
  98. MovementLoopAddLocation(NPC, 858.3, -25.37, 41.26, 2, 0)
  99. MovementLoopAddLocation(NPC, 833.96, -23.31, 46.12, 2, 0)
  100. MovementLoopAddLocation(NPC, 863.97, -25.37, 42.07, 2, 0)
  101. MovementLoopAddLocation(NPC, 864.56, -25.43, 27.31, 2, 0)
  102. MovementLoopAddLocation(NPC, 847.09, -25.46, 12.55, 2, 0)
  103. MovementLoopAddLocation(NPC, 864.56, -25.43, 27.31, 2, 0)
  104. MovementLoopAddLocation(NPC, 863.97, -25.37, 42.07, 2, 0)
  105. MovementLoopAddLocation(NPC, 833.96, -23.31, 46.12, 2, 4)
  106. MovementLoopAddLocation(NPC, 858.3, -25.37, 41.26, 2, 0)
  107. MovementLoopAddLocation(NPC, 889.81, -25.37, 45.9, 2, 0)
  108. MovementLoopAddLocation(NPC, 881.93, -25.5, 76.31, 2, 0)
  109. MovementLoopAddLocation(NPC, 864.3, -25.57, 114.45, 2, math.random(25,36),"Sleep")
  110. MovementLoopAddLocation(NPC, 848.21, -25.5, 107.24, 2, 0)
  111. MovementLoopAddLocation(NPC, 837.52, -25.48, 94.61, 2, 3)
  112. MovementLoopAddLocation(NPC, 838.68, -25.47, 85.56, 2, 0)
  113. MovementLoopAddLocation(NPC, 857.78, -25.42, 51.13, 2, math.random(25,36),"Sleep")
  114. MovementLoopAddLocation(NPC, 867.38, -25.39, 54.18, 2, 0)
  115. MovementLoopAddLocation(NPC, 921.54, -25.5, 24.57, 2, 0)
  116. MovementLoopAddLocation(NPC, 948, -25.5, 32.1, 2, 0)
  117. MovementLoopAddLocation(NPC, 955.83, -25.5, 24.5, 2, 0)
  118. MovementLoopAddLocation(NPC, 967.68, -25.47, 12.97, 2, math.random(25,36),"Sleep")
  119. MovementLoopAddLocation(NPC, 954.98, -25.5, 24.78, 2, 0)
  120. MovementLoopAddLocation(NPC, 950.04, -25.5, 31.88, 2, 0)
  121. MovementLoopAddLocation(NPC, 909.2, -25.49, 17.07, 2, 0)
  122. MovementLoopAddLocation(NPC, 901.3, -25.43, -7.69, 2, 0)
  123. MovementLoopAddLocation(NPC, 896.08, -25.28, -26.62, 2, 0)
  124. MovementLoopAddLocation(NPC, 888.65, -25.42, -47.43, 2, 0)
  125. MovementLoopAddLocation(NPC, 884.84, -25.44, -52.25, 2, 0)
  126. MovementLoopAddLocation(NPC, 876.59, -25.47, -58, 2, 0)
  127. MovementLoopAddLocation(NPC, 805.38, -20.4, -57.77, 2, 0)
  128. MovementLoopAddLocation(NPC, 802.09, -20.68, -57.13, 2, 0)
  129. MovementLoopAddLocation(NPC, 757.23, -21, -37.66, 2, 0)
  130. MovementLoopAddLocation(NPC, 742.06, -21.26, -16.11, 2, 0)
  131. MovementLoopAddLocation(NPC, 701.36, -20.64, -17.22, 2, 0)
  132. MovementLoopAddLocation(NPC, 699.65, -21.07, -56.69, 2, math.random(25,36),"Sleep")
  133. end