aspiderhatchling.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --[[
  2. Script Name : SpawnScripts/Longshadow/aspiderhatchling.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.15 01:10:53
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. if GetSpawnLocationID(NPC) == 406177 or
  12. GetSpawnLocationID(NPC) == 405853 or
  13. GetSpawnLocationID(NPC) == 406036 or
  14. GetSpawnLocationID(NPC) == 133787022 or
  15. GetSpawnLocationID(NPC) == 133787023 or
  16. GetSpawnLocationID(NPC) == 133787024 then
  17. AddTimer(NPC,MakeRandomInt(0,4000),"ChooseMovement")
  18. elseif GetSpawnLocationID(NPC) == 405595 then
  19. AddTimer(NPC,MakeRandomInt(0,3500),"waypoints")
  20. end
  21. end
  22. function waypoints(NPC)
  23. MovementLoopAddLocation(NPC, -27.86, 4.13, 55.03, 6, math.random(11,15))
  24. MovementLoopAddLocation(NPC, -21.53, 4.00, 48.61, 6, math.random(10,15))
  25. MovementLoopAddLocation(NPC, -26.84, 4.00, 47.38,6, math.random(10,15))
  26. MovementLoopAddLocation(NPC, -24.00, 4.41, 54.65, 6, math.random(10,15))
  27. MovementLoopAddLocation(NPC, -24.70, 4.00, 45.53, 6, math.random(10,15))
  28. end
  29. function ChooseMovement(NPC)
  30. local route = math.random(1,4)
  31. if route == 1 then
  32. RouteOne(NPC, Spawn)
  33. elseif route == 2 then
  34. RouteTwo(NPC, Spawn)
  35. elseif route == 3 then
  36. RouteThree(NPC, Spawn)
  37. elseif route == 4 then
  38. RouteFour(NPC, Spawn)
  39. end
  40. end
  41. function RouteOne(NPC, Spawn)
  42. local X = GetX(NPC)
  43. local Y = GetY(NPC)
  44. local Z = GetZ(NPC)
  45. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(6,10))
  46. MovementLoopAddLocation(NPC, X + 4, Y, Z, 6, math.random(10,15))
  47. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 6, math.random(10,15))
  48. MovementLoopAddLocation(NPC, X + 7, Y, Z, 6, math.random(10,15))
  49. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 6, math.random(10,15))
  50. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(10,15))
  51. end
  52. function RouteTwo(NPC, Spawn)
  53. local X = GetX(NPC)
  54. local Y = GetY(NPC)
  55. local Z = GetZ(NPC)
  56. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(6,10))
  57. MovementLoopAddLocation(NPC, X - 4, Y, Z, 6, math.random(10,15))
  58. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 6, math.random(10,15))
  59. MovementLoopAddLocation(NPC, X - 7, Y, Z, 6, math.random(10,15))
  60. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 6, math.random(10,15))
  61. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(10,15))
  62. end
  63. function RouteThree(NPC, Spawn)
  64. local X = GetX(NPC)
  65. local Y = GetY(NPC)
  66. local Z = GetZ(NPC)
  67. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(6,10))
  68. MovementLoopAddLocation(NPC, X + 4, Y, Z, 6, math.random(10,15))
  69. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 6, math.random(10,15))
  70. MovementLoopAddLocation(NPC, X + 7, Y, Z, 6, math.random(10,15))
  71. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 6, math.random(10,15))
  72. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(10,15))
  73. end
  74. function RouteFour(NPC, Spawn)
  75. local X = GetX(NPC)
  76. local Y = GetY(NPC)
  77. local Z = GetZ(NPC)
  78. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(6,10))
  79. MovementLoopAddLocation(NPC, X - 4, Y, Z, 6, math.random(10,15))
  80. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 6, math.random(10,15))
  81. MovementLoopAddLocation(NPC, X - 7, Y, Z, 6, math.random(10,15))
  82. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 6, math.random(10,15))
  83. MovementLoopAddLocation(NPC, X, Y, Z, 6, math.random(10,15))
  84. end
  85. function respawn(NPC, Spawn)
  86. spawn(NPC)
  87. end