9
3

afaerieguardianRoam.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : SpawnScripts/Peatbog_Classic/afaerieguardianRoam.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.11.04 05:11:33
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Fairy_PeatBog.lua")
  9. function spawn(NPC)
  10. ChooseMovement(NPC)
  11. end
  12. function ChooseMovement(NPC)
  13. local route = math.random(1,4)
  14. if route == 1 then
  15. RouteOne(NPC, Spawn)
  16. elseif route == 2 then
  17. RouteTwo(NPC, Spawn)
  18. elseif route == 3 then
  19. RouteThree(NPC, Spawn)
  20. elseif route == 4 then
  21. RouteFour(NPC, Spawn)
  22. end
  23. end
  24. function RouteOne(NPC, Spawn)
  25. local X = GetX(NPC)
  26. local Y = GetY(NPC)
  27. local Z = GetZ(NPC)
  28. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  29. MovementLoopAddLocation(NPC, X + 7, Y+4, Z, 2, math.random(7,15))
  30. MovementLoopAddLocation(NPC, X + 7, Y+4, Z + 4, 2, math.random(7,15))
  31. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(7,15))
  32. MovementLoopAddLocation(NPC, X + 7, Y, Z + 4, 2, math.random(7,15))
  33. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  34. end
  35. function RouteTwo(NPC, Spawn)
  36. local X = GetX(NPC)
  37. local Y = GetY(NPC)
  38. local Z = GetZ(NPC)
  39. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  40. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(7,15))
  41. MovementLoopAddLocation(NPC, X - 7, Y+4, Z - 4, 2, math.random(7,15))
  42. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  43. MovementLoopAddLocation(NPC, X - 7, Y, Z - 4, 2, math.random(7,15))
  44. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(7,15))
  45. end
  46. function RouteThree(NPC, Spawn)
  47. local X = GetX(NPC)
  48. local Y = GetY(NPC)
  49. local Z = GetZ(NPC)
  50. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  51. MovementLoopAddLocation(NPC, X + 7, Y+2, Z, 2,math.random(7,15))
  52. MovementLoopAddLocation(NPC, X + 7, Y+4, Z - 4, 2, math.random(7,15))
  53. MovementLoopAddLocation(NPC, X + 7, Y+2, Z, 2, math.random(7,15))
  54. MovementLoopAddLocation(NPC, X + 7, Y, Z - 4, 2, math.random(7,15))
  55. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  56. end
  57. function RouteFour(NPC, Spawn)
  58. local X = GetX(NPC)
  59. local Y = GetY(NPC)
  60. local Z = GetZ(NPC)
  61. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  62. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  63. MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(7,15))
  64. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  65. MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(7,15))
  66. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  67. end
  68. function respawn(NPC, Spawn)
  69. spawn(NPC)
  70. end
  71. function hailed(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. end