9
3

aSonicShrieker.lua 3.4 KB

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