random_pattern_tiny_med_delay.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/Generic/random_pattern_tiny_med_delay.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.18 06:10:40
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. ChooseMovement(NPC)
  10. end
  11. function ChooseMovement(NPC)
  12. local route = math.random(1,4)
  13. if route == 1 then
  14. RouteOne(NPC, Spawn)
  15. elseif route == 2 then
  16. RouteTwo(NPC, Spawn)
  17. elseif route == 3 then
  18. RouteThree(NPC, Spawn)
  19. elseif route == 4 then
  20. RouteFour(NPC, Spawn)
  21. end
  22. end
  23. function RouteOne(NPC, Spawn)
  24. local X = GetX(NPC)
  25. local Y = GetY(NPC)
  26. local Z = GetZ(NPC)
  27. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  28. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  29. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, math.random(7,15))
  30. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, 0)
  31. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, math.random(7,15))
  32. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, 0)
  33. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, math.random(7,15))
  34. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, 0)
  35. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, math.random(7,15))
  36. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, 0)
  37. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  38. end
  39. function RouteTwo(NPC, Spawn)
  40. local X = GetX(NPC)
  41. local Y = GetY(NPC)
  42. local Z = GetZ(NPC)
  43. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  44. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  45. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, math.random(7,15))
  46. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, 0)
  47. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, math.random(7,15))
  48. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, 0)
  49. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, math.random(7,15))
  50. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, 0)
  51. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, math.random(7,15))
  52. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, 0)
  53. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(7,15))
  54. end
  55. function RouteThree(NPC, Spawn)
  56. local X = GetX(NPC)
  57. local Y = GetY(NPC)
  58. local Z = GetZ(NPC)
  59. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  60. MovementLoopAddLocation(NPC, X, Y, Z, 2,0)
  61. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, math.random(7,15))
  62. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, 0)
  63. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, math.random(7,15))
  64. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, 0)
  65. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, math.random(7,15))
  66. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, 0)
  67. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, math.random(7,15))
  68. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, 0)
  69. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  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(7,15))
  76. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  77. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, math.random(7,15))
  78. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, 0)
  79. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, math.random(7,15))
  80. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, 0)
  81. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, math.random(7,15))
  82. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, 0)
  83. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, math.random(7,15))
  84. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, 0)
  85. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  86. end
  87. math.random(10,15)
  88. function respawn(NPC, Spawn)
  89. spawn(NPC)
  90. end
  91. function hailed(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. end