ashiningnibbler.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/ashiningnibbler.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.27 09:10:50
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 = 1
  11. local level2 = 2
  12. local level3 = 3
  13. local difficulty1 = 6
  14. local hp1 = 30
  15. local power1 = 25
  16. local difficulty2 = 6
  17. local hp2 = 45
  18. local power2 = 35
  19. local difficulty3 =6
  20. local hp3 = 75
  21. local power3 = 45
  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. MovementChoice(NPC)
  38. end
  39. function hailed(NPC, Spawn)
  40. FaceTarget(NPC, Spawn)
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end
  45. function MovementChoice(NPC)
  46. local choice = math.random(1, 4)
  47. if choice == 1 then
  48. clockwise1(NPC)
  49. elseif choice == 2 then
  50. clockwise2(NPC)
  51. elseif choice == 3 then
  52. counter_clockwise1(NPC)
  53. elseif choice == 4 then
  54. counter_clockwise2(NPC)
  55. end
  56. end
  57. function respawn(NPC)
  58. spawn(NPC)
  59. end
  60. function clockwise1(NPC)
  61. local x = GetX(NPC)
  62. local y = GetY(NPC)
  63. local z = GetZ(NPC)
  64. MovementLoopAddLocation(NPC, x + 7 , y, z - 8 , 2, math.random(5, 15))
  65. MovementLoopAddLocation(NPC, x - 5 , y, z - 10, 2, math.random(5, 15))
  66. MovementLoopAddLocation(NPC, x - 10, y, z + 9 , 2, math.random(5, 15))
  67. MovementLoopAddLocation(NPC, x + 5 , y, z + 8 , 2, math.random(5, 15))
  68. end
  69. function clockwise2(NPC)
  70. local x = GetX(NPC)
  71. local y = GetY(NPC)
  72. local z = GetZ(NPC)
  73. MovementLoopAddLocation(NPC, x + 2 , y, z - 8 , 2, math.random(5, 15))
  74. MovementLoopAddLocation(NPC, x - 7 , y, z - 5 , 2, math.random(5, 15))
  75. MovementLoopAddLocation(NPC, x , y, z + 6 , 2, math.random(5, 15))
  76. MovementLoopAddLocation(NPC, x + 9 , y, z + 1 , 2, math.random(5, 15))
  77. end
  78. function counter_clockwise1(NPC)
  79. local x = GetX(NPC)
  80. local y = GetY(NPC)
  81. local z = GetZ(NPC)
  82. MovementLoopAddLocation(NPC, x - 7 , y, z + 8 , 2, math.random(5, 15))
  83. MovementLoopAddLocation(NPC, x + 5 , y, z + 10, 2, math.random(5, 15))
  84. MovementLoopAddLocation(NPC, x + 10, y, z - 9 , 2, math.random(5, 15))
  85. MovementLoopAddLocation(NPC, x - 5 , y, z - 8 , 2, math.random(5, 15))
  86. end
  87. function counter_clockwise2(NPC)
  88. local x = GetX(NPC)
  89. local y = GetY(NPC)
  90. local z = GetZ(NPC)
  91. MovementLoopAddLocation(NPC, x - 2 , y, z + 8 , 2, math.random(5, 15))
  92. MovementLoopAddLocation(NPC, x + 7 , y, z + 5 , 2, math.random(5, 15))
  93. MovementLoopAddLocation(NPC, x , y, z - 6 , 2, math.random(5, 15))
  94. MovementLoopAddLocation(NPC, x - 9 , y, z - 1 , 2, math.random(5, 15))
  95. end