random_pattern_small_med_delay.lua 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : SpawnScripts/Generic/random_pattern_small_med_delay.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.09.02 06:09:29
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. ChooseMovement(NPC)
  12. end
  13. function ChooseMovement(NPC)
  14. local route = math.random(1,4)
  15. if route == 1 then
  16. RouteOne(NPC, Spawn)
  17. elseif route == 2 then
  18. RouteTwo(NPC, Spawn)
  19. elseif route == 3 then
  20. RouteThree(NPC, Spawn)
  21. elseif route == 4 then
  22. RouteFour(NPC, Spawn)
  23. end
  24. end
  25. function RouteOne(NPC, Spawn)
  26. local X = GetX(NPC)
  27. local Y = GetY(NPC)
  28. local Z = GetZ(NPC)
  29. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  30. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(7,15))
  31. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(7,15))
  32. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(7,15))
  33. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(7,15))
  34. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15), "ChooseMovement")
  35. end
  36. function RouteTwo(NPC, Spawn)
  37. local X = GetX(NPC)
  38. local Y = GetY(NPC)
  39. local Z = GetZ(NPC)
  40. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  41. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(7,15))
  42. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(7,15))
  43. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(7,15))
  44. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(7,15))
  45. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(7,15), "ChooseMovement")
  46. end
  47. function RouteThree(NPC, Spawn)
  48. local X = GetX(NPC)
  49. local Y = GetY(NPC)
  50. local Z = GetZ(NPC)
  51. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  52. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2,math.random(7,15))
  53. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(7,15))
  54. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(7,15))
  55. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(7,15))
  56. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15), "ChooseMovement")
  57. end
  58. function RouteFour(NPC, Spawn)
  59. local X = GetX(NPC)
  60. local Y = GetY(NPC)
  61. local Z = GetZ(NPC)
  62. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  63. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(7,15))
  64. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(7,15))
  65. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(7,15))
  66. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(7,15))
  67. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15), "ChooseMovement")
  68. end
  69. function respawn(NPC, Spawn)
  70. spawn(NPC)
  71. end
  72. function hailed(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. end