9
3

agnollcampN.lua 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. --[[
  2. Script Name : SpawnScripts/Antonica/agnollcampN.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.03.23 08:03:31
  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, 133782944) --Gnoll1 (shaman)
  20. else
  21. local Camp1Spawn1a = SpawnByLocationID(zone, 133782948) -- Gnoll1(battler)
  22. end
  23. local spawn2 = math.random(0,1)
  24. if spawn2 == 1 then
  25. local Camp1Spawn2 = SpawnByLocationID(zone, 133782945)--Gnoll2 (shaman)
  26. else
  27. local Camp1Spawn2a = SpawnByLocationID(zone, 133782949)-- Gnoll2(battler)
  28. end
  29. local spawn3 = math.random(0,1)
  30. if spawn3 == 1 then
  31. local Camp1Spawn3 = SpawnByLocationID(zone, 133782946)--Gnoll3 (shaman)
  32. else
  33. local Camp1Spawn3a = SpawnByLocationID(zone, 133782950)-- Gnoll3(battler)
  34. end
  35. local spawn4 = math.random(0,1)
  36. if spawn4 == 1 then
  37. local Camp1Spawn4 = SpawnByLocationID(zone, 133782947)--Gnoll4 (shaman)
  38. else
  39. local Camp1Spawn4a = SpawnByLocationID(zone, 133782951)-- Gnoll4(battler)
  40. end
  41. local MerchantSpawn = math.random(0,1)
  42. if MerchantSpawn == 1 then
  43. local Camp1MerchantSpawn = SpawnByLocationID(zone, 133782957)--Distressed Merchant
  44. else
  45. end
  46. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
  47. end
  48. function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  49. local zone = GetZone(NPC)
  50. local Camp1Spawn1 = GetSpawnByLocationID(zone, 133782944)
  51. local Camp1Spawn1a = GetSpawnByLocationID(zone, 133782948)
  52. local Camp1Spawn2 = GetSpawnByLocationID(zone, 133782945)
  53. local Camp1Spawn2a = GetSpawnByLocationID(zone, 133782949)
  54. local Camp1Spawn3 = GetSpawnByLocationID(zone, 133782946)
  55. local Camp1Spawn3a = GetSpawnByLocationID(zone, 133782950)
  56. local Camp1Spawn4 = GetSpawnByLocationID(zone, 133782947)
  57. local Camp1Spawn4a = GetSpawnByLocationID(zone, 133782951)
  58. if IsAlive(Camp1Spawn1) == true or IsAlive(Camp1Spawn1a) == true then
  59. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  60. elseif IsAlive(Camp1Spawn2) == true or IsAlive(Camp1Spawn2a) == true then
  61. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  62. elseif IsAlive(Camp1Spawn3) == true or IsAlive(Camp1Spawn3a) == true then
  63. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  64. elseif IsAlive(Camp1Spawn4) == true or IsAlive(Camp1Spawn4a) == true then
  65. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
  66. else
  67. AddTimer(NPC, 6000, "Camp1_Stage2")
  68. end
  69. end
  70. function Camp1_Stage2(NPC, Spawn) --Stage 2
  71. local zone = GetZone(NPC)
  72. local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 133782952)--elder 1
  73. local Camp1_Stage2Spawn2=SpawnByLocationID(zone, 133782954)--tormentor 1
  74. local Camp1_Stage2Spawn3=SpawnByLocationID(zone, 133782953)--elder 2
  75. local Camp1_Stage2Spawn4=SpawnByLocationID(zone, 133782955)--tormentor 2
  76. FaceTarget(Camp1_Stage2Spawn1, Spawn)
  77. Attack(Camp1_Stage2Spawn1, Spawn)
  78. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
  79. end
  80. function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  81. local zone = GetZone(NPC)
  82. local Camp1_Stage2Spawn1=GetSpawnByLocationID(zone, 133782952)--elder 1
  83. local Camp1_Stage2Spawn2=GetSpawnByLocationID(zone, 133782954)--tormentor 1
  84. local Camp1_Stage2Spawn3=GetSpawnByLocationID(zone, 133782953)--elder 2
  85. local Camp1_Stage2Spawn4=GetSpawnByLocationID(zone, 133782955)--tormentor 2
  86. if IsAlive(Camp1_Stage2Spawn1) == true then
  87. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  88. elseif IsAlive(Camp1_Stage2Spawn2) == true then
  89. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  90. elseif IsAlive(Camp1_Stage2Spawn3) == true then
  91. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  92. elseif IsAlive(Camp1_Stage2Spawn4) == true then
  93. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
  94. else
  95. AddTimer(NPC, 6000, "Camp1_Stage3")
  96. end
  97. end
  98. function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
  99. local zone = GetZone(NPC)
  100. local choice = math.random(0,100)
  101. if choice <=33 then -- % Chance for Boss to Spawn
  102. local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133782956)--Pack Lord
  103. FaceTarget(Camp1_Stage3Spawn1, Spawn)
  104. Attack(Camp1_Stage3Spawn1, Spawn)
  105. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  106. else -- Failed Boss Spawn
  107. local Camp1ArkofPower = SpawnByLocationID(zone, 133782959)--Ark of Power
  108. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133782957)--Distressed Merchant
  109. if Camp1MerchantSpawn ~=nil then
  110. Despawn(Camp1MerchantSpawn)
  111. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133782958)--Gratified Merchant
  112. AddTimer(NPC,90000,"Camp1Reset")
  113. else
  114. AddTimer(NPC,60000,"Camp1Reset")
  115. end
  116. end
  117. end
  118. function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
  119. local zone = GetZone(NPC)
  120. local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133782956) --Pack Lord
  121. if IsAlive(Camp1_Stage2Spawn1) == true then
  122. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
  123. else
  124. local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 133782957)--Distressed Merchant
  125. if Camp1MerchantSpawn ~=nil then
  126. Despawn(Camp1MerchantSpawn)
  127. local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133782958)--Gratified Merchant
  128. AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
  129. else
  130. AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
  131. end
  132. end
  133. end
  134. function Camp1Reset(NPC)
  135. local zone = GetZone(NPC)
  136. local Camp1Object = GetSpawnByLocationID(zone, 621212)
  137. if Camp1Object~= nil then
  138. Despawn(Camp1Object)
  139. local Camp1ArkofPower = GetSpawnByLocationID(zone, 133782959)--Ark of Power
  140. if Camp1ArkofPower ~=nil then
  141. Despawn(Camp1ArkofPower)
  142. end
  143. local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133782958)--Gratified Merchant
  144. if Camp1GratifiedMerchant ~=nil then
  145. Despawn(Camp1GratifiedMerchant)
  146. end
  147. end
  148. end