Corrupted_Dryad_Young.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --[[
  2. Script Name : SpawnScripts/Oakmyst/anOakmystspider.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.01.15
  5. Script Purpose : Ground Roaming
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Dryad_Corrupt1.lua")
  9. function spawn(NPC)
  10. ChooseMovement(NPC)
  11. end
  12. function ChooseMovement(NPC)
  13. local choice = math.random(1, 4)
  14. if choice == 1 then
  15. clockwise1(NPC)
  16. elseif choice == 2 then
  17. clockwise2(NPC)
  18. elseif choice == 3 then
  19. counter_clockwise1(NPC)
  20. elseif choice == 4 then
  21. counter_clockwise2(NPC)
  22. end
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function clockwise1(NPC)
  28. local x = GetX(NPC)
  29. local y = GetY(NPC)
  30. local z = GetZ(NPC)
  31. MovementLoopAddLocation(NPC, x + 1.5 , y, z - 2 , 1, math.random(2, 10))
  32. MovementLoopAddLocation(NPC, x - .5 , y, z - 3, 1, math.random(2, 10))
  33. MovementLoopAddLocation(NPC, x - 3, y, z + 2.5 , 1, math.random(2, 10))
  34. MovementLoopAddLocation(NPC, x + .5 , y, z + 2 , 1, math.random(2, 10))
  35. --MovementLoopAddLocation(NPC, x + 3 , y, z - 4 , 1, math.random(2, 5))
  36. --MovementLoopAddLocation(NPC, x - 1 , y, z - 6, 1, math.random(2, 5))
  37. --MovementLoopAddLocation(NPC, x - 6, y, z + 5 , 1, math.random(2, 5))
  38. --MovementLoopAddLocation(NPC, x + 1 , y, z + 4 , 1, math.random(2, 5))
  39. end
  40. function clockwise2(NPC)
  41. local x = GetX(NPC)
  42. local y = GetY(NPC)
  43. local z = GetZ(NPC)
  44. MovementLoopAddLocation(NPC, x + 1 , y, z - 2 , 1, math.random(2, 10))
  45. MovementLoopAddLocation(NPC, x - 3.5 , y, z - .5 , 1, math.random(2, 10))
  46. MovementLoopAddLocation(NPC, x , y, z + 1 , 1, math.random(2, 10))
  47. MovementLoopAddLocation(NPC, x + 2.5 , y, z + .5 , 1, math.random(2, 10))
  48. end
  49. function counter_clockwise1(NPC)
  50. local x = GetX(NPC)
  51. local y = GetY(NPC)
  52. local z = GetZ(NPC)
  53. MovementLoopAddLocation(NPC, x - 1.5 , y, z + 1 , 1, math.random(2, 10))
  54. MovementLoopAddLocation(NPC, x + .5 , y, z + 3, 1, math.random(2, 10))
  55. MovementLoopAddLocation(NPC, x + 2, y, z - 2.5 , 1, math.random(2, 10))
  56. MovementLoopAddLocation(NPC, x - .5 , y, z - 2 , 1, math.random(2, 10))
  57. end
  58. function counter_clockwise2(NPC)
  59. local x = GetX(NPC)
  60. local y = GetY(NPC)
  61. local z = GetZ(NPC)
  62. MovementLoopAddLocation(NPC, x - 1 , y, z + 2 , 1, math.random(2, 10))
  63. MovementLoopAddLocation(NPC, x + 1.5 , y, z + .5 , 1, math.random(2, 10))
  64. MovementLoopAddLocation(NPC, x , y, z - 1 , 1, math.random(2, 10))
  65. MovementLoopAddLocation(NPC, x - 2.5 , y, z - .5 , 1, math.random(2, 10))
  66. end