agnollcampB.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. --[[
  2. Script Name : SpawnScripts/Antonica/agnollcampB.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.07.21 09:07:12
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. CampSpawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function CampSpawn(NPC)
  15. if GetSpawnLocationID(NPC)==170218 then --GnollCamp1
  16. Camp1Spawn(NPC)
  17. elseif GetSpawnLocationID(NPC)==591701 then--GnollCamp2
  18. Camp2Spawn(NPC)
  19. end
  20. end
  21. --- CAMP 1
  22. function Camp1Spawn(NPC, Spawn) -- Stage 1
  23. local zone = GetZone(NPC)
  24. local spawn1 = math.random(0,1)
  25. if spawn1 == 1 then
  26. local Camp1Spawn1 = SpawnByLocationID(zone, 133774053) --Gnoll1 (mystic)
  27. else
  28. local Camp1Spawn1a = SpawnByLocationID(zone, 133774045) -- Gnoll1(youth)
  29. end
  30. local spawn2 = math.random(0,1)
  31. if spawn2 == 1 then
  32. local Camp1Spawn2 = SpawnByLocationID(zone, 133774048)--Gnoll2 (mystic)
  33. else
  34. local Camp1Spawn2a = SpawnByLocationID(zone, 133774047)-- Gnoll2(youth)
  35. end
  36. local spawn3 = math.random(0,1)
  37. if spawn3 == 1 then
  38. local Camp1Spawn3 = SpawnByLocationID(zone, 133774049)--Gnoll3 (mystic)
  39. else
  40. local Camp1Spawn3a = SpawnByLocationID(zone, 133774043)-- Gnoll3(youth)
  41. end
  42. local spawn4 = math.random(0,1)
  43. if spawn4 == 1 then
  44. local Camp1Spawn4 = SpawnByLocationID(zone, 133774050)--Gnoll4 (mystic)
  45. else
  46. local Camp1Spawn4a = SpawnByLocationID(zone, 133774044)-- Gnoll4(youth)
  47. end
  48. local spawn5 = math.random(0,1)
  49. if spawn5 == 1 then
  50. local Camp1Spawn5 = SpawnByLocationID(zone, 133774051)--Gnoll5 (mystic)
  51. else
  52. local Camp1Spawn5a = SpawnByLocationID(zone, 133774042)-- Gnoll5(youth)
  53. end
  54. local spawn6 = math.random(0,1)
  55. if spawn6 == 1 then
  56. local Camp1Spawn6 = SpawnByLocationID(zone, 133774052)--Gnoll6 (mystic)
  57. else
  58. local Camp1Spawn6a = SpawnByLocationID(zone, 133774046)-- Gnoll6(youth)
  59. end
  60. local MerchantSpawn = math.random(0,1)
  61. if MerchantSpawn == 1 then
  62. local Camp1MerchantSpawn = SpawnByLocationID(zone, 134640)--Distressed Merchant
  63. else
  64. end
  65. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  66. end
  67. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  68. local zone = GetZone(NPC)
  69. local Camp1Spawn1 = GetSpawnByLocationID(zone, 133773815)
  70. local Camp1Spawn1a = GetSpawnByLocationID(zone, 133773937)
  71. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133773817)
  72. local Camp1Spawn2a = GetSpawnByLocationID(zone, 133773935)
  73. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133773812)
  74. local Camp1Spawn3a = GetSpawnByLocationID(zone, 133773933)
  75. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133773816)
  76. local Camp1Spawn4a = GetSpawnByLocationID(zone, 133773936)
  77. local Camp1Spawn5 = GetSpawnByLocationID(zone, 133773932)
  78. local Camp1Spawn5a = GetSpawnByLocationID(zone, 133773813)
  79. local Camp1Spawn6 = GetSpawnByLocationID(zone, 133773934)
  80. local Camp1Spawn6a = GetSpawnByLocationID(zone, 133773814)
  81. if IsAlive(Camp1Spawn1) == true or IsAlive(Camp1Spawn1a) == true then
  82. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  83. elseif IsAlive(Camp1Spawn2) == true or IsAlive(Camp1Spawn2a) == true then
  84. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  85. elseif IsAlive(Camp1Spawn3) == true or IsAlive(Camp1Spawn3a) == true then
  86. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  87. elseif IsAlive(Camp1Spawn4) == true or IsAlive(Camp1Spawn4a) == true then
  88. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  89. elseif IsAlive(Camp1Spawn5) == true or IsAlive(Camp1Spawn5a) == true then
  90. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  91. elseif IsAlive(Camp1Spawn6) == true or IsAlive(Camp1Spawn6a) == true then
  92. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  93. else
  94. AddTimer(NPC, 6000, "Camp1_Stage2")
  95. end
  96. end
  97. function Camp1_Stage2(NPC, Spawn) --Stage 2
  98. local zone = GetZone(NPC)
  99. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 190452)--darkpack pack leader
  100. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  101. Attack(Camp1_Stage2Spawn1, Spawn)
  102. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  103. end
  104. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  105. local zone = GetZone(NPC)
  106. local Camp1_Stage2Spawn1 = GetSpawnByLocationID(zone, 190452)
  107. if IsAlive(Camp1_Stage2Spawn1) == true then
  108. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  109. else
  110. AddTimer(NPC, 6000, "Camp1_Stage3")
  111. end
  112. end
  113. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  114. local zone = GetZone(NPC)
  115. local choice = math.random(0,100)
  116. if choice <=33 then -- % Chance for Boss to Spawn
  117. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133773818)--Sarkin
  118. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  119. Attack(Camp1_Stage3Spawn1, Spawn)
  120. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  121. else -- Failed Boss Spawn
  122. local Camp1ArkofPower = SpawnByLocationID(zone, 133773939)--Ark of Power
  123. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 134655)--Distressed Merchant
  124. if Camp1MerchantSpawn ~=nil then
  125. Despawn(Camp1MerchantSpawn)
  126. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
  127. AddTimer(NPC,90000,"Camp1Reset")
  128. else
  129. AddTimer(NPC,60000,"Camp1Reset")
  130. end
  131. end
  132. end
  133. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  134. local zone = GetZone(NPC)
  135. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773818) --Sarkin
  136. if IsAlive(Camp1_Stage2Spawn1) == true then
  137. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  138. else
  139. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 134655)--Distressed Merchant
  140. if Camp1MerchantSpawn ~=nil then
  141. Despawn(Camp1MerchantSpawn)
  142. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
  143. AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
  144. else
  145. AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
  146. end
  147. end
  148. end
  149. function Camp1Reset(NPC)
  150. local zone = GetZone(NPC)
  151. local Camp1Object = GetSpawnByLocationID(zone, 591698)
  152. if Camp1Object~= nil then
  153. Despawn(Camp1Object)
  154. local Camp1ArkofPower = GetSpawnByLocationID(zone, 133773939)--Ark of Power
  155. if Camp1ArkofPower ~=nil then
  156. Despawn(Camp1ArkofPower)
  157. end
  158. local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133773938)--Gratified Merchant
  159. if Camp1GratifiedMerchant ~=nil then
  160. Despawn(Camp1GratifiedMerchant)
  161. end
  162. end
  163. end
  164. --- CAMP 2
  165. function Camp2Spawn(NPC, Spawn) -- Stage 1
  166. local zone = GetZone(NPC)
  167. local Camp2Object2 = SpawnByLocationID(zone, 170244)
  168. local spawn1 = math.random(0,1)
  169. if spawn1 == 1 then
  170. local Camp2Spawn1 = SpawnByLocationID(zone, 133773943) --Gnoll1 (mystic)
  171. else
  172. local Camp2Spawn1a = SpawnByLocationID(zone, 133773809) -- Gnoll1(youth)
  173. end
  174. local spawn2 = math.random(0,1)
  175. if spawn2 == 1 then
  176. local Camp2Spawn2 = SpawnByLocationID(zone, 133773946)--Gnoll2 (mystic)
  177. else
  178. local Camp2Spawn2a = SpawnByLocationID(zone, 133773806)-- Gnoll2(youth)
  179. end
  180. local spawn3 = math.random(0,1)
  181. if spawn3 == 1 then
  182. local Camp1Spawn3 = SpawnByLocationID(zone, 133773810)--Gnoll3 (mystic)
  183. else
  184. local Camp1Spawn3a = SpawnByLocationID(zone, 133773944)-- Gnoll3(youth)
  185. end
  186. local spawn4 = math.random(0,1)
  187. if spawn4 == 1 then
  188. local Camp2Spawn4 = SpawnByLocationID(zone, 133773945)--Gnoll4 (mystic)
  189. else
  190. local Camp2Spawn4a = SpawnByLocationID(zone, 133773807)-- Gnoll4(youth)
  191. end
  192. local spawn5 = math.random(0,1)
  193. if spawn5 == 1 then
  194. local Camp2Spawn5 = SpawnByLocationID(zone, 133773808)--Gnoll5 (mystic)
  195. else
  196. local Camp2Spawn5a = SpawnByLocationID(zone, 133773942)-- Gnoll5(youth)
  197. end
  198. local spawn6 = math.random(0,1)
  199. if spawn6 == 1 then
  200. local Camp2Spawn6 = SpawnByLocationID(zone, 133773947)--Gnoll6 (mystic)
  201. else
  202. local Camp2Spawn6a = SpawnByLocationID(zone, 133773805)-- Gnoll6(youth)
  203. end
  204. local MerchantSpawn = math.random(0,1)
  205. if MerchantSpawn == 1 then
  206. local Camp2MerchantSpawn = SpawnByLocationID(zone, 133773948)--Distressed Merchant
  207. else
  208. end
  209. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1")
  210. end
  211. function Camp2SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  212. local zone = GetZone(NPC)
  213. local Camp2Spawn1 = GetSpawnByLocationID(zone, 133773943)
  214. local Camp2Spawn1a = GetSpawnByLocationID(zone, 133773809)
  215. local Camp2Spawn2 = GetSpawnByLocationID(zone, 133773946)
  216. local Camp2Spawn2a = GetSpawnByLocationID(zone, 133773806)
  217. local Camp2Spawn3 = GetSpawnByLocationID(zone, 133773810)
  218. local Camp2Spawn3a = GetSpawnByLocationID(zone, 133773944)
  219. local Camp2Spawn4 = GetSpawnByLocationID(zone, 133773945)
  220. local Camp2Spawn4a = GetSpawnByLocationID(zone, 133773807)
  221. local Camp2Spawn5 = GetSpawnByLocationID(zone, 133773808)
  222. local Camp2Spawn5a = GetSpawnByLocationID(zone, 133773942)
  223. local Camp2Spawn6 = GetSpawnByLocationID(zone, 133773947)
  224. local Camp2Spawn6a = GetSpawnByLocationID(zone, 133773805)
  225. if IsAlive(Camp2Spawn1) == true or IsAlive(Camp2Spawn1a) == true then
  226. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  227. elseif IsAlive(Camp2Spawn2) == true or IsAlive(Camp2Spawn2a) == true then
  228. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  229. elseif IsAlive(Camp2Spawn3) == true or IsAlive(Camp2Spawn3a) == true then
  230. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  231. elseif IsAlive(Camp2Spawn4) == true or IsAlive(Camp2Spawn4a) == true then
  232. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  233. elseif IsAlive(Camp2Spawn5) == true or IsAlive(Camp2Spawn5a) == true then
  234. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  235. elseif IsAlive(Camp2Spawn6) == true or IsAlive(Camp2Spawn6a) == true then
  236. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  237. else
  238. AddTimer(NPC, 6000, "Camp2_Stage2")
  239. end
  240. end
  241. function Camp2_Stage2(NPC, Spawn) --Stage 2
  242. local zone = GetZone(NPC)
  243. local Camp2_Stage2Spawn1=SpawnByLocationID(zone, 190461)--darkpack pack leader
  244. FaceTarget(Camp2_Stage2Spawn1, Spawn)
  245. Attack(Camp2_Stage2Spawn1, Spawn)
  246. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2")
  247. end
  248. function Camp2SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  249. local zone = GetZone(NPC)
  250. local Camp2_Stage2Spawn1 = GetSpawnByLocationID(zone, 190461)
  251. if IsAlive(Camp2_Stage2Spawn1) == true then
  252. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2",1, Spawn)
  253. else
  254. AddTimer(NPC, 6000, "Camp2_Stage3")
  255. end
  256. end
  257. function Camp2_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  258. local zone = GetZone(NPC)
  259. local choice = math.random(0,100)
  260. if choice <=33 then -- % Chance for Boss to Spawn
  261. local Camp2_Stage3Spawn1=SpawnByLocationID(zone, 133773811)--Tark
  262. FaceTarget(Camp2_Stage3Spawn1, Spawn)
  263. Attack(Camp2_Stage3Spawn1, Spawn)
  264. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3")
  265. else -- Failed Boss Spawn
  266. local Camp2ArkofPower = SpawnByLocationID(zone, 133773940)--Ark of Power
  267. local Camp2MerchantSpawn = GetSpawnByLocationID(zone, 133773948)--Distressed Merchant
  268. if Camp2MerchantSpawn ~=nil then
  269. Despawn(Camp2MerchantSpawn)
  270. local Camp2GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
  271. AddTimer(NPC,90000,"Camp2Reset")
  272. else
  273. AddTimer(NPC,60000,"Camp2Reset")
  274. end
  275. end
  276. end
  277. function Camp2SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  278. local zone = GetZone(NPC)
  279. local Camp2_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773811)
  280. if IsAlive(Camp2_Stage2Spawn1) == true then
  281. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3",1,Spawn)
  282. else
  283. local Camp2MerchantSpawn = GetSpawnByLocationID(zone, 133773948)--Distressed Merchant
  284. if Camp2MerchantSpawn ~=nil then
  285. Despawn(Camp2MerchantSpawn)
  286. local Camp2GratifiedMerchant = SpawnByLocationID(zone, 133773941)--Gratified Merchant
  287. AddTimer(NPC, 90000, "Camp2Reset",1,Spawn)
  288. else
  289. AddTimer(NPC, 10000, "Camp2Reset",1,Spawn)
  290. end
  291. end
  292. end
  293. function Camp2Reset(NPC)
  294. local zone = GetZone(NPC)
  295. local Camp2Object = GetSpawnByLocationID(zone, 591701)
  296. local Camp2Object2 = GetSpawnByLocationID(zone, 170244)
  297. if Camp2Object~= nil then
  298. Despawn(Camp2Object)
  299. end
  300. if Camp2Object2~= nil then
  301. Despawn(Camp2Object2)
  302. end
  303. local Camp2ArkofPower = GetSpawnByLocationID(zone, 133773940)--Ark of Power
  304. if Camp2ArkofPower ~=nil then
  305. Despawn(Camp2ArkofPower)
  306. end
  307. local Camp2GratifiedMerchant = GetSpawnByLocationID(zone, 133773941)--Gratified Merchant
  308. if Camp2GratifiedMerchant ~=nil then
  309. Despawn(Camp2GratifiedMerchant)
  310. end
  311. end