FaerieGuardian.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/FaerieGuardian.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.05.17 06:05:49
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. ChooseMovement(NPC)
  10. local Level = GetLevel(NPC)
  11. local level1 = 11
  12. local level2 = 12
  13. local difficulty1 = 5
  14. local hp1 = 290
  15. local power1 = 105
  16. local difficulty2 = 5
  17. local hp2 = 350
  18. local power2 = 125
  19. if Level == level1 then
  20. SpawnSet(NPC, "difficulty", difficulty1)
  21. SpawnSet(NPC, "hp", hp1)
  22. SpawnSet(NPC, "power", power1)
  23. elseif Level == level2
  24. then
  25. SpawnSet(NPC, "difficulty", difficulty2)
  26. SpawnSet(NPC, "hp", hp2)
  27. SpawnSet(NPC, "power", power2)
  28. end
  29. end
  30. function hailed(NPC, Spawn)
  31. FaceTarget(NPC, Spawn)
  32. end
  33. function respawn(NPC)
  34. spawn(NPC)
  35. end
  36. function ChooseMovement(NPC)
  37. local choice = math.random(1, 4)
  38. if choice == 1 then
  39. clockwise1(NPC)
  40. elseif choice == 2 then
  41. clockwise2(NPC)
  42. elseif choice == 3 then
  43. counter_clockwise1(NPC)
  44. elseif choice == 4 then
  45. counter_clockwise2(NPC)
  46. end
  47. end
  48. function clockwise1(NPC)
  49. local x = GetX(NPC)
  50. local y = GetY(NPC)
  51. local z = GetZ(NPC)
  52. MovementLoopAddLocation(NPC, x + 1.5 , y +2 , z - 2 , 1, math.random(2, 10))
  53. MovementLoopAddLocation(NPC, x - .5 , y - .5, z - 3, 1, math.random(2, 10))
  54. MovementLoopAddLocation(NPC, x - 3, y, z - 5 + 2.5 , 1, math.random(2, 10))
  55. MovementLoopAddLocation(NPC, x + .5 , y, z - 1 + 2 , 1, math.random(2, 10))
  56. --MovementLoopAddLocation(NPC, x + 3 , y, z - 4 , 1, math.random(2, 5))
  57. --MovementLoopAddLocation(NPC, x - 1 , y, z - 6, 1, math.random(2, 5))
  58. --MovementLoopAddLocation(NPC, x - 6, y, z + 5 , 1, math.random(2, 5))
  59. --MovementLoopAddLocation(NPC, x + 1 , y, z + 4 , 1, math.random(2, 5))
  60. end
  61. function clockwise2(NPC)
  62. local x = GetX(NPC)
  63. local y = GetY(NPC)
  64. local z = GetZ(NPC)
  65. MovementLoopAddLocation(NPC, x + 1 , y, z - 2 , 1, math.random(2, 10))
  66. MovementLoopAddLocation(NPC, x - 3.5 , y +2 , z - .5 , 1, math.random(2, 10))
  67. MovementLoopAddLocation(NPC, x , y - .5 , z + 1 , 1, math.random(2, 10))
  68. MovementLoopAddLocation(NPC, x + 2.5 , y - .5, z + .5 , 1, math.random(2, 10))
  69. end
  70. function counter_clockwise1(NPC)
  71. local x = GetX(NPC)
  72. local y = GetY(NPC)
  73. local z = GetZ(NPC)
  74. MovementLoopAddLocation(NPC, x - 1.5 , y -.5, z + 1 , 1, math.random(2, 10))
  75. MovementLoopAddLocation(NPC, x + .5 , y, z + 3, 1, math.random(2, 10))
  76. MovementLoopAddLocation(NPC, x + 2, y + 2, z - 2.5 , 1, math.random(2, 10))
  77. MovementLoopAddLocation(NPC, x - .5 , y -1.5, z - 2 , 1, math.random(2, 10))
  78. end
  79. function counter_clockwise2(NPC)
  80. local x = GetX(NPC)
  81. local y = GetY(NPC)
  82. local z = GetZ(NPC)
  83. MovementLoopAddLocation(NPC, x - 1 , y, z + 2 , 1, math.random(2, 10))
  84. MovementLoopAddLocation(NPC, x + 1.5 , y, z + .5 , 1, math.random(2, 10))
  85. MovementLoopAddLocation(NPC, x , y, z - 1 , 1, math.random(2, 10))
  86. MovementLoopAddLocation(NPC, x - 2.5 , y, z - .5 , 1, math.random(2, 10))
  87. end