123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- --[[
- Script Name : SpawnScripts/Antonica/ahighwaymancampfireA.lua
- Script Author : LordPazuzu
- Script Date : 2023.02.08 09:02:31
- Script Purpose :
- :
- --]]
- function spawn(NPC)
- CampSpawn(NPC)
- end
- function respawn(NPC)
- spawn(NPC)
- end
- --- CAMP 1
- function CampSpawn(NPC, Spawn) -- Stage 1
- local zone = GetZone(NPC)
- local spawn1 = math.random(0,1)
- if spawn1 == 1 then
- local CampSpawn1 = SpawnByLocationID(zone, 133782388) --Highwayman Summoner
- else
- local CampSpawn1a = SpawnByLocationID(zone, 133782392) -- Highwayman Melee
- end
- local spawn2 = math.random(0,1)
- if spawn2 == 1 then
- local CampSpawn2 = SpawnByLocationID(zone, 133782389)--Highwayman Summoner
- else
- local CampSpawn2a = SpawnByLocationID(zone, 133782393)-- Highwayman Melee
- end
- local spawn3 = math.random(0,1)
- if spawn3 == 1 then
- local CampSpawn3 = SpawnByLocationID(zone, 133782390)--Highwayman Summoner
- else
- local CampSpawn3a = SpawnByLocationID(zone, 133782394)-- Highwayman Melee
- end
- local spawn4 = math.random(0,1)
- if spawn4 == 1 then
- local CampSpawn4 = SpawnByLocationID(zone, 133782391)--Highwayman Summoner
- else
- local CampSpawn4a = SpawnByLocationID(zone, 133782395)-- Highwayman Melee
- end
- local MerchantSpawn = math.random(0,1)
- if MerchantSpawn == 1 then
- local Camp1MerchantSpawn = SpawnByLocationID(zone, 133782382)--Distressed Merchant
- else
- end
-
-
- AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
- end
- function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
- local zone = GetZone(NPC)
- local CampSpawn1 = GetSpawnByLocationID(zone, 133782388)
- local CampSpawn1a = GetSpawnByLocationID(zone, 133782392)
- local CampSpawn2 = GetSpawnByLocationID(zone, 133782389)
- local CampSpawn2a = GetSpawnByLocationID(zone, 133782393)
- local CampSpawn3 = GetSpawnByLocationID(zone, 133782390)
- local CampSpawn3a = GetSpawnByLocationID(zone, 133782394)
- local CampSpawn4 = GetSpawnByLocationID(zone, 133782391)
- local CampSpawn4a = GetSpawnByLocationID(zone, 133782395)
- if IsAlive(CampSpawn1) == true or IsAlive(Camp1Spawn1a) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(CampSpawn2) == true or IsAlive(Camp1Spawn2a) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(CampSpawn3) == true or IsAlive(Camp1Spawn3a) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
- elseif IsAlive(CampSpawn4) == true or IsAlive(Camp1Spawn4a) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
-
- else
- AddTimer(NPC, 6000, "Camp_Stage2")
- end
- end
-
- function Camp_Stage2(NPC, Spawn) --Stage 2
- local zone = GetZone(NPC)
- local Camp_Stage2Spawn1=SpawnByLocationID(zone, 133782396)--Bloodsaber Agent
- FaceTarget(Camp_Stage2Spawn1, Spawn)
- Attack(Camp_Stage2Spawn1, Spawn)
-
- AddTimer(NPC,6000,"CampSpawnCheck_Stage2")
- end
- function CampSpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp_Stage2Spawn1 = GetSpawnByLocationID(zone, 133782396)
- if IsAlive(Camp_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage2",1, Spawn)
- else
- AddTimer(NPC, 6000, "Camp_Stage3")
- end
- end
- function Camp_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 Camp_Stage3Spawn1=SpawnByLocationID(zone, 133782381)--Bloodsaber Corruptor
- FaceTarget(Camp_Stage3Spawn1, Spawn)
- Attack(Camp_Stage3Spawn1, Spawn)
- AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
- else -- Failed Boss Spawn
- local CampArkofPower = SpawnByLocationID(zone, 133782384)--Ark of Power
- local CampMerchantSpawn = GetSpawnByLocationID(zone, 133782382)--Distressed Merchant
- if CampMerchantSpawn ~=nil then
- Despawn(CampMerchantSpawn)
- local CampGratifiedMerchant = SpawnByLocationID(zone, 133782383)--Gratified Merchant
- AddTimer(NPC,90000,"CampReset")
- else
- AddTimer(NPC,60000,"CampReset")
- end
- end
- end
- function CampSpawnCheck_Stage3(NPC, Spawn) --Stage 2 Living Check
- local zone = GetZone(NPC)
- local Camp_Stage3Spawn1 = GetSpawnByLocationID(zone, 133782381) --Blodsaber Corrupter
- if IsAlive(Camp_Stage2Spawn1) == true then
- AddTimer(NPC,6000,"CampSpawnCheck_Stage3",1,Spawn)
- else
- local CampMerchantSpawn = GetSpawnByLocationID(zone, 133782382)--Distressed Merchant
- if CampMerchantSpawn ~=nil then
- Despawn(CampMerchantSpawn)
- local CampGratifiedMerchant = SpawnByLocationID(zone, 133782383)--Gratified Merchant
- AddTimer(NPC, 90000, "CampReset",1,Spawn)
- else
- AddTimer(NPC, 10000, "CampReset",1,Spawn)
- end
- end
- end
- function CampReset(NPC)
- local zone = GetZone(NPC)
- local CampObject = GetSpawnByLocationID(zone, 591793)
- if CampObject~= nil then
- Despawn(CampObject)
- local CampArkofPower = GetSpawnByLocationID(zone, 133782384)--Ark of Power
- if CampArkofPower ~=nil then
- Despawn(CampArkofPower)
- end
- local CampGratifiedMerchant = GetSpawnByLocationID(zone, 133782383)--Gratified Merchant
- if CampGratifiedMerchant ~=nil then
- Despawn(CampGratifiedMerchant)
- end
- end
- end
|