ObeliskSpawn.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : SpawnScripts/Antonica/ObeliskSpawn.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.02.16 09:02:54
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. CampSpawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. --- CAMP 1
  15. function CampSpawn(NPC, Spawn) -- Stage 1
  16. local zone = GetZone(NPC)
  17. local spawn1 = math.random(0,1)
  18. if spawn1 == 1 then
  19. local CampSpawn1 = SpawnByLocationID(zone, 133782425) --Rift Watcher
  20. else
  21. local CampSpawn1a = SpawnByLocationID(zone, 133782425) -- Rift Watcher
  22. end
  23. local spawn2 = math.random(0,1)
  24. if spawn2 == 1 then
  25. local CampSpawn2 = SpawnByLocationID(zone, 133782426)--Rift Watcher
  26. else
  27. local CampSpawn2a = SpawnByLocationID(zone, 133782429)-- Servitor
  28. end
  29. local spawn3 = math.random(0,1)
  30. if spawn3 == 1 then
  31. local CampSpawn3 = SpawnByLocationID(zone, 133782427)--Rift Watcher
  32. else
  33. local CampSpawn3a = SpawnByLocationID(zone, 133782427)-- Rift Watcher
  34. end
  35. AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
  36. end
  37. function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  38. local zone = GetZone(NPC)
  39. local CampSpawn1 = GetSpawnByLocationID(zone, 133782425)
  40. local CampSpawn1a = GetSpawnByLocationID(zone, 133782425)
  41. local CampSpawn2 = GetSpawnByLocationID(zone, 133782426)
  42. local CampSpawn2a = GetSpawnByLocationID(zone, 133782429)
  43. local CampSpawn3 = GetSpawnByLocationID(zone, 133782427)
  44. local CampSpawn3a = GetSpawnByLocationID(zone, 133782427)
  45. if IsAlive(CampSpawn1) == true or IsAlive(Camp1Spawn1a) == true then
  46. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  47. elseif IsAlive(CampSpawn2) == true or IsAlive(Camp1Spawn2a) == true then
  48. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  49. elseif IsAlive(CampSpawn3) == true or IsAlive(Camp1Spawn3a) == true then
  50. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  51. else
  52. AddTimer(NPC, 6000, "Camp_Stage2")
  53. end
  54. end
  55. function Camp_Stage2(NPC, Spawn) --Stage 2
  56. local zone = GetZone(NPC)
  57. local Camp_Stage2Spawn1=SpawnByLocationID(zone, 133782428)--Portal
  58. FaceTarget(Camp_Stage2Spawn1, Spawn)
  59. Attack(Camp_Stage2Spawn1, Spawn)
  60. AddTimer(NPC, 300000, "CampReset")
  61. end
  62. function CampReset(NPC)
  63. local zone = GetZone(NPC)
  64. local CampObject = GetSpawnByLocationID(zone, 133782423)
  65. if CampObject~= nil then
  66. Despawn(CampObject)
  67. local Portal = GetSpawnByLocationID(zone, 133782428)--Portal
  68. if Portal ~=nil then
  69. Despawn(Portal)
  70. end
  71. end
  72. end