9
3

aSabertoothrunt.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --[[
  2. Script Name : SpawnScripts/Antonica/aSabertoothrunt.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.07.12 02:07:14
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 = 10
  11. local level2 = 11
  12. local difficulty1 = 6
  13. local hp1 = 370
  14. local power1 = 130
  15. local difficulty2 = 6
  16. local hp2 = 430
  17. local power2 = 160
  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, 0)
  47. MovementLoopAddLocation(NPC, X + 35, Y, Z, 2,0)
  48. MovementLoopAddLocation(NPC, X + 35, Y, Z + 4, 2, 5)
  49. MovementLoopAddLocation(NPC, X + 35, Y, Z, 2, 0)
  50. MovementLoopAddLocation(NPC, X + 35, Y, Z + 4, 2, 0)
  51. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  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, 0)
  58. MovementLoopAddLocation(NPC, X - 35, Y, Z, 2, 0)
  59. MovementLoopAddLocation(NPC, X - 35, Y, Z - 4, 2, 5)
  60. MovementLoopAddLocation(NPC, X - 35, Y, Z, 2, 0)
  61. MovementLoopAddLocation(NPC, X - 35, Y, Z - 4, 2, 0)
  62. MovementLoopAddLocation(NPC, X, Y, Z, 1, 0)
  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, 0)
  69. MovementLoopAddLocation(NPC, X + 35, Y, Z, 2, 0)
  70. MovementLoopAddLocation(NPC, X + 35, Y, Z - 4, 2, 5)
  71. MovementLoopAddLocation(NPC, X + 35, Y, Z, 2, 0)
  72. MovementLoopAddLocation(NPC, X + 35, Y, Z - 4, 2, 0)
  73. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  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, 0)
  80. MovementLoopAddLocation(NPC, X - 35, Y, Z, 2, 0)
  81. MovementLoopAddLocation(NPC, X - 35, Y, Z + 4, 2, 5)
  82. MovementLoopAddLocation(NPC, X - 35, Y, Z, 2, 0)
  83. MovementLoopAddLocation(NPC, X - 35, Y, Z + 4, 2, 0)
  84. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  85. end
  86. function respawn(NPC, Spawn)
  87. spawn(NPC)
  88. end
  89. function hailed(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. end