agnollcampC.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. --[[
  2. Script Name : SpawnScripts/Antonica/agnollcampC.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.01.26 05:01:22
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. Camp1Spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. --- CAMP 1
  15. function Camp1Spawn(NPC, Spawn) -- Stage 1
  16. local zone = GetZone(NPC)
  17. local spawn1 = math.random(0,1)
  18. if spawn1 == 1 then
  19. local Camp1Spawn1 = SpawnByLocationID(zone, 133781849) --Gnoll1 (priest)
  20. else
  21. local Camp1Spawn1a = SpawnByLocationID(zone, 133781843) -- Gnoll1(fighter)
  22. end
  23. local spawn2 = math.random(0,1)
  24. if spawn2 == 1 then
  25. local Camp1Spawn2 = SpawnByLocationID(zone, 133781850)--Gnoll2 (priest)
  26. else
  27. local Camp1Spawn2a = SpawnByLocationID(zone, 133781844)-- Gnoll2(fighter)
  28. end
  29. local spawn3 = math.random(0,1)
  30. if spawn3 == 1 then
  31. local Camp1Spawn3 = SpawnByLocationID(zone, 133781851)--Gnoll3 (priest)
  32. else
  33. local Camp1Spawn3a = SpawnByLocationID(zone, 133781845)-- Gnoll3(fighter)
  34. end
  35. local spawn4 = math.random(0,1)
  36. if spawn4 == 1 then
  37. local Camp1Spawn4 = SpawnByLocationID(zone, 133781852)--Gnoll4 (priest)
  38. else
  39. local Camp1Spawn4a = SpawnByLocationID(zone, 133781846)-- Gnoll4(fighter)
  40. end
  41. local spawn5 = math.random(0,1)
  42. if spawn5 == 1 then
  43. local Camp1Spawn5 = SpawnByLocationID(zone, 133781853)--Gnoll5 (priest)
  44. else
  45. local Camp1Spawn5a = SpawnByLocationID(zone, 133781847)-- Gnoll5(fighter)
  46. end
  47. local spawn6 = math.random(0,1)
  48. if spawn6 == 1 then
  49. local Camp1Spawn6 = SpawnByLocationID(zone, 133781854)--Gnoll6 (priest)
  50. else
  51. local Camp1Spawn6a = SpawnByLocationID(zone, 133781848)-- Gnoll6(fighter)
  52. end
  53. local MerchantSpawn = math.random(0,1)
  54. if MerchantSpawn == 1 then
  55. local Camp1MerchantSpawn = SpawnByLocationID(zone, 589068)--Distressed Merchant
  56. else
  57. end
  58. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  59. end
  60. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  61. local zone = GetZone(NPC)
  62. local Camp1Spawn1 = GetSpawnByLocationID(zone, 133781849)
  63. local Camp1Spawn1a = GetSpawnByLocationID(zone, 133781843)
  64. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133781850)
  65. local Camp1Spawn2a = GetSpawnByLocationID(zone, 133781844)
  66. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133781851)
  67. local Camp1Spawn3a = GetSpawnByLocationID(zone, 133781845)
  68. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133781852)
  69. local Camp1Spawn4a = GetSpawnByLocationID(zone, 133781846)
  70. local Camp1Spawn5 = GetSpawnByLocationID(zone, 133781853)
  71. local Camp1Spawn5a = GetSpawnByLocationID(zone, 133781847)
  72. local Camp1Spawn6 = GetSpawnByLocationID(zone, 133781854)
  73. local Camp1Spawn6a = GetSpawnByLocationID(zone, 133781848)
  74. if IsAlive(Camp1Spawn1) == true or IsAlive(Camp1Spawn1a) == true then
  75. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  76. elseif IsAlive(Camp1Spawn2) == true or IsAlive(Camp1Spawn2a) == true then
  77. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  78. elseif IsAlive(Camp1Spawn3) == true or IsAlive(Camp1Spawn3a) == true then
  79. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  80. elseif IsAlive(Camp1Spawn4) == true or IsAlive(Camp1Spawn4a) == true then
  81. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  82. elseif IsAlive(Camp1Spawn5) == true or IsAlive(Camp1Spawn5a) == true then
  83. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  84. elseif IsAlive(Camp1Spawn6) == true or IsAlive(Camp1Spawn6a) == true then
  85. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  86. else
  87. AddTimer(NPC, 6000, "Camp1_Stage2")
  88. end
  89. end
  90. function Camp1_Stage2(NPC, Spawn) --Stage 2
  91. local zone = GetZone(NPC)
  92. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 193780)--darkpack tribal elder
  93. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  94. Attack(Camp1_Stage2Spawn1, Spawn)
  95. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  96. end
  97. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  98. local zone = GetZone(NPC)
  99. local Camp1_Stage2Spawn1 = GetSpawnByLocationID(zone, 193780)
  100. if IsAlive(Camp1_Stage2Spawn1) == true then
  101. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  102. else
  103. AddTimer(NPC, 6000, "Camp1_Stage3")
  104. end
  105. end
  106. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  107. local zone = GetZone(NPC)
  108. local choice = math.random(0,100)
  109. if choice <=33 then -- % Chance for Boss to Spawn
  110. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133781788)--Sarkin
  111. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  112. Attack(Camp1_Stage3Spawn1, Spawn)
  113. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  114. else -- Failed Boss Spawn
  115. local Camp1ArkofPower = SpawnByLocationID(zone, 133781841)--Ark of Power
  116. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 589068)--Distressed Merchant
  117. if Camp1MerchantSpawn ~=nil then
  118. Despawn(Camp1MerchantSpawn)
  119. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133781842)--Gratified Merchant
  120. AddTimer(NPC,90000,"Camp1Reset")
  121. else
  122. AddTimer(NPC,60000,"Camp1Reset")
  123. end
  124. end
  125. end
  126. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  127. local zone = GetZone(NPC)
  128. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133781788) --Sarkin
  129. if IsAlive(Camp1_Stage2Spawn1) == true then
  130. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  131. else
  132. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 589068)--Distressed Merchant
  133. if Camp1MerchantSpawn ~=nil then
  134. Despawn(Camp1MerchantSpawn)
  135. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133781842)--Gratified Merchant
  136. AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
  137. else
  138. AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
  139. end
  140. end
  141. end
  142. function Camp1Reset(NPC)
  143. local zone = GetZone(NPC)
  144. local Camp1Object = GetSpawnByLocationID(zone, 170215)
  145. if Camp1Object~= nil then
  146. Despawn(Camp1Object)
  147. local Camp1ArkofPower = GetSpawnByLocationID(zone, 133781841)--Ark of Power
  148. if Camp1ArkofPower ~=nil then
  149. Despawn(Camp1ArkofPower)
  150. end
  151. local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133781842)--Gratified Merchant
  152. if Camp1GratifiedMerchant ~=nil then
  153. Despawn(Camp1GratifiedMerchant)
  154. end
  155. end
  156. end