123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- --[[
- Script Name : SpawnScripts/Antonica/agnollcampB.lua
- Script Author : LordPazuzu
- Script Date : 2022.07.21 09:07:12
- Script Purpose :
- :
- --]]
- function spawn(NPC)
- CampSpawn(NPC)
- end
- function respawn(NPC)
- spawn(NPC)
- end
- function CampSpawn(NPC)
- if GetSpawnLocationID(NPC)==170218 then --GnollCamp1
- Camp1Spawn(NPC)
- elseif GetSpawnLocationID(NPC)==591701 then--GnollCamp2
- Camp2Spawn(NPC)
- end
- end
- --- CAMP 1
- function Camp1Spawn(NPC, Spawn) -- Stage 1
- local zone = GetZone(NPC)
- local spawn1 = math.random(0,1)
- if spawn1 == 1 then
- local Camp1Spawn1 = SpawnByLocationID(zone, 133774053) --Gnoll1 (mystic)
- else
- local Camp1Spawn1a = SpawnByLocationID(zone, 133774045) -- Gnoll1(youth)
- end
- local spawn2 = math.random(0,1)
- if spawn2 == 1 then
- local Camp1Spawn2 = SpawnByLocationID(zone, 133774048)--Gnoll2 (mystic)
- else
- local Camp1Spawn2a = SpawnByLocationID(zone, 133774047)-- Gnoll2(youth)
- end
- local spawn3 = math.random(0,1)
- if spawn3 == 1 then
- local Camp1Spawn3 = SpawnByLocationID(zone, 133774049)--Gnoll3 (mystic)
- else
- local Camp1Spawn3a = SpawnByLocationID(zone, 133774043)-- Gnoll3(youth)
- end
- local spawn4 = math.random(0,1)
- if spawn4 == 1 then
- local Camp1Spawn4 = SpawnByLocationID(zone, 133774050)--Gnoll4 (mystic)
- else
- local Camp1Spawn4a = SpawnByLocationID(zone, 133774044)-- Gnoll4(youth)
- end
- local spawn5 = math.random(0,1)
- if spawn5 == 1 then
- local Camp1Spawn5 = SpawnByLocationID(zone, 133774051)--Gnoll5 (mystic)
- else
- local Camp1Spawn5a = SpawnByLocationID(zone, 133774042)-- Gnoll5(youth)
- end
- local spawn6 = math.random(0,1)
- if spawn6 == 1 then
- local Camp1Spawn6 = SpawnByLocationID(zone, 133774052)--Gnoll6 (mystic)
- else
- local Camp1Spawn6a = SpawnByLocationID(zone, 133774046)-- Gnoll6(youth)
- end
- local MerchantSpawn = math.random(0,1)
- if MerchantSpawn == 1 then
- local Camp1MerchantSpawn = SpawnByLocationID(zone, 134640)--Distressed Merchant
- else
- end
-
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1")
- end
- function Camp1SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
- local zone = GetZone(NPC)
- local Camp1Spawn1 = GetSpawnByLocationID(zone, 133773815)
- local Camp1Spawn1a = GetSpawnByLocationID(zone, 133773937)
- local Camp1Spawn2 = GetSpawnByLocationID(zone, 133773817)
- local Camp1Spawn2a = GetSpawnByLocationID(zone, 133773935)
- local Camp1Spawn3 = GetSpawnByLocationID(zone, 133773812)
- local Camp1Spawn3a = GetSpawnByLocationID(zone, 133773933)
- local Camp1Spawn4 = GetSpawnByLocationID(zone, 133773816)
- local Camp1Spawn4a = GetSpawnByLocationID(zone, 133773936)
- local Camp1Spawn5 = GetSpawnByLocationID(zone, 133773932)
- local Camp1Spawn5a = GetSpawnByLocationID(zone, 133773813)
- local Camp1Spawn6 = GetSpawnByLocationID(zone, 133773934)
- local Camp1Spawn6a = GetSpawnByLocationID(zone, 133773814)
- if IsAlive(Camp1Spawn1) == true or IsAlive(Camp1Spawn1a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp1Spawn2) == true or IsAlive(Camp1Spawn2a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp1Spawn3) == true or IsAlive(Camp1Spawn3a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp1Spawn4) == true or IsAlive(Camp1Spawn4a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp1Spawn5) == true or IsAlive(Camp1Spawn5a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp1Spawn6) == true or IsAlive(Camp1Spawn6a) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage1",1, Spawn)
- else
- AddTimer(NPC, 6000, "Camp1_Stage2")
- end
- end
-
- function Camp1_Stage2(NPC, Spawn) --Stage 2
- local zone = GetZone(NPC)
- local Camp1_Stage2Spawn1=SpawnByLocationID(zone, 190452)--darkpack pack leader
- FaceTarget(Camp1_Stage2Spawn1, Spawn)
- Attack(Camp1_Stage2Spawn1, Spawn)
-
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2")
- end
- function Camp1SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp1_Stage2Spawn1 = GetSpawnByLocationID(zone, 190452)
- if IsAlive(Camp1_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage2",1, Spawn)
- else
- AddTimer(NPC, 6000, "Camp1_Stage3")
- end
- end
- function Camp1_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
- local zone = GetZone(NPC)
- local choice = math.random(0,100)
- if choice <=33 then -- % Chance for Boss to Spawn
- local Camp1_Stage3Spawn1=SpawnByLocationID(zone, 133773818)--Sarkin
- FaceTarget(Camp1_Stage3Spawn1, Spawn)
- Attack(Camp1_Stage3Spawn1, Spawn)
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
- else -- Failed Boss Spawn
- local Camp1ArkofPower = SpawnByLocationID(zone, 133773939)--Ark of Power
- local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 134655)--Distressed Merchant
- if Camp1MerchantSpawn ~=nil then
- Despawn(Camp1MerchantSpawn)
- local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
- AddTimer(NPC,90000,"Camp1Reset")
- else
- AddTimer(NPC,60000,"Camp1Reset")
- end
- end
- end
- function Camp1SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp1_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773818) --Sarkin
- if IsAlive(Camp1_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3",1,Spawn)
- else
- local Camp1MerchantSpawn = GetSpawnByLocationID(zone, 134655)--Distressed Merchant
- if Camp1MerchantSpawn ~=nil then
- Despawn(Camp1MerchantSpawn)
- local Camp1GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
- AddTimer(NPC, 90000, "Camp1Reset",1,Spawn)
- else
- AddTimer(NPC, 10000, "Camp1Reset",1,Spawn)
- end
- end
- end
- function Camp1Reset(NPC)
- local zone = GetZone(NPC)
- local Camp1Object = GetSpawnByLocationID(zone, 591698)
- if Camp1Object~= nil then
- Despawn(Camp1Object)
- local Camp1ArkofPower = GetSpawnByLocationID(zone, 133773939)--Ark of Power
- if Camp1ArkofPower ~=nil then
- Despawn(Camp1ArkofPower)
- end
- local Camp1GratifiedMerchant = GetSpawnByLocationID(zone, 133773938)--Gratified Merchant
- if Camp1GratifiedMerchant ~=nil then
- Despawn(Camp1GratifiedMerchant)
- end
- end
- end
- --- CAMP 2
- function Camp2Spawn(NPC, Spawn) -- Stage 1
- local zone = GetZone(NPC)
- local Camp2Object2 = SpawnByLocationID(zone, 170244)
- local spawn1 = math.random(0,1)
- if spawn1 == 1 then
- local Camp2Spawn1 = SpawnByLocationID(zone, 133773943) --Gnoll1 (mystic)
- else
- local Camp2Spawn1a = SpawnByLocationID(zone, 133773809) -- Gnoll1(youth)
- end
- local spawn2 = math.random(0,1)
- if spawn2 == 1 then
- local Camp2Spawn2 = SpawnByLocationID(zone, 133773946)--Gnoll2 (mystic)
- else
- local Camp2Spawn2a = SpawnByLocationID(zone, 133773806)-- Gnoll2(youth)
- end
- local spawn3 = math.random(0,1)
- if spawn3 == 1 then
- local Camp1Spawn3 = SpawnByLocationID(zone, 133773810)--Gnoll3 (mystic)
- else
- local Camp1Spawn3a = SpawnByLocationID(zone, 133773944)-- Gnoll3(youth)
- end
- local spawn4 = math.random(0,1)
- if spawn4 == 1 then
- local Camp2Spawn4 = SpawnByLocationID(zone, 133773945)--Gnoll4 (mystic)
- else
- local Camp2Spawn4a = SpawnByLocationID(zone, 133773807)-- Gnoll4(youth)
- end
- local spawn5 = math.random(0,1)
- if spawn5 == 1 then
- local Camp2Spawn5 = SpawnByLocationID(zone, 133773808)--Gnoll5 (mystic)
- else
- local Camp2Spawn5a = SpawnByLocationID(zone, 133773942)-- Gnoll5(youth)
- end
- local spawn6 = math.random(0,1)
- if spawn6 == 1 then
- local Camp2Spawn6 = SpawnByLocationID(zone, 133773947)--Gnoll6 (mystic)
- else
- local Camp2Spawn6a = SpawnByLocationID(zone, 133773805)-- Gnoll6(youth)
- end
- local MerchantSpawn = math.random(0,1)
- if MerchantSpawn == 1 then
- local Camp2MerchantSpawn = SpawnByLocationID(zone, 133773948)--Distressed Merchant
- else
- end
-
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1")
- end
- function Camp2SpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
- local zone = GetZone(NPC)
- local Camp2Spawn1 = GetSpawnByLocationID(zone, 133773943)
- local Camp2Spawn1a = GetSpawnByLocationID(zone, 133773809)
- local Camp2Spawn2 = GetSpawnByLocationID(zone, 133773946)
- local Camp2Spawn2a = GetSpawnByLocationID(zone, 133773806)
- local Camp2Spawn3 = GetSpawnByLocationID(zone, 133773810)
- local Camp2Spawn3a = GetSpawnByLocationID(zone, 133773944)
- local Camp2Spawn4 = GetSpawnByLocationID(zone, 133773945)
- local Camp2Spawn4a = GetSpawnByLocationID(zone, 133773807)
- local Camp2Spawn5 = GetSpawnByLocationID(zone, 133773808)
- local Camp2Spawn5a = GetSpawnByLocationID(zone, 133773942)
- local Camp2Spawn6 = GetSpawnByLocationID(zone, 133773947)
- local Camp2Spawn6a = GetSpawnByLocationID(zone, 133773805)
- if IsAlive(Camp2Spawn1) == true or IsAlive(Camp2Spawn1a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp2Spawn2) == true or IsAlive(Camp2Spawn2a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp2Spawn3) == true or IsAlive(Camp2Spawn3a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp2Spawn4) == true or IsAlive(Camp2Spawn4a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp2Spawn5) == true or IsAlive(Camp2Spawn5a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(Camp2Spawn6) == true or IsAlive(Camp2Spawn6a) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage1",1, Spawn)
- else
- AddTimer(NPC, 6000, "Camp2_Stage2")
- end
- end
-
- function Camp2_Stage2(NPC, Spawn) --Stage 2
- local zone = GetZone(NPC)
- local Camp2_Stage2Spawn1=SpawnByLocationID(zone, 190461)--darkpack pack leader
- FaceTarget(Camp2_Stage2Spawn1, Spawn)
- Attack(Camp2_Stage2Spawn1, Spawn)
-
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2")
- end
- function Camp2SpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp2_Stage2Spawn1 = GetSpawnByLocationID(zone, 190461)
- if IsAlive(Camp2_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage2",1, Spawn)
- else
- AddTimer(NPC, 6000, "Camp2_Stage3")
- end
- end
- function Camp2_Stage3(NPC, Spawn) --Stage 3 (Possible Boss)
- local zone = GetZone(NPC)
- local choice = math.random(0,100)
- if choice <=33 then -- % Chance for Boss to Spawn
- local Camp2_Stage3Spawn1=SpawnByLocationID(zone, 133773811)--Tark
- FaceTarget(Camp2_Stage3Spawn1, Spawn)
- Attack(Camp2_Stage3Spawn1, Spawn)
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3")
- else -- Failed Boss Spawn
- local Camp2ArkofPower = SpawnByLocationID(zone, 133773940)--Ark of Power
- local Camp2MerchantSpawn = GetSpawnByLocationID(zone, 133773948)--Distressed Merchant
- if Camp2MerchantSpawn ~=nil then
- Despawn(Camp2MerchantSpawn)
- local Camp2GratifiedMerchant = SpawnByLocationID(zone, 133773938)--Gratified Merchant
- AddTimer(NPC,90000,"Camp2Reset")
- else
- AddTimer(NPC,60000,"Camp2Reset")
- end
- end
- end
- function Camp2SpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp2_Stage3Spawn1 = GetSpawnByLocationID(zone, 133773811)
- if IsAlive(Camp2_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"Camp2SpawnCheck_Stage3",1,Spawn)
- else
- local Camp2MerchantSpawn = GetSpawnByLocationID(zone, 133773948)--Distressed Merchant
- if Camp2MerchantSpawn ~=nil then
- Despawn(Camp2MerchantSpawn)
- local Camp2GratifiedMerchant = SpawnByLocationID(zone, 133773941)--Gratified Merchant
- AddTimer(NPC, 90000, "Camp2Reset",1,Spawn)
- else
- AddTimer(NPC, 10000, "Camp2Reset",1,Spawn)
- end
- end
- end
- function Camp2Reset(NPC)
- local zone = GetZone(NPC)
- local Camp2Object = GetSpawnByLocationID(zone, 591701)
- local Camp2Object2 = GetSpawnByLocationID(zone, 170244)
- if Camp2Object~= nil then
- Despawn(Camp2Object)
- end
- if Camp2Object2~= nil then
- Despawn(Camp2Object2)
- end
- local Camp2ArkofPower = GetSpawnByLocationID(zone, 133773940)--Ark of Power
- if Camp2ArkofPower ~=nil then
- Despawn(Camp2ArkofPower)
- end
- local Camp2GratifiedMerchant = GetSpawnByLocationID(zone, 133773941)--Gratified Merchant
- if Camp2GratifiedMerchant ~=nil then
- Despawn(Camp2GratifiedMerchant)
- end
- end
|