KlaydSpawner.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --[[
  2. Script Name : SpawnScripts/TheRuins_Classic/KlaydSpawner.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.07.11 02:07:28
  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, Spawn) -- Stage 1
  15. local zone = GetZone(NPC)
  16. local CampSpawn1 = SpawnByLocationID(zone, 133785955)
  17. local CampSpawn2 = SpawnByLocationID(zone, 133785956)
  18. local CampSpawn3 = SpawnByLocationID(zone, 133785957)
  19. local CampSpawn4 = SpawnByLocationID(zone, 133785958)
  20. local CampSpawn5 = SpawnByLocationID(zone, 133785959)
  21. local CampSpawn6 = SpawnByLocationID(zone, 133785960)
  22. AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
  23. end
  24. function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  25. local zone = GetZone(NPC)
  26. local CampSpawn1 = GetSpawnByLocationID(zone, 133785955)
  27. local CampSpawn2 = GetSpawnByLocationID(zone, 133785956)
  28. local CampSpawn3 = GetSpawnByLocationID(zone, 133785957)
  29. local CampSpawn4 = GetSpawnByLocationID(zone, 133785958)
  30. local CampSpawn5 = GetSpawnByLocationID(zone, 133785959)
  31. local CampSpawn6 = GetSpawnByLocationID(zone, 133785960)
  32. if IsAlive(CampSpawn1) == true then
  33. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  34. elseif IsAlive(CampSpawn2) == true then
  35. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  36. elseif IsAlive(CampSpawn3) == true then
  37. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  38. elseif IsAlive(CampSpawn4) == true then
  39. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  40. elseif IsAlive(CampSpawn4) == true then
  41. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  42. elseif IsAlive(CampSpawn5) == true then
  43. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  44. else
  45. AddTimer(NPC, 6000, "CampReset")
  46. end
  47. end
  48. function CampReset(NPC)
  49. local zone = GetZone(NPC)
  50. local CampObject = GetSpawnByLocationID(zone, 133785961)
  51. if CampObject~= nil then
  52. Despawn(CampObject)
  53. end
  54. end