9
3

afociofdecayA.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. --[[
  2. Script Name : SpawnScripts/Antonica/afociofdecayA.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.02.01 08:02:51
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. Camp1Spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. ---Plaguebringer Camp
  15. function Camp1Spawn(NPC, Spawn) -- Stage 1
  16. local zone = GetZone(NPC)
  17. local Spawn1 = SpawnByLocationID(zone, 133782082) --restless Caltorsite
  18. local Spawn2 = SpawnByLocationID(zone, 133782083)--restless Caltorsite
  19. local Spawn3 = SpawnByLocationID(zone, 133782084)--restless Caltorsite
  20. local Spawn4 = SpawnByLocationID(zone, 133782085)--restless Caltorsite
  21. local Spawn5 = SpawnByLocationID(zone, 133782086)--restless Caltorsite
  22. local Spawn6 = SpawnByLocationID(zone, 133782087)--restless Caltorsite
  23. local MerchantSpawn = math.random(0,1)
  24. if MerchantSpawn == 1 then
  25. local Camp1MerchantSpawn = SpawnByLocationID(zone, 133782080)--Distressed Merchant
  26. else
  27. end
  28. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  29. end
  30. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  31. local zone = GetZone(NPC)
  32. local Spawn1 = GetSpawnByLocationID(zone, 133782082)
  33. local Spawn2 = GetSpawnByLocationID(zone, 133782083)
  34. local Spawn3 = GetSpawnByLocationID(zone, 133782084)
  35. local Spawn4 = GetSpawnByLocationID(zone, 133782085)
  36. local Spawn5 = GetSpawnByLocationID(zone, 133782086)
  37. local Spawn6 = GetSpawnByLocationID(zone, 133782087)
  38. if IsAlive(Spawn1) == true then
  39. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  40. elseif IsAlive(Spawn2) == true then
  41. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  42. elseif IsAlive(Spawn3) == true then
  43. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  44. elseif IsAlive(Spawn4) == true then
  45. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  46. elseif IsAlive(Spawn5) == true then
  47. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  48. elseif IsAlive(Spawn6) == true then
  49. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  50. else
  51. AddTimer(NPC, 6000, "Camp1_Stage2")
  52. end
  53. end
  54. function Camp1_Stage2(NPC, Spawn) --Stage 2
  55. local zone = GetZone(NPC)
  56. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 133782090)--acolyte 1
  57. local Camp1_Stage2Spawn2=SpawnByLocationID(zone, 133782091)--acolyte 2
  58. local Camp1_Stage2Spawn3=SpawnByLocationID(zone, 133782092)--acolyte 3
  59. local Camp1_Stage2Spawn4=SpawnByLocationID(zone, 133782093)--acolyte 4
  60. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  61. Attack(Camp1_Stage2Spawn1, Spawn)
  62. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  63. end
  64. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  65. local zone = GetZone(NPC)
  66. local Camp1_Stage2Spawn1=GetSpawnByLocationID(zone, 133782090)--acolyte 1
  67. local Camp1_Stage2Spawn2=GetSpawnByLocationID(zone, 133782091)--acolyte 2
  68. local Camp1_Stage2Spawn3=GetSpawnByLocationID(zone, 133782092)--acolyte 3
  69. local Camp1_Stage2Spawn4=GetSpawnByLocationID(zone, 133782093)--acolyte 4
  70. if IsAlive(Camp1_Stage2Spawn1) == true then
  71. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  72. elseif IsAlive(Camp1_Stage2Spawn2) == true then
  73. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  74. elseif IsAlive(Camp1_Stage2Spawn3) == true then
  75. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  76. elseif IsAlive(Camp1_Stage2Spawn4) == true then
  77. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  78. else
  79. AddTimer(NPC, 6000, "Camp1_Stage3")
  80. end
  81. end
  82. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  83. local zone = GetZone(NPC)
  84. local choice = math.random(0,100)
  85. if choice <=33 then -- % Chance for Boss to Spawn
  86. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133782094)--Priest of the Plaguebringer
  87. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  88. Attack(Camp1_Stage3Spawn1, Spawn)
  89. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  90. else -- Failed Boss Spawn
  91. local Camp1ArkofPower = SpawnByLocationID(zone, 133782088)--Ark of Power
  92. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133782080)--Distressed Merchant
  93. if Camp1MerchantSpawn ~=nil then
  94. Despawn(Camp1MerchantSpawn)
  95. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133782081)--Gratified Merchant
  96. AddTimer(NPC,90000,"Camp1Reset")
  97. else
  98. AddTimer(NPC,60000,"Camp1Reset")
  99. end
  100. end
  101. end
  102. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  103. local zone = GetZone(NPC)
  104. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133782094) --Priest of the Plaguebringer
  105. if IsAlive(Camp1_Stage2Spawn1) == true then
  106. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  107. else
  108. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133782080)--Distressed Merchant
  109. if Camp1MerchantSpawn ~=nil then
  110. Despawn(Camp1MerchantSpawn)
  111. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133782081)--Gratified Merchant
  112. AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
  113. else
  114. AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
  115. end
  116. end
  117. end
  118. function Camp1Reset(NPC)
  119. local zone = GetZone(NPC)
  120. local Camp1Object = GetSpawnByLocationID(zone, 133770794)
  121. if Camp1Object~= nil then
  122. Despawn(Camp1Object)
  123. local Camp1ArkofPower = GetSpawnByLocationID(zone, 133782088)--Ark of Power
  124. if Camp1ArkofPower ~=nil then
  125. Despawn(Camp1ArkofPower)
  126. end
  127. local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133782081)--Gratified Merchant
  128. if Camp1GratifiedMerchant ~=nil then
  129. Despawn(Camp1GratifiedMerchant)
  130. end
  131. end
  132. end