arotcrawler.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/arotcrawler.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.05.18 04:05:55
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 = 9
  11. local level2 = 10
  12. local difficulty1 = 5
  13. local hp1 = 165
  14. local power1 = 75
  15. local difficulty2 = 5
  16. local hp2 = 235
  17. local power2 = 85
  18. if Level == level1 then
  19. SpawnSet(NPC, "difficulty", difficulty1)
  20. SpawnSet(NPC, "hp", hp1)
  21. SpawnSet(NPC, "power", power1)
  22. elseif Level == level2
  23. then
  24. SpawnSet(NPC, "difficulty", difficulty2)
  25. SpawnSet(NPC, "hp", hp2)
  26. SpawnSet(NPC, "power", power2)
  27. end
  28. ChooseMovement(NPC)
  29. end
  30. function hailed(NPC, Spawn)
  31. end
  32. function respawn(NPC)
  33. spawn(NPC)
  34. end
  35. ------Slow Movement Script
  36. function ChooseMovement(NPC)
  37. local route = math.random(1,4)
  38. if route == 1 then
  39. RouteOne(NPC, Spawn)
  40. elseif route == 2 then
  41. RouteTwo(NPC, Spawn)
  42. elseif route == 3 then
  43. RouteThree(NPC, Spawn)
  44. elseif route == 4 then
  45. RouteFour(NPC, Spawn)
  46. end
  47. end
  48. function RouteOne(NPC, Spawn)
  49. local X = GetX(NPC)
  50. local Y = GetY(NPC)
  51. local Z = GetZ(NPC)
  52. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  53. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  54. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  55. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  56. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  57. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  58. end
  59. function RouteTwo(NPC, Spawn)
  60. local X = GetX(NPC)
  61. local Y = GetY(NPC)
  62. local Z = GetZ(NPC)
  63. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  64. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  65. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  66. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  67. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  68. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  69. end
  70. function RouteThree(NPC, Spawn)
  71. local X = GetX(NPC)
  72. local Y = GetY(NPC)
  73. local Z = GetZ(NPC)
  74. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  75. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  76. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  77. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  78. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  79. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  80. end
  81. function RouteFour(NPC, Spawn)
  82. local X = GetX(NPC)
  83. local Y = GetY(NPC)
  84. local Z = GetZ(NPC)
  85. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  86. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  87. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  88. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  89. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  90. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  91. end