Earthforgottenguardian.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. --[[
  2. Script Name : SpawnScripts/Classic_forest/Earthforgottenguardian.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.15 12:10:03
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/BaseGolem1.lua")
  9. function spawn(NPC)-- FRONT GATE SPAWNS FIRST VV
  10. AddTimer(NPC,4000,"ResetAnimation",1)
  11. if GetSpawnLocationID(NPC)== 133778059 or GetSpawnLocationID(NPC)== 133778061 or GetSpawnLocationID(NPC)== 133778062 or GetSpawnLocationID(NPC)== 133778060 or GetSpawnLocationID(NPC)== 133778065 or GetSpawnLocationID(NPC)== 133778066 or GetSpawnLocationID(NPC)== 133778063 then
  12. AddTimer(NPC,math.random(100),"Easy",1,NPC)
  13. else -- INSIDE SPAWNS VV
  14. AddTimer(NPC,math.random(4000,6000),"ChooseMovement")
  15. AddTimer(NPC,math.random(100),"Harder",1,NPC)
  16. end
  17. end
  18. function ResetAnimation(NPC)
  19. SpawnSet(NPC,"mood_state",0)
  20. end
  21. function Easy(NPC)
  22. local level1 = 9
  23. local level2 = 10
  24. local level3 = 11
  25. local difficulty1 = 7
  26. local hp1 = 370
  27. local power1 = 160
  28. local difficulty2 = 7
  29. local hp2 = 430
  30. local power2 = 200
  31. local difficulty3 =7
  32. local hp3 = 580
  33. local power3 = 240
  34. if Level == level1 then
  35. SpawnSet(NPC, "difficulty", difficulty1)
  36. SpawnSet(NPC, "hp", hp1)
  37. SpawnSet(NPC, "power", power1)
  38. elseif Level == level2
  39. then
  40. SpawnSet(NPC, "difficulty", difficulty2)
  41. SpawnSet(NPC, "hp", hp2)
  42. SpawnSet(NPC, "power", power2)
  43. elseif Level == level3
  44. then
  45. SpawnSet(NPC, "difficulty", difficulty3)
  46. SpawnSet(NPC, "hp", hp3)
  47. SpawnSet(NPC, "power", power3)
  48. end
  49. end
  50. function Harder(NPC)
  51. local level1 = 9
  52. local level2 = 10
  53. local level3 = 11
  54. local difficulty1 = 8
  55. local hp1 = 560
  56. local power1 = 240
  57. local difficulty2 = 8
  58. local hp2 = 645
  59. local power2 = 300
  60. local difficulty3 =8
  61. local hp3 = 870
  62. local power3 = 325
  63. if Level == level1 then
  64. SpawnSet(NPC, "difficulty", difficulty1)
  65. SpawnSet(NPC, "hp", hp1)
  66. SpawnSet(NPC, "power", power1)
  67. elseif Level == level2
  68. then
  69. SpawnSet(NPC, "difficulty", difficulty2)
  70. SpawnSet(NPC, "hp", hp2)
  71. SpawnSet(NPC, "power", power2)
  72. elseif Level == level3
  73. then
  74. SpawnSet(NPC, "difficulty", difficulty3)
  75. SpawnSet(NPC, "hp", hp3)
  76. SpawnSet(NPC, "power", power3)
  77. end
  78. end
  79. function ChooseMovement(NPC)
  80. local route = math.random(1,4)
  81. if route == 1 then
  82. RouteOne(NPC, Spawn)
  83. elseif route == 2 then
  84. RouteTwo(NPC, Spawn)
  85. elseif route == 3 then
  86. RouteThree(NPC, Spawn)
  87. elseif route == 4 then
  88. RouteFour(NPC, Spawn)
  89. end
  90. end
  91. function RouteOne(NPC, Spawn)
  92. local X = GetX(NPC)
  93. local Y = GetY(NPC)
  94. local Z = GetZ(NPC)
  95. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  96. MovementLoopAddLocation(NPC, X + 4, Y, Z, 1, math.random(8,12))
  97. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 1, math.random(8,12))
  98. MovementLoopAddLocation(NPC, X + 7, Y, Z, 1, math.random(8,12))
  99. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 1, math.random(8,12))
  100. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  101. end
  102. function RouteTwo(NPC, Spawn)
  103. local X = GetX(NPC)
  104. local Y = GetY(NPC)
  105. local Z = GetZ(NPC)
  106. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  107. MovementLoopAddLocation(NPC, X - 4, Y, Z, 1, math.random(8,12))
  108. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 1, math.random(8,12))
  109. MovementLoopAddLocation(NPC, X - 7, Y, Z, 1, math.random(8,12))
  110. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 1, math.random(8,12))
  111. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  112. end
  113. function RouteThree(NPC, Spawn)
  114. local X = GetX(NPC)
  115. local Y = GetY(NPC)
  116. local Z = GetZ(NPC)
  117. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  118. MovementLoopAddLocation(NPC, X + 4, Y, Z, 1, math.random(8,12))
  119. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 1, math.random(8,12))
  120. MovementLoopAddLocation(NPC, X + 7, Y, Z, 1, math.random(8,12))
  121. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 1, math.random(8,12))
  122. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(8,12))
  123. end
  124. function RouteFour(NPC, Spawn)
  125. local X = GetX(NPC)
  126. local Y = GetY(NPC)
  127. local Z = GetZ(NPC)
  128. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(2,10))
  129. MovementLoopAddLocation(NPC, X - 4, Y, Z, 1, math.random(8,12))
  130. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 1, math.random(8,12))
  131. MovementLoopAddLocation(NPC, X - 7, Y, Z, 1, math.random(8,12))
  132. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 1, math.random(20,45))
  133. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  134. end
  135. function respawn(NPC, Spawn)
  136. spawn(NPC)
  137. end