aforestwarden.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/Antonica/aforestwarden.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.07.09 01:07:35
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 = 13
  11. local level2 = 14
  12. local difficulty1 = 6
  13. local hp1 = 655
  14. local power1 = 205
  15. local difficulty2 = 6
  16. local hp2 = 765
  17. local power2 = 240
  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 respawn(NPC, Spawn)
  31. spawn(NPC)
  32. end
  33. function hailed(NPC, Spawn)
  34. FaceTarget(NPC, Spawn)
  35. end
  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, 0)
  53. MovementLoopAddLocation(NPC, X + 14, Y, Z, 2,0)
  54. MovementLoopAddLocation(NPC, X + 14, Y, Z + 4, 2, 5)
  55. MovementLoopAddLocation(NPC, X + 20, Y, Z, 2, 0)
  56. MovementLoopAddLocation(NPC, X + 14, Y, Z + 4, 2, 0)
  57. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  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, 0)
  64. MovementLoopAddLocation(NPC, X - 14, Y, Z, 2, 0)
  65. MovementLoopAddLocation(NPC, X - 14, Y, Z - 4, 2, 5)
  66. MovementLoopAddLocation(NPC, X - 20, Y, Z, 2, 0)
  67. MovementLoopAddLocation(NPC, X - 14, Y, Z - 4, 2, 0)
  68. MovementLoopAddLocation(NPC, X, Y, Z, 1, 0)
  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, 0)
  75. MovementLoopAddLocation(NPC, X + 14, Y, Z, 2, 0)
  76. MovementLoopAddLocation(NPC, X + 14, Y, Z - 4, 2, 5)
  77. MovementLoopAddLocation(NPC, X + 20, Y, Z, 2, 0)
  78. MovementLoopAddLocation(NPC, X + 14, Y, Z - 4, 2, 0)
  79. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  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, 0)
  86. MovementLoopAddLocation(NPC, X - 14, Y, Z, 2, 0)
  87. MovementLoopAddLocation(NPC, X - 14, Y, Z + 4, 2, 5)
  88. MovementLoopAddLocation(NPC, X - 20, Y, Z, 2, 0)
  89. MovementLoopAddLocation(NPC, X - 14, Y, Z + 4, 2, 0)
  90. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  91. end