9
3

ashiningnibbler.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : SpawnScripts/Graystone/ashiningnibbler.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.27 09:10:47
  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. ChooseMovement(NPC)
  38. end
  39. function ChooseMovement(NPC)
  40. local choice = math.random(1, 4)
  41. if choice == 1 then
  42. clockwise1(NPC)
  43. elseif choice == 2 then
  44. clockwise2(NPC)
  45. elseif choice == 3 then
  46. counter_clockwise1(NPC)
  47. elseif choice == 4 then
  48. counter_clockwise2(NPC)
  49. end
  50. end
  51. function respawn(NPC)
  52. spawn(NPC)
  53. end
  54. function clockwise1(NPC)
  55. local x = GetX(NPC)
  56. local y = GetY(NPC)
  57. local z = GetZ(NPC)
  58. MovementLoopAddLocation(NPC, x + 1.5 , y, z - 2 , 1, math.random(2, 10))
  59. MovementLoopAddLocation(NPC, x - .5 , y, z - 3, 1, math.random(2, 10))
  60. MovementLoopAddLocation(NPC, x - 3, y, z + 2.5 , 1, math.random(2, 10))
  61. MovementLoopAddLocation(NPC, x + .5 , y, z + 2 , 1, math.random(2, 10))
  62. --MovementLoopAddLocation(NPC, x + 3 , y, z - 4 , 1, math.random(2, 5))
  63. --MovementLoopAddLocation(NPC, x - 1 , y, z - 6, 1, math.random(2, 5))
  64. --MovementLoopAddLocation(NPC, x - 6, y, z + 5 , 1, math.random(2, 5))
  65. --MovementLoopAddLocation(NPC, x + 1 , y, z + 4 , 1, math.random(2, 5))
  66. end
  67. function clockwise2(NPC)
  68. local x = GetX(NPC)
  69. local y = GetY(NPC)
  70. local z = GetZ(NPC)
  71. MovementLoopAddLocation(NPC, x + 1 , y, z - 2 , 1, math.random(2, 10))
  72. MovementLoopAddLocation(NPC, x - 3.5 , y, z - .5 , 1, math.random(2, 10))
  73. MovementLoopAddLocation(NPC, x , y, z + 1 , 1, math.random(2, 10))
  74. MovementLoopAddLocation(NPC, x + 2.5 , y, z + .5 , 1, math.random(2, 10))
  75. end
  76. function counter_clockwise1(NPC)
  77. local x = GetX(NPC)
  78. local y = GetY(NPC)
  79. local z = GetZ(NPC)
  80. MovementLoopAddLocation(NPC, x - 1.5 , y, z + 1 , 1, math.random(2, 10))
  81. MovementLoopAddLocation(NPC, x + .5 , y, z + 3, 1, math.random(2, 10))
  82. MovementLoopAddLocation(NPC, x + 2, y, z - 2.5 , 1, math.random(2, 10))
  83. MovementLoopAddLocation(NPC, x - .5 , y, z - 2 , 1, math.random(2, 10))
  84. end
  85. function counter_clockwise2(NPC)
  86. local x = GetX(NPC)
  87. local y = GetY(NPC)
  88. local z = GetZ(NPC)
  89. MovementLoopAddLocation(NPC, x - 1 , y, z + 2 , 1, math.random(2, 10))
  90. MovementLoopAddLocation(NPC, x + 1.5 , y, z + .5 , 1, math.random(2, 10))
  91. MovementLoopAddLocation(NPC, x , y, z - 1 , 1, math.random(2, 10))
  92. MovementLoopAddLocation(NPC, x - 2.5 , y, z - .5 , 1, math.random(2, 10))
  93. end