aDifficultEarthforgottenguardian.lua 3.5 KB

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