9
3

alarvaeinfestedcarcass.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. --[[
  2. Script Name : SpawnScripts/Antonica/alarvaeinfestedcarcass.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.07.17 05:07:01
  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)==592995 then --Carcass 1
  16. Camp1Spawn(NPC)
  17. elseif GetSpawnLocationID(NPC)==592996 then
  18. Camp2Spawn(NPC)
  19. elseif GetSpawnLocationID(NPC)==592993 then
  20. Camp3Spawn(NPC)
  21. elseif GetSpawnLocationID(NPC)==592994 then
  22. Camp4Spawn(NPC)
  23. elseif GetSpawnLocationID(NPC)==592992 then
  24. Camp5Spawn(NPC)
  25. end
  26. end
  27. --- CAMP 1
  28. function Camp1Spawn(NPC, Spawn) -- Stage 1
  29. local zone = GetZone(NPC)
  30. local Camp1Spawn1 = SpawnByLocationID(zone, 133773881)
  31. local Camp1Spawn2 = SpawnByLocationID(zone, 133773882)
  32. local Camp1Spawn3 = SpawnByLocationID(zone, 133773883)
  33. local Camp1Spawn4 = SpawnByLocationID(zone, 133773884)
  34. local Camp1Spawn5 = SpawnByLocationID(zone, 133773885)
  35. local Camp1Spawn6 = SpawnByLocationID(zone, 133773886)
  36. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  37. end
  38. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  39. local zone = GetZone(NPC)
  40. local Camp1Spawn1 = GetSpawnByLocationID(zone, 133773881)
  41. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133773882)
  42. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133773883)
  43. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133773884)
  44. local Camp1Spawn5 = GetSpawnByLocationID(zone, 133773885)
  45. local Camp1Spawn6 = GetSpawnByLocationID(zone, 133773886)
  46. if IsAlive(Camp1Spawn1) == true then
  47. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  48. elseif IsAlive(Camp1Spawn2) == true then
  49. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  50. elseif IsAlive(Camp1Spawn3) == true then
  51. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  52. elseif IsAlive(Camp1Spawn4) == true then
  53. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  54. elseif IsAlive(Camp1Spawn5) == true then
  55. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  56. elseif IsAlive(Camp1Spawn6) == true then
  57. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  58. else
  59. AddTimer(NPC, 6000, "Camp1_Stage2")
  60. end
  61. end
  62. function Camp1_Stage2(NPC, Spawn) --Stage 2
  63. local zone = GetZone(NPC)
  64. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 133773887)--klicnik prince
  65. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  66. Attack(Camp1_Stage2Spawn1, Spawn)
  67. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  68. end
  69. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  70. local zone = GetZone(NPC)
  71. local Camp1_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773887)
  72. if IsAlive(Camp1_Stage2Spawn1) == true then
  73. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  74. else
  75. AddTimer(NPC, 6000, "Camp1_Stage3")
  76. end
  77. end
  78. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  79. local zone = GetZone(NPC)
  80. local choice = math.random(0,100)
  81. if choice <=33 then -- % Chance for Boss to Spawn
  82. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133773888)--King Klicnik
  83. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  84. Attack(Camp1_Stage3Spawn1, Spawn)
  85. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  86. else -- Failed Boss Spawn
  87. AddTimer(NPC,10000,"Camp1Reset")
  88. end
  89. end
  90. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  91. local zone = GetZone(NPC)
  92. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773777)
  93. if IsAlive(Camp1_Stage2Spawn1) == true then
  94. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  95. else
  96. AddTimer(NPC, 10000, "Camp1Reset")
  97. end
  98. end
  99. function Camp1Reset(NPC)
  100. local zone = GetZone(NPC)
  101. local Camp1Object = GetSpawnByLocationID(zone, 592995)
  102. if Camp1Object~= nil then
  103. Despawn(Camp1Object)
  104. end
  105. end
  106. --- CAMP 2
  107. function Camp2Spawn(NPC, Spawn) -- Stage 1
  108. local zone = GetZone(NPC)
  109. local Camp2Spawn1 = SpawnByLocationID(zone, 133773893)
  110. local Camp2Spawn2 = SpawnByLocationID(zone, 133773894)
  111. local Camp2Spawn3 = SpawnByLocationID(zone, 133773895)
  112. local Camp2Spawn4 = SpawnByLocationID(zone, 133773896)
  113. local Camp2Spawn5 = SpawnByLocationID(zone, 133773897)
  114. local Camp2Spawn6 = SpawnByLocationID(zone, 133773898)
  115. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1")
  116. end
  117. function Camp2SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  118. local zone = GetZone(NPC)
  119. local Camp2Spawn1 = GetSpawnByLocationID(zone, 133773893)
  120. local Camp2Spawn2 = GetSpawnByLocationID(zone, 133773894)
  121. local Camp2Spawn3 = GetSpawnByLocationID(zone, 133773895)
  122. local Camp2Spawn4 = GetSpawnByLocationID(zone, 133773896)
  123. local Camp2Spawn5 = GetSpawnByLocationID(zone, 133773897)
  124. local Camp2Spawn6 = GetSpawnByLocationID(zone, 133773898)
  125. if IsAlive(Camp2Spawn1) == true then
  126. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  127. elseif IsAlive(Camp2Spawn2) == true then
  128. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  129. elseif IsAlive(Camp2Spawn3) == true then
  130. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  131. elseif IsAlive(Camp2Spawn4) == true then
  132. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  133. elseif IsAlive(Camp2Spawn5) == true then
  134. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  135. elseif IsAlive(Camp2Spawn6) == true then
  136. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  137. else
  138. AddTimer(NPC, 6000, "Camp2_Stage2")
  139. end
  140. end
  141. function Camp2_Stage2(NPC, Spawn) --Stage 2
  142. local zone = GetZone(NPC)
  143. local Camp2_Stage2Spawn1=SpawnByLocationID(zone, 133773892)--a klicnik prince
  144. FaceTarget(Camp2_Stage2Spawn1, Spawn)
  145. Attack(Camp2_Stage2Spawn1, Spawn)
  146. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2")
  147. end
  148. function Camp2SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  149. local zone = GetZone(NPC)
  150. local Camp2_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773892)
  151. if IsAlive(Camp2_Stage2Spawn1) == true then
  152. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2",1, Spawn)
  153. else
  154. AddTimer(NPC, 6000, "Camp2_Stage3")
  155. end
  156. end
  157. function Camp2_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  158. local zone = GetZone(NPC)
  159. local choice = math.random(0,100)
  160. if choice <=33 then -- % Chance for Boss to Spawn
  161. local Camp2_Stage3Spawn1=SpawnByLocationID(zone, 133773889)--King Klicnik
  162. FaceTarget(Camp2_Stage3Spawn1, Spawn)
  163. Attack(Camp2_Stage3Spawn1, Spawn)
  164. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3")
  165. else -- Failed Boss Spawn
  166. AddTimer(NPC,10000,"Camp2Reset")
  167. end
  168. end
  169. function Camp2SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  170. local zone = GetZone(NPC)
  171. local Camp2_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773889)
  172. if IsAlive(Camp2_Stage2Spawn1) == true then
  173. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3",1,Spawn)
  174. else
  175. AddTimer(NPC, 10000, "Camp2Reset")
  176. end
  177. end
  178. function Camp2Reset(NPC)
  179. local zone = GetZone(NPC)
  180. local Camp2Object = GetSpawnByLocationID(zone, 592996)
  181. if Camp2Object~= nil then
  182. Despawn(Camp2Object)
  183. end
  184. end
  185. --- CAMP 3
  186. function Camp3Spawn(NPC, Spawn) -- Stage 1
  187. local zone = GetZone(NPC)
  188. local Camp3Spawn1 = SpawnByLocationID(zone, 133773914)
  189. local Camp3Spawn2 = SpawnByLocationID(zone, 133773915)
  190. local Camp3Spawn3 = SpawnByLocationID(zone, 133773916)
  191. local Camp3Spawn4 = SpawnByLocationID(zone, 133773917)
  192. local Camp3Spawn5 = SpawnByLocationID(zone, 133773918)
  193. local Camp3Spawn6 = SpawnByLocationID(zone, 133773919)
  194. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1")
  195. end
  196. function Camp3SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  197. local zone = GetZone(NPC)
  198. local Camp3Spawn1 = GetSpawnByLocationID(zone, 133773914)
  199. local Camp3Spawn2 = GetSpawnByLocationID(zone, 133773915)
  200. local Camp3Spawn3 = GetSpawnByLocationID(zone, 133773916)
  201. local Camp3Spawn4 = GetSpawnByLocationID(zone, 133773917)
  202. local Camp3Spawn5 = GetSpawnByLocationID(zone, 133773918)
  203. local Camp3Spawn6 = GetSpawnByLocationID(zone, 133773919)
  204. if IsAlive(Camp3Spawn1) == true then
  205. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  206. elseif IsAlive(Camp3Spawn2) == true then
  207. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  208. elseif IsAlive(Camp3Spawn3) == true then
  209. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  210. elseif IsAlive(Camp3Spawn4) == true then
  211. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  212. elseif IsAlive(Camp3Spawn5) == true then
  213. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  214. elseif IsAlive(Camp3Spawn6) == true then
  215. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  216. else
  217. AddTimer(NPC, 6000, "Camp3_Stage2")
  218. end
  219. end
  220. function Camp3_Stage2(NPC, Spawn) --Stage 2
  221. local zone = GetZone(NPC)
  222. local Camp3_Stage2Spawn1=SpawnByLocationID(zone, 133773920)--a klicnik prince
  223. FaceTarget(Camp3_Stage2Spawn1, Spawn)
  224. Attack(Camp3_Stage2Spawn1, Spawn)
  225. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage2")
  226. end
  227. function Camp3SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  228. local zone = GetZone(NPC)
  229. local Camp3_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773920)
  230. if IsAlive(Camp3_Stage2Spawn1) == true then
  231. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage2",1, Spawn)
  232. else
  233. AddTimer(NPC, 6000, "Camp3_Stage3")
  234. end
  235. end
  236. function Camp3_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  237. local zone = GetZone(NPC)
  238. local choice = math.random(0,100)
  239. if choice <=33 then -- % Chance for Boss to Spawn
  240. local Camp3_Stage3Spawn1=SpawnByLocationID(zone, 133773913)--King Klicnik
  241. FaceTarget(Camp3_Stage3Spawn1, Spawn)
  242. Attack(Camp3_Stage3Spawn1, Spawn)
  243. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage3")
  244. else -- Failed Boss Spawn
  245. AddTimer(NPC,10000,"Camp3Reset")
  246. end
  247. end
  248. function Camp3SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  249. local zone = GetZone(NPC)
  250. local Camp3_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773913)
  251. if IsAlive(Camp3_Stage2Spawn1) == true then
  252. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage3",1,Spawn)
  253. else
  254. AddTimer(NPC, 10000, "Camp3Reset")
  255. end
  256. end
  257. function Camp3Reset(NPC)
  258. local zone = GetZone(NPC)
  259. local Camp3Object = GetSpawnByLocationID(zone, 592993)
  260. if Camp3Object~= nil then
  261. Despawn(Camp3Object)
  262. end
  263. end
  264. --- CAMP 4
  265. function Camp4Spawn(NPC, Spawn) -- Stage 1
  266. local zone = GetZone(NPC)
  267. local Camp4Spawn1 = SpawnByLocationID(zone, 133773899)
  268. local Camp4Spawn2 = SpawnByLocationID(zone, 133773900)
  269. local Camp4Spawn3 = SpawnByLocationID(zone, 133773901)
  270. local Camp4Spawn4 = SpawnByLocationID(zone, 133773902)
  271. local Camp4Spawn5 = SpawnByLocationID(zone, 133773903)
  272. local Camp4Spawn6 = SpawnByLocationID(zone, 133773904)
  273. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1")
  274. end
  275. function Camp4SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  276. local zone = GetZone(NPC)
  277. local Camp4Spawn1 = GetSpawnByLocationID(zone, 133773899)
  278. local Camp4Spawn2 = GetSpawnByLocationID(zone, 133773900)
  279. local Camp4Spawn3 = GetSpawnByLocationID(zone, 133773901)
  280. local Camp4Spawn4 = GetSpawnByLocationID(zone, 133773902)
  281. local Camp4Spawn5 = GetSpawnByLocationID(zone, 133773903)
  282. local Camp4Spawn6 = GetSpawnByLocationID(zone, 133773904)
  283. if IsAlive(Camp4Spawn1) == true then
  284. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  285. elseif IsAlive(Camp4Spawn2) == true then
  286. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  287. elseif IsAlive(Camp4Spawn3) == true then
  288. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  289. elseif IsAlive(Camp4Spawn4) == true then
  290. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  291. elseif IsAlive(Camp4Spawn5) == true then
  292. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  293. elseif IsAlive(Camp4Spawn6) == true then
  294. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  295. else
  296. AddTimer(NPC, 6000, "Camp4_Stage2")
  297. end
  298. end
  299. function Camp4_Stage2(NPC, Spawn) --Stage 2
  300. local zone = GetZone(NPC)
  301. local Camp4_Stage2Spawn1=SpawnByLocationID(zone, 133773891)--a klicnik prince
  302. FaceTarget(Camp4_Stage2Spawn1, Spawn)
  303. Attack(Camp4_Stage2Spawn1, Spawn)
  304. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage2")
  305. end
  306. function Camp4SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  307. local zone = GetZone(NPC)
  308. local Camp4_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773891)
  309. if IsAlive(Camp4_Stage2Spawn1) == true then
  310. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage2",1, Spawn)
  311. else
  312. AddTimer(NPC, 6000, "Camp4_Stage3")
  313. end
  314. end
  315. function Camp4_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  316. local zone = GetZone(NPC)
  317. local choice = math.random(0,100)
  318. if choice <=33 then -- % Chance for Boss to Spawn
  319. local Camp4_Stage3Spawn1=SpawnByLocationID(zone, 133773890)--King Klicnik
  320. FaceTarget(Camp4_Stage3Spawn1, Spawn)
  321. Attack(Camp4_Stage3Spawn1, Spawn)
  322. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage3")
  323. else -- Failed Boss Spawn
  324. AddTimer(NPC,10000,"Camp4Reset")
  325. end
  326. end
  327. function Camp4SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  328. local zone = GetZone(NPC)
  329. local Camp4_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773890)
  330. if IsAlive(Camp4_Stage2Spawn1) == true then
  331. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage3",1,Spawn)
  332. else
  333. AddTimer(NPC, 10000, "Camp4Reset")
  334. end
  335. end
  336. function Camp4Reset(NPC)
  337. local zone = GetZone(NPC)
  338. local Camp4Object = GetSpawnByLocationID(zone, 592994)
  339. if Camp4Object~= nil then
  340. Despawn(Camp4Object)
  341. end
  342. end
  343. --- CAMP 5
  344. function Camp5Spawn(NPC, Spawn) -- Stage 1
  345. local zone = GetZone(NPC)
  346. local Camp5Spawn1 = SpawnByLocationID(zone, 133773905)
  347. local Camp5Spawn2 = SpawnByLocationID(zone, 133773906)
  348. local Camp5Spawn3 = SpawnByLocationID(zone, 133773907)
  349. local Camp5Spawn4 = SpawnByLocationID(zone, 133773908)
  350. local Camp5Spawn5 = SpawnByLocationID(zone, 133773909)
  351. local Camp5Spawn6 = SpawnByLocationID(zone, 133773910)
  352. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1")
  353. end
  354. function Camp5SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  355. local zone = GetZone(NPC)
  356. local Camp5Spawn1 = GetSpawnByLocationID(zone, 133773905)
  357. local Camp5Spawn2 = GetSpawnByLocationID(zone, 133773906)
  358. local Camp5Spawn3 = GetSpawnByLocationID(zone, 133773907)
  359. local Camp5Spawn4 = GetSpawnByLocationID(zone, 133773908)
  360. local Camp5Spawn5 = GetSpawnByLocationID(zone, 133773909)
  361. local Camp5Spawn6 = GetSpawnByLocationID(zone, 133773910)
  362. if IsAlive(Camp5Spawn1) == true then
  363. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  364. elseif IsAlive(Camp5Spawn2) == true then
  365. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  366. elseif IsAlive(Camp5Spawn3) == true then
  367. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  368. elseif IsAlive(Camp5Spawn4) == true then
  369. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  370. elseif IsAlive(Camp5Spawn5) == true then
  371. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  372. elseif IsAlive(Camp5Spawn6) == true then
  373. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage1",1, Spawn)
  374. else
  375. AddTimer(NPC, 6000, "Camp5_Stage2")
  376. end
  377. end
  378. function Camp5_Stage2(NPC, Spawn) --Stage 2
  379. local zone = GetZone(NPC)
  380. local Camp5_Stage2Spawn1=SpawnByLocationID(zone, 133773911)--a klicnik prince
  381. FaceTarget(Camp5_Stage2Spawn1, Spawn)
  382. Attack(Camp5_Stage2Spawn1, Spawn)
  383. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage2")
  384. end
  385. function Camp5SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  386. local zone = GetZone(NPC)
  387. local Camp5_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773911)
  388. if IsAlive(Camp5_Stage2Spawn1) == true then
  389. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage2",1, Spawn)
  390. else
  391. AddTimer(NPC, 6000, "Camp5_Stage3")
  392. end
  393. end
  394. function Camp5_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  395. local zone = GetZone(NPC)
  396. local choice = math.random(0,100)
  397. if choice <=33 then -- % Chance for Boss to Spawn
  398. local Camp5_Stage3Spawn1=SpawnByLocationID(zone, 133773912)--King Klicnik
  399. FaceTarget(Camp5_Stage3Spawn1, Spawn)
  400. Attack(Camp5_Stage3Spawn1, Spawn)
  401. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage3")
  402. else -- Failed Boss Spawn
  403. AddTimer(NPC,10000,"Camp5Reset")
  404. end
  405. end
  406. function Camp5SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  407. local zone = GetZone(NPC)
  408. local Camp5_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773912)
  409. if IsAlive(Camp5_Stage2Spawn1) == true then
  410. AddTimer(NPC,6000,"Camp5SpawnCheck_Stage3",1,Spawn)
  411. else
  412. AddTimer(NPC, 10000, "Camp5Reset")
  413. end
  414. end
  415. function Camp5Reset(NPC)
  416. local zone = GetZone(NPC)
  417. local Camp5Object = GetSpawnByLocationID(zone, 592992)
  418. if Camp5Object~= nil then
  419. Despawn(Camp5Object)
  420. end
  421. end