9
3

agreaterbogfaerieRoam.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --[[
  2. Script Name : SpawnScripts/Peatbog_Classic/agreaterbogfaerieRoam.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.11.03 03:11:19
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Fairy_PeatBog.lua")
  9. function spawn(NPC)
  10. local Level = GetLevel(NPC)
  11. local level1 = 9
  12. local level2 = 10
  13. local difficulty1 = 8
  14. local hp1 = 555
  15. local power1 = 240
  16. local difficulty2 = 8
  17. local hp2 = 645
  18. local power2 = 300
  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. ChooseMovement(NPC)
  30. end
  31. function ChooseMovement(NPC)
  32. local route = math.random(1,4)
  33. if route == 1 then
  34. RouteOne(NPC, Spawn)
  35. elseif route == 2 then
  36. RouteTwo(NPC, Spawn)
  37. elseif route == 3 then
  38. RouteThree(NPC, Spawn)
  39. elseif route == 4 then
  40. RouteFour(NPC, Spawn)
  41. end
  42. end
  43. function RouteOne(NPC, Spawn)
  44. local X = GetX(NPC)
  45. local Y = GetY(NPC)
  46. local Z = GetZ(NPC)
  47. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  48. MovementLoopAddLocation(NPC, X + 7, Y+4, Z, 2, math.random(7,15))
  49. MovementLoopAddLocation(NPC, X + 7, Y+4, Z + 4, 2, math.random(7,15))
  50. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(7,15))
  51. MovementLoopAddLocation(NPC, X + 7, Y, Z + 4, 2, math.random(7,15))
  52. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  53. end
  54. function RouteTwo(NPC, Spawn)
  55. local X = GetX(NPC)
  56. local Y = GetY(NPC)
  57. local Z = GetZ(NPC)
  58. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  59. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(7,15))
  60. MovementLoopAddLocation(NPC, X - 7, Y+4, Z - 4, 2, math.random(7,15))
  61. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  62. MovementLoopAddLocation(NPC, X - 7, Y, Z - 4, 2, math.random(7,15))
  63. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(7,15))
  64. end
  65. function RouteThree(NPC, Spawn)
  66. local X = GetX(NPC)
  67. local Y = GetY(NPC)
  68. local Z = GetZ(NPC)
  69. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  70. MovementLoopAddLocation(NPC, X + 7, Y+2, Z, 2,math.random(7,15))
  71. MovementLoopAddLocation(NPC, X + 7, Y+4, Z - 4, 2, math.random(7,15))
  72. MovementLoopAddLocation(NPC, X + 7, Y+2, Z, 2, math.random(7,15))
  73. MovementLoopAddLocation(NPC, X + 7, Y, Z - 4, 2, math.random(7,15))
  74. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  75. end
  76. function RouteFour(NPC, Spawn)
  77. local X = GetX(NPC)
  78. local Y = GetY(NPC)
  79. local Z = GetZ(NPC)
  80. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  81. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  82. MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(7,15))
  83. MovementLoopAddLocation(NPC, X - 7, Y+4, Z, 2, math.random(7,15))
  84. MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(7,15))
  85. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  86. end
  87. function respawn(NPC, Spawn)
  88. spawn(NPC)
  89. end
  90. function hailed(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. end