9
3

aSabertoothangler.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --[[
  2. Script Name : SpawnScripts/Blackburrow/aSabertoothangler.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.07.11 06:07:42
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. VoiceBox(NPC)
  10. ChooseMovement(NPC)
  11. end
  12. function VoiceBox(NPC)
  13. local choice = MakeRandomInt(1,2)
  14. if choice == 1 then
  15. dofile("SpawnScripts/Generic/MonsterCallouts/BaseGnoll1.lua")
  16. elseif choice == 2 then
  17. dofile("SpawnScripts/Generic/MonsterCallouts/SabertoothGnoll1.lua")
  18. end
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function ChooseMovement(NPC)
  27. local route = math.random(1,4)
  28. if route == 1 then
  29. RouteOne(NPC, Spawn)
  30. elseif route == 2 then
  31. RouteTwo(NPC, Spawn)
  32. elseif route == 3 then
  33. RouteThree(NPC, Spawn)
  34. elseif route == 4 then
  35. RouteFour(NPC, Spawn)
  36. end
  37. end
  38. function RouteOne(NPC, Spawn)
  39. local X = GetX(NPC)
  40. local Y = GetY(NPC)
  41. local Z = GetZ(NPC)
  42. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  43. MovementLoopAddLocation(NPC, X + 2, Y, Z - 1, 2,math.random(5,10))
  44. MovementLoopAddLocation(NPC, X + 2, Y, Z + 2, 2, math.random(5,10))
  45. MovementLoopAddLocation(NPC, X + 2, Y, Z - 2, 2, math.random(5,10))
  46. MovementLoopAddLocation(NPC, X + 2, Y, Z + 2, 2, math.random(5,10))
  47. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement")
  48. end
  49. function RouteTwo(NPC, Spawn)
  50. local X = GetX(NPC)
  51. local Y = GetY(NPC)
  52. local Z = GetZ(NPC)
  53. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  54. MovementLoopAddLocation(NPC, X - 2, Y, Z + 2, 2, math.random(5,10))
  55. MovementLoopAddLocation(NPC, X - 2, Y, Z - 2, 2, math.random(5,10))
  56. MovementLoopAddLocation(NPC, X - 2, Y, Z + 1, 2, math.random(5,10))
  57. MovementLoopAddLocation(NPC, X - 2, Y, Z - 2, 2, math.random(5,10))
  58. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement")
  59. end
  60. function RouteThree(NPC, Spawn)
  61. local X = GetX(NPC)
  62. local Y = GetY(NPC)
  63. local Z = GetZ(NPC)
  64. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  65. MovementLoopAddLocation(NPC, X + 2, Y, Z + 2, 2, math.random(5,10))
  66. MovementLoopAddLocation(NPC, X + 2, Y, Z - 2, 2, math.random(5,10))
  67. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, math.random(5,10))
  68. MovementLoopAddLocation(NPC, X + 2, Y, Z - 2, 2, math.random(5,10))
  69. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement")
  70. end
  71. function RouteFour(NPC, Spawn)
  72. local X = GetX(NPC)
  73. local Y = GetY(NPC)
  74. local Z = GetZ(NPC)
  75. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  76. MovementLoopAddLocation(NPC, X - 2, Y, Z - 2, 2, math.random(5,10))
  77. MovementLoopAddLocation(NPC, X - 2, Y, Z + 2, 2, math.random(5,10))
  78. MovementLoopAddLocation(NPC, X - 2, Y, Z + 1, 2, math.random(5,10))
  79. MovementLoopAddLocation(NPC, X - 2, Y, Z + 2, 2, math.random(5,10))
  80. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement")
  81. end
  82. function respawn(NPC, Spawn)
  83. spawn(NPC)
  84. end
  85. function hailed(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. end