aviperden.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. --[[
  2. Script Name : SpawnScripts/Antonica/aviperden.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.07.14 08:07:47
  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)==142365 then --Nest1
  16. Camp1Spawn(NPC)
  17. elseif GetSpawnLocationID(NPC)==133773880 then
  18. Camp2Spawn(NPC)
  19. elseif GetSpawnLocationID(NPC)==142363 then
  20. Camp3Spawn(NPC)
  21. elseif GetSpawnLocationID(NPC)==142367 then
  22. Camp4Spawn(NPC)
  23. end
  24. end
  25. --- CAMP 1
  26. function Camp1Spawn(NPC, Spawn) -- Stage 1
  27. local zone = GetZone(NPC)
  28. local Camp1Spawn1 = SpawnByLocationID(zone, 133773774)
  29. local Camp1Spawn2 = SpawnByLocationID(zone, 133773772)
  30. local Camp1Spawn3 = SpawnByLocationID(zone, 133773771)
  31. local Camp1Spawn4 = SpawnByLocationID(zone, 133773775)
  32. local Camp1Spawn5 = SpawnByLocationID(zone, 133773776)
  33. local Camp1Spawn6 = SpawnByLocationID(zone, 133773773)
  34. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  35. end
  36. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  37. local zone = GetZone(NPC)
  38. local Camp1Spawn1 = GetSpawnByLocationID(zone, 133773774)
  39. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133773772)
  40. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133773771)
  41. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133773775)
  42. local Camp1Spawn5 = GetSpawnByLocationID(zone, 133773776)
  43. local Camp1Spawn6 = GetSpawnByLocationID(zone, 133773773)
  44. if IsAlive(Camp1Spawn1) == true then
  45. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  46. elseif IsAlive(Camp1Spawn2) == true then
  47. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  48. elseif IsAlive(Camp1Spawn3) == true then
  49. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  50. elseif IsAlive(Camp1Spawn4) == true then
  51. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  52. elseif IsAlive(Camp1Spawn5) == true then
  53. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  54. elseif IsAlive(Camp1Spawn6) == true then
  55. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  56. else
  57. AddTimer(NPC, 6000, "Camp1_Stage2")
  58. end
  59. end
  60. function Camp1_Stage2(NPC, Spawn) --Stage 2
  61. local zone = GetZone(NPC)
  62. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 142389)--noxious viper
  63. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  64. Attack(Camp1_Stage2Spawn1, Spawn)
  65. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  66. end
  67. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  68. local zone = GetZone(NPC)
  69. local Camp1_Stage2Spawn1 = GetSpawnByLocationID(zone, 142389)
  70. if IsAlive(Camp1_Stage2Spawn1) == true then
  71. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  72. else
  73. AddTimer(NPC, 6000, "Camp1_Stage3")
  74. end
  75. end
  76. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  77. local zone = GetZone(NPC)
  78. local choice = math.random(0,100)
  79. if choice <=33 then -- % Chance for Boss to Spawn
  80. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133773777)--a Malevolent Viper
  81. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  82. Attack(Camp1_Stage3Spawn1, Spawn)
  83. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  84. else -- Failed Boss Spawn
  85. AddTimer(NPC,10000,"Camp1Reset")
  86. end
  87. end
  88. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  89. local zone = GetZone(NPC)
  90. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773777)
  91. if IsAlive(Camp1_Stage2Spawn1) == true then
  92. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  93. else
  94. AddTimer(NPC, 10000, "Camp1Reset")
  95. end
  96. end
  97. function Camp1Reset(NPC)
  98. local zone = GetZone(NPC)
  99. local Camp1Object = GetSpawnByLocationID(zone, 142365)
  100. if Camp1Object~= nil then
  101. Despawn(Camp1Object)
  102. end
  103. end
  104. --- CAMP 2
  105. function Camp2Spawn(NPC, Spawn) -- Stage 1
  106. local zone = GetZone(NPC)
  107. local Camp2Spawn1 = SpawnByLocationID(zone, 133773765)
  108. local Camp2Spawn2 = SpawnByLocationID(zone, 133773766)
  109. local Camp2Spawn3 = SpawnByLocationID(zone, 133773767)
  110. local Camp2Spawn4 = SpawnByLocationID(zone, 133773768)
  111. local Camp2Spawn5 = SpawnByLocationID(zone, 133773769)
  112. local Camp2Spawn6 = SpawnByLocationID(zone, 133773770)
  113. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1")
  114. end
  115. function Camp2SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  116. local zone = GetZone(NPC)
  117. local Camp2Spawn1 = GetSpawnByLocationID(zone, 133773765)
  118. local Camp2Spawn2 = GetSpawnByLocationID(zone, 133773766)
  119. local Camp2Spawn3 = GetSpawnByLocationID(zone, 133773767)
  120. local Camp2Spawn4 = GetSpawnByLocationID(zone, 133773768)
  121. local Camp2Spawn5 = GetSpawnByLocationID(zone, 133773769)
  122. local Camp2Spawn6 = GetSpawnByLocationID(zone, 133773770)
  123. if IsAlive(Camp2Spawn1) == true then
  124. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  125. elseif IsAlive(Camp2Spawn2) == true then
  126. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  127. elseif IsAlive(Camp2Spawn3) == true then
  128. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  129. elseif IsAlive(Camp2Spawn4) == true then
  130. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  131. elseif IsAlive(Camp2Spawn5) == true then
  132. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  133. elseif IsAlive(Camp2Spawn6) == true then
  134. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
  135. else
  136. AddTimer(NPC, 6000, "Camp2_Stage2")
  137. end
  138. end
  139. function Camp2_Stage2(NPC, Spawn) --Stage 2
  140. local zone = GetZone(NPC)
  141. local Camp2_Stage2Spawn1=SpawnByLocationID(zone, 142390)--a noxious viper
  142. FaceTarget(Camp2_Stage2Spawn1, Spawn)
  143. Attack(Camp2_Stage2Spawn1, Spawn)
  144. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2")
  145. end
  146. function Camp2SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  147. local zone = GetZone(NPC)
  148. local Camp2_Stage2Spawn1 = GetSpawnByLocationID(zone, 142390)
  149. if IsAlive(Camp2_Stage2Spawn1) == true then
  150. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2",1, Spawn)
  151. else
  152. AddTimer(NPC, 6000, "Camp2_Stage3")
  153. end
  154. end
  155. function Camp2_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  156. local zone = GetZone(NPC)
  157. local choice = math.random(0,100)
  158. if choice <=33 then -- % Chance for Boss to Spawn
  159. local Camp2_Stage3Spawn1=SpawnByLocationID(zone, 194957)--a Malevolent Viper
  160. FaceTarget(Camp2_Stage3Spawn1, Spawn)
  161. Attack(Camp2_Stage3Spawn1, Spawn)
  162. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3")
  163. else -- Failed Boss Spawn
  164. AddTimer(NPC,10000,"Camp2Reset")
  165. end
  166. end
  167. function Camp2SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  168. local zone = GetZone(NPC)
  169. local Camp2_Stage3Spawn1 = GetSpawnByLocationID(zone, 194957)
  170. if IsAlive(Camp2_Stage2Spawn1) == true then
  171. AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3",1,Spawn)
  172. else
  173. AddTimer(NPC, 10000, "Camp2Reset")
  174. end
  175. end
  176. function Camp2Reset(NPC)
  177. local zone = GetZone(NPC)
  178. local Camp2Object = GetSpawnByLocationID(zone, 133773880)
  179. if Camp2Object~= nil then
  180. Despawn(Camp2Object)
  181. end
  182. end
  183. --- CAMP 3
  184. function Camp3Spawn(NPC, Spawn) -- Stage 1
  185. local zone = GetZone(NPC)
  186. local Camp3Spawn1 = SpawnByLocationID(zone, 133773827)
  187. local Camp3Spawn2 = SpawnByLocationID(zone, 133773828)
  188. local Camp3Spawn3 = SpawnByLocationID(zone, 133773829)
  189. local Camp3Spawn4 = SpawnByLocationID(zone, 133773830)
  190. local Camp3Spawn5 = SpawnByLocationID(zone, 133773831)
  191. local Camp3Spawn6 = SpawnByLocationID(zone, 133773832)
  192. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1")
  193. end
  194. function Camp3SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  195. local zone = GetZone(NPC)
  196. local Camp3Spawn1 = GetSpawnByLocationID(zone, 133773827)
  197. local Camp3Spawn2 = GetSpawnByLocationID(zone, 133773828)
  198. local Camp3Spawn3 = GetSpawnByLocationID(zone, 133773829)
  199. local Camp3Spawn4 = GetSpawnByLocationID(zone, 133773830)
  200. local Camp3Spawn5 = GetSpawnByLocationID(zone, 133773831)
  201. local Camp3Spawn6 = GetSpawnByLocationID(zone, 133773832)
  202. if IsAlive(Camp3Spawn1) == true then
  203. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  204. elseif IsAlive(Camp3Spawn2) == true then
  205. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  206. elseif IsAlive(Camp3Spawn3) == true then
  207. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  208. elseif IsAlive(Camp3Spawn4) == true then
  209. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  210. elseif IsAlive(Camp3Spawn5) == true then
  211. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  212. elseif IsAlive(Camp3Spawn6) == true then
  213. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage1",1, Spawn)
  214. else
  215. AddTimer(NPC, 6000, "Camp3_Stage2")
  216. end
  217. end
  218. function Camp3_Stage2(NPC, Spawn) --Stage 2
  219. local zone = GetZone(NPC)
  220. local Camp3_Stage2Spawn1=SpawnByLocationID(zone, 133773834)--a noxious viper
  221. FaceTarget(Camp3_Stage2Spawn1, Spawn)
  222. Attack(Camp3_Stage2Spawn1, Spawn)
  223. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage2")
  224. end
  225. function Camp3SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  226. local zone = GetZone(NPC)
  227. local Camp3_Stage2Spawn1 = GetSpawnByLocationID(zone, 133773834)
  228. if IsAlive(Camp3_Stage2Spawn1) == true then
  229. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage2",1, Spawn)
  230. else
  231. AddTimer(NPC, 6000, "Camp3_Stage3")
  232. end
  233. end
  234. function Camp3_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  235. local zone = GetZone(NPC)
  236. local choice = math.random(0,100)
  237. if choice <=33 then -- % Chance for Boss to Spawn
  238. local Camp3_Stage3Spawn1=SpawnByLocationID(zone, 133773833)--Ta Malevolent Viper
  239. FaceTarget(Camp3_Stage3Spawn1, Spawn)
  240. Attack(Camp3_Stage3Spawn1, Spawn)
  241. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage3")
  242. else -- Failed Boss Spawn
  243. AddTimer(NPC,10000,"Camp3Reset")
  244. end
  245. end
  246. function Camp3SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  247. local zone = GetZone(NPC)
  248. local Camp3_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773833)
  249. if IsAlive(Camp3_Stage2Spawn1) == true then
  250. AddTimer(NPC,6000,"Camp3SpawnCheck_Stage3",1,Spawn)
  251. else
  252. AddTimer(NPC, 10000, "Camp3Reset")
  253. end
  254. end
  255. function Camp3Reset(NPC)
  256. local zone = GetZone(NPC)
  257. local Camp3Object = GetSpawnByLocationID(zone, 142363)
  258. if Camp3Object~= nil then
  259. Despawn(Camp3Object)
  260. end
  261. end
  262. --- CAMP 4
  263. function Camp4Spawn(NPC, Spawn) -- Stage 1
  264. local zone = GetZone(NPC)
  265. local Camp4Spawn1 = SpawnByLocationID(zone, 133773835)
  266. local Camp4Spawn2 = SpawnByLocationID(zone, 133773836)
  267. local Camp4Spawn3 = SpawnByLocationID(zone, 133773837)
  268. local Camp4Spawn4 = SpawnByLocationID(zone, 133773838)
  269. local Camp4Spawn5 = SpawnByLocationID(zone, 133773839)
  270. local Camp4Spawn6 = SpawnByLocationID(zone, 133773840)
  271. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1")
  272. end
  273. function Camp4SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  274. local zone = GetZone(NPC)
  275. local Camp4Spawn1 = GetSpawnByLocationID(zone, 133773835)
  276. local Camp4Spawn2 = GetSpawnByLocationID(zone, 133773836)
  277. local Camp4Spawn3 = GetSpawnByLocationID(zone, 133773837)
  278. local Camp4Spawn4 = GetSpawnByLocationID(zone, 133773838)
  279. local Camp4Spawn5 = GetSpawnByLocationID(zone, 133773839)
  280. local Camp4Spawn6 = GetSpawnByLocationID(zone, 133773840)
  281. if IsAlive(Camp4Spawn1) == true then
  282. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  283. elseif IsAlive(Camp4Spawn2) == true then
  284. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  285. elseif IsAlive(Camp4Spawn3) == true then
  286. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  287. elseif IsAlive(Camp4Spawn4) == true then
  288. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  289. elseif IsAlive(Camp4Spawn5) == true then
  290. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  291. elseif IsAlive(Camp4Spawn6) == true then
  292. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage1",1, Spawn)
  293. else
  294. AddTimer(NPC, 6000, "Camp4_Stage2")
  295. end
  296. end
  297. function Camp4_Stage2(NPC, Spawn) --Stage 2
  298. local zone = GetZone(NPC)
  299. local Camp4_Stage2Spawn1=SpawnByLocationID(zone, 142397)--a noxious viper
  300. FaceTarget(Camp4_Stage2Spawn1, Spawn)
  301. Attack(Camp4_Stage2Spawn1, Spawn)
  302. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage2")
  303. end
  304. function Camp4SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  305. local zone = GetZone(NPC)
  306. local Camp4_Stage2Spawn1 = GetSpawnByLocationID(zone, 142397)
  307. if IsAlive(Camp4_Stage2Spawn1) == true then
  308. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage2",1, Spawn)
  309. else
  310. AddTimer(NPC, 6000, "Camp4_Stage3")
  311. end
  312. end
  313. function Camp4_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  314. local zone = GetZone(NPC)
  315. local choice = math.random(0,100)
  316. if choice <=33 then -- % Chance for Boss to Spawn
  317. local Camp4_Stage3Spawn1=SpawnByLocationID(zone, 133773841)--Ta Malevolent Viper
  318. FaceTarget(Camp4_Stage3Spawn1, Spawn)
  319. Attack(Camp4_Stage3Spawn1, Spawn)
  320. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage3")
  321. else -- Failed Boss Spawn
  322. AddTimer(NPC,10000,"Camp4Reset")
  323. end
  324. end
  325. function Camp4SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  326. local zone = GetZone(NPC)
  327. local Camp4_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773841)
  328. if IsAlive(Camp4_Stage2Spawn1) == true then
  329. AddTimer(NPC,6000,"Camp4SpawnCheck_Stage3",1,Spawn)
  330. else
  331. AddTimer(NPC, 10000, "Camp4Reset")
  332. end
  333. end
  334. function Camp4Reset(NPC)
  335. local zone = GetZone(NPC)
  336. local Camp4Object = GetSpawnByLocationID(zone, 142367)
  337. if Camp4Object~= nil then
  338. Despawn(Camp4Object)
  339. end
  340. end