Stoneshell.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScriptsForestRuins/Stoneshell.lua
  3. Script Author : LordPazuzu 123
  4. Script Date : 2022.06.09 11:06:12
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 =6
  11. local level2 = 7
  12. local difficulty1 = 5
  13. local hp1 = 70
  14. local power1 = 45
  15. local difficulty2 = 5
  16. local hp2 = 125
  17. local power2 = 55
  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 ChooseMovement(NPC)
  31. local route = math.random(1,4)
  32. if route == 1 then
  33. RouteOne(NPC, Spawn)
  34. elseif route == 2 then
  35. RouteTwo(NPC, Spawn)
  36. elseif route == 3 then
  37. RouteThree(NPC, Spawn)
  38. elseif route == 4 then
  39. RouteFour(NPC, Spawn)
  40. end
  41. end
  42. function RouteOne(NPC, Spawn)
  43. local X = GetX(NPC)
  44. local Y = GetY(NPC)
  45. local Z = GetZ(NPC)
  46. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  47. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  48. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  49. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  50. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  51. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  52. end
  53. function RouteTwo(NPC, Spawn)
  54. local X = GetX(NPC)
  55. local Y = GetY(NPC)
  56. local Z = GetZ(NPC)
  57. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  58. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  59. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  60. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  61. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  62. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  63. end
  64. function RouteThree(NPC, Spawn)
  65. local X = GetX(NPC)
  66. local Y = GetY(NPC)
  67. local Z = GetZ(NPC)
  68. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  69. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  70. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  71. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  72. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  73. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  74. end
  75. function RouteFour(NPC, Spawn)
  76. local X = GetX(NPC)
  77. local Y = GetY(NPC)
  78. local Z = GetZ(NPC)
  79. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  80. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  81. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  82. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  83. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  84. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  85. end
  86. function respawn(NPC, Spawn)
  87. spawn(NPC)
  88. end
  89. function hailed(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. end