9
3

agnollcampI.lua 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. --[[
  2. Script Name : SpawnScripts/Antonica/agnollcampI.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.01.31 04:01:16
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. Camp1Spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. ---Gnoll Camp
  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, 133781948) --Gnoll1 (shaman)
  20. else
  21. local Camp1Spawn1a = SpawnByLocationID(zone, 133781954) -- Gnoll1(battler)
  22. end
  23. local spawn2 = math.random(0,1)
  24. if spawn2 == 1 then
  25. local Camp1Spawn2 = SpawnByLocationID(zone, 133781949)--Gnoll2 (shaman)
  26. else
  27. local Camp1Spawn2a = SpawnByLocationID(zone, 133781955)-- Gnoll2(battler)
  28. end
  29. local spawn3 = math.random(0,1)
  30. if spawn3 == 1 then
  31. local Camp1Spawn3 = SpawnByLocationID(zone, 133781950)--Gnoll3 (shaman)
  32. else
  33. local Camp1Spawn3a = SpawnByLocationID(zone, 133781956)-- Gnoll3(battler)
  34. end
  35. local spawn4 = math.random(0,1)
  36. if spawn4 == 1 then
  37. local Camp1Spawn4 = SpawnByLocationID(zone, 133781951)--Gnoll4 (shaman)
  38. else
  39. local Camp1Spawn4a = SpawnByLocationID(zone, 133781957)-- Gnoll4(battler)
  40. end
  41. local spawn5 = math.random(0,1)
  42. if spawn5 == 1 then
  43. local Camp1Spawn5 = SpawnByLocationID(zone, 133781952)--Gnoll5 (shaman)
  44. else
  45. local Camp1Spawn5a = SpawnByLocationID(zone, 133781958)-- Gnoll5(battler)
  46. end
  47. local spawn6 = math.random(0,1)
  48. if spawn6 == 1 then
  49. local Camp1Spawn6 = SpawnByLocationID(zone, 133781953)--Gnoll6 (shaman)
  50. else
  51. local Camp1Spawn6a = SpawnByLocationID(zone, 133781959)-- Gnoll6(battler)
  52. end
  53. local MerchantSpawn = math.random(0,1)
  54. if MerchantSpawn == 1 then
  55. local Camp1MerchantSpawn = SpawnByLocationID(zone, 133781946)--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, 133781948)
  63. local Camp1Spawn1a = GetSpawnByLocationID(zone, 133781954)
  64. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133781949)
  65. local Camp1Spawn2a = GetSpawnByLocationID(zone, 133781955)
  66. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133781950)
  67. local Camp1Spawn3a = GetSpawnByLocationID(zone, 133781956)
  68. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133781951)
  69. local Camp1Spawn4a = GetSpawnByLocationID(zone, 133781957)
  70. local Camp1Spawn5 = GetSpawnByLocationID(zone, 133781952)
  71. local Camp1Spawn5a = GetSpawnByLocationID(zone, 133781958)
  72. local Camp1Spawn6 = GetSpawnByLocationID(zone, 133781953)
  73. local Camp1Spawn6a = GetSpawnByLocationID(zone, 133781959)
  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, 133781763)--elder 1
  93. local Camp1_Stage2Spawn2=SpawnByLocationID(zone, 133781760)--tormentor 1
  94. local Camp1_Stage2Spawn3=SpawnByLocationID(zone, 133781764)--elder 2
  95. local Camp1_Stage2Spawn4=SpawnByLocationID(zone, 133781761)--tormentor 2
  96. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  97. Attack(Camp1_Stage2Spawn1, Spawn)
  98. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  99. end
  100. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  101. local zone = GetZone(NPC)
  102. local Camp1_Stage2Spawn1=GetSpawnByLocationID(zone, 133781763)--elder 1
  103. local Camp1_Stage2Spawn2=GetSpawnByLocationID(zone, 133781760)--tormentor 1
  104. local Camp1_Stage2Spawn3=GetSpawnByLocationID(zone, 133781764)--elder 2
  105. local Camp1_Stage2Spawn4=GetSpawnByLocationID(zone, 133781761)--tormentor 2
  106. if IsAlive(Camp1_Stage2Spawn1) == true then
  107. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  108. elseif IsAlive(Camp1_Stage2Spawn2) == true then
  109. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  110. elseif IsAlive(Camp1_Stage2Spawn3) == true then
  111. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  112. elseif IsAlive(Camp1_Stage2Spawn4) == true then
  113. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  114. else
  115. AddTimer(NPC, 6000, "Camp1_Stage3")
  116. end
  117. end
  118. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  119. local zone = GetZone(NPC)
  120. local choice = math.random(0,100)
  121. if choice <=33 then -- % Chance for Boss to Spawn
  122. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133781762)--Pack Lord
  123. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  124. Attack(Camp1_Stage3Spawn1, Spawn)
  125. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  126. else -- Failed Boss Spawn
  127. local Camp1ArkofPower = SpawnByLocationID(zone, 133781945)--Ark of Power
  128. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133781946)--Distressed Merchant
  129. if Camp1MerchantSpawn ~=nil then
  130. Despawn(Camp1MerchantSpawn)
  131. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133781947)--Gratified Merchant
  132. AddTimer(NPC,90000,"Camp1Reset")
  133. else
  134. AddTimer(NPC,60000,"Camp1Reset")
  135. end
  136. end
  137. end
  138. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  139. local zone = GetZone(NPC)
  140. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133781762) --Pack Lord
  141. if IsAlive(Camp1_Stage2Spawn1) == true then
  142. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  143. else
  144. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133781946)--Distressed Merchant
  145. if Camp1MerchantSpawn ~=nil then
  146. Despawn(Camp1MerchantSpawn)
  147. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133781947)--Gratified Merchant
  148. AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
  149. else
  150. AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
  151. end
  152. end
  153. end
  154. function Camp1Reset(NPC)
  155. local zone = GetZone(NPC)
  156. local Camp1Object = GetSpawnByLocationID(zone, 195463)
  157. if Camp1Object~= nil then
  158. Despawn(Camp1Object)
  159. local Camp1ArkofPower = GetSpawnByLocationID(zone, 133781945)--Ark of Power
  160. if Camp1ArkofPower ~=nil then
  161. Despawn(Camp1ArkofPower)
  162. end
  163. local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133781947)--Gratified Merchant
  164. if Camp1GratifiedMerchant ~=nil then
  165. Despawn(Camp1GratifiedMerchant)
  166. end
  167. end
  168. end