aFireyforgottenguardian.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. --[[
  2. Script Name : SpawnScripts/Classic_forest/aFireyforgottenguardian.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.14 06:10:22
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/BaseFireElemental1.lua")
  9. function spawn(NPC)
  10. local Level = GetLevel(NPC)
  11. local level1 = 9
  12. local level2 = 10
  13. local level3 = 11
  14. local difficulty1 = 8
  15. local hp1 = 560
  16. local power1 = 240
  17. local difficulty2 = 8
  18. local hp2 = 645
  19. local power2 = 300
  20. local difficulty3 =8
  21. local hp3 = 870
  22. local power3 = 325
  23. if Level == level1 then
  24. SpawnSet(NPC, "difficulty", difficulty1)
  25. SpawnSet(NPC, "hp", hp1)
  26. SpawnSet(NPC, "power", power1)
  27. elseif Level == level2
  28. then
  29. SpawnSet(NPC, "difficulty", difficulty2)
  30. SpawnSet(NPC, "hp", hp2)
  31. SpawnSet(NPC, "power", power2)
  32. elseif Level == level3
  33. then
  34. SpawnSet(NPC, "difficulty", difficulty3)
  35. SpawnSet(NPC, "hp", hp3)
  36. SpawnSet(NPC, "power", power3)
  37. end
  38. AddTimer(NPC,math.random(2000,5500),"ChooseMovement")
  39. end
  40. function ChooseMovement(NPC)
  41. local route = math.random(1,4)
  42. if route == 1 then
  43. RouteOne(NPC, Spawn)
  44. elseif route == 2 then
  45. RouteTwo(NPC, Spawn)
  46. elseif route == 3 then
  47. RouteThree(NPC, Spawn)
  48. elseif route == 4 then
  49. RouteFour(NPC, Spawn)
  50. end
  51. end
  52. function RouteOne(NPC, Spawn)
  53. local X = GetX(NPC)
  54. local Y = GetY(NPC)
  55. local Z = GetZ(NPC)
  56. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  57. MovementLoopAddLocation(NPC, X + 4, Y, Z, 1, math.random(8,12))
  58. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 1, math.random(8,12))
  59. MovementLoopAddLocation(NPC, X + 7, Y, Z, 1, math.random(8,12))
  60. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 1, math.random(8,12))
  61. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  62. end
  63. function RouteTwo(NPC, Spawn)
  64. local X = GetX(NPC)
  65. local Y = GetY(NPC)
  66. local Z = GetZ(NPC)
  67. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  68. MovementLoopAddLocation(NPC, X - 4, Y, Z, 1, math.random(8,12))
  69. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 1, math.random(8,12))
  70. MovementLoopAddLocation(NPC, X - 7, Y, Z, 1, math.random(8,12))
  71. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 1, math.random(8,12))
  72. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  73. end
  74. function RouteThree(NPC, Spawn)
  75. local X = GetX(NPC)
  76. local Y = GetY(NPC)
  77. local Z = GetZ(NPC)
  78. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  79. MovementLoopAddLocation(NPC, X + 4, Y, Z, 1, math.random(8,12))
  80. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 1, math.random(8,12))
  81. MovementLoopAddLocation(NPC, X + 7, Y, Z, 1, math.random(8,12))
  82. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 1, math.random(8,12))
  83. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  84. end
  85. function RouteFour(NPC, Spawn)
  86. local X = GetX(NPC)
  87. local Y = GetY(NPC)
  88. local Z = GetZ(NPC)
  89. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  90. MovementLoopAddLocation(NPC, X - 4, Y, Z, 1, math.random(8,12))
  91. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 1, math.random(8,12))
  92. MovementLoopAddLocation(NPC, X - 7, Y, Z, 1, math.random(8,12))
  93. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 1, math.random(20,45))
  94. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  95. end
  96. function respawn(NPC, Spawn)
  97. spawn(NPC)
  98. end