9
3

InvisibleCubeAtramentor.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --[[
  2. Script Name : SpawnScripts/Caves/InvisibleCubeAtramentor.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.10 03:10:18
  5. Script Purpose : Atramentor Spawn Camp Script
  6. :
  7. --]]
  8. function spawn(NPC)
  9. CampSpawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function CampSpawn(NPC, Spawn) -- Stage 1
  15. local zone = GetZone(NPC)
  16. local CampSpawn1 = SpawnByLocationID(zone, 133777642) --Atramentor(inactive)
  17. local CampSpawn2 = SpawnByLocationID(zone, 133777659)--Rockpaw Stonemaster
  18. local CampSpawn3 = SpawnByLocationID(zone, 133777660)--alabaster behemoth
  19. local CampSpawn4 = SpawnByLocationID(zone, 133777661)--alabaster behemoth
  20. local CampSpawn5 = SpawnByLocationID(zone, 133777662)--alabaster behemoth
  21. local CampSpawn6 = SpawnByLocationID(zone, 133777663)--alabaster behemoth
  22. local CampSpawn7 = SpawnByLocationID(zone, 133777643)--obsidian rocks
  23. local CampSpawn8 = SpawnByLocationID(zone, 133777656)--obsidian rocks
  24. local CampSpawn9 = SpawnByLocationID(zone, 133777657)--obsidian rocks
  25. local CampSpawn10 = SpawnByLocationID(zone, 133777658)--obsidian rocks
  26. AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
  27. end
  28. function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  29. local zone = GetZone(NPC)
  30. local CampSpawn2 = GetSpawnByLocationID(zone, 133777659)
  31. local CampSpawn3 = GetSpawnByLocationID(zone, 133777660)
  32. local CampSpawn4 = GetSpawnByLocationID(zone, 133777661)
  33. local CampSpawn5 = GetSpawnByLocationID(zone, 133777662)
  34. local CampSpawn6 = GetSpawnByLocationID(zone, 133777663)
  35. if IsAlive(CampSpawn2) == true then
  36. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  37. elseif IsAlive(CampSpawn3) == true then
  38. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  39. elseif IsAlive(CampSpawn4) == true then
  40. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  41. elseif IsAlive(CampSpawn5) == true then
  42. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  43. elseif IsAlive(CampSpawn6) == true then
  44. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  45. else
  46. AddTimer(NPC, 6000, "Camp_Stage2")
  47. end
  48. end
  49. function Camp_Stage2(NPC, Spawn) --Stage 2 Atramentor(active)
  50. local zone = GetZone(NPC)
  51. local choice = math.random(0,100)
  52. if choice <=20 then -- % Chance for Boss to Spawn
  53. local CampSpawn1 = GetSpawnByLocationID(zone, 133777642) --Atramentor(inactive)
  54. local CampSpawn7 = GetSpawnByLocationID(zone, 133777643)
  55. local CampSpawn8 = GetSpawnByLocationID(zone, 133777656)
  56. local CampSpawn9 = GetSpawnByLocationID(zone, 133777657)
  57. local CampSpawn10 = GetSpawnByLocationID(zone, 133777658)
  58. Despawn(CampSpawn1)
  59. Despawn(CampSpawn7)
  60. Despawn(CampSpawn8)
  61. Despawn(CampSpawn9)
  62. Despawn(CampSpawn10)
  63. local Boss=SpawnByLocationID(zone, 133777665)--Atramentor
  64. FaceTarget(Boss, Spawn)
  65. Attack(Boss, Spawn)
  66. AddTimer(NPC,6000,"CampSpawnCheck_Stage2")
  67. else -- Failed Atramentor Spawn
  68. AddTimer(NPC,900000,"CampReset")
  69. end
  70. end
  71. function CampSpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  72. local zone = GetZone(NPC)
  73. local Boss = GetSpawnByLocationID(zone, 133777665) --Atramentor
  74. if IsAlive(Boss) == true then
  75. AddTimer(NPC,6000,"CampSpawnCheck_Stage2",1,Spawn)
  76. else
  77. AddTimer(NPC, 900000, "CampReset",1,Spawn)
  78. end
  79. end
  80. function CampReset(NPC)
  81. local zone = GetZone(NPC)
  82. local CampObject = GetSpawnByLocationID(zone, 133777664) --Invis Cube
  83. local CampSpawn7 = GetSpawnByLocationID(zone, 133777643)
  84. local CampSpawn8 = GetSpawnByLocationID(zone, 133777656)
  85. local CampSpawn9 = GetSpawnByLocationID(zone, 133777657)
  86. local CampSpawn10 = GetSpawnByLocationID(zone, 133777658)
  87. if CampObject~= nil then
  88. Despawn(CampObject)
  89. elseif CampSpawn7~= nil then
  90. Despawn(CampSpawn7)
  91. elseif CampSpawn8~= nil then
  92. Despawn(CampSpawn8)
  93. elseif CampSpawn9~= nil then
  94. Despawn(CampSpawn9)
  95. elseif CampSpawn10~= nil then
  96. Despawn(CampSpawn10)
  97. end
  98. end