aBaubbleshirerat.lua 2.6 KB

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