9
3

MayorSpawnObject.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. --[[
  2. Script Name : SpawnScripts/Antonica/MayorSpawnObject.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.02.22 08:02:50
  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 CampSpawn1 = SpawnByLocationID(zone, 133782489) --Level 16
  18. AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
  19. end
  20. function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  21. local zone = GetZone(NPC)
  22. local CampSpawn1 = GetSpawnByLocationID(zone, 133782489)
  23. if IsAlive(CampSpawn1) == true then
  24. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  25. else
  26. AddTimer(NPC, 300000, "Camp_Stage2")
  27. end
  28. end
  29. function Camp_Stage2(NPC, Spawn) --Stage 2
  30. local zone = GetZone(NPC)
  31. local Camp_Stage2Spawn1=SpawnByLocationID(zone, 133782490)--Level 17
  32. AddTimer(NPC,6000,"CampSpawnCheck_Stage2")
  33. end
  34. function CampSpawnCheck_Stage2(NPC, Spawn) --Stage 2 Living Check
  35. local zone = GetZone(NPC)
  36. local Camp_Stage2Spawn1 = GetSpawnByLocationID(zone, 133782490)
  37. if IsAlive(Camp_Stage2Spawn1) == true then
  38. AddTimer(NPC,6000,"CampSpawnCheck_Stage2",1, Spawn)
  39. else
  40. AddTimer(NPC, 300000, "Camp_Stage3")
  41. end
  42. end
  43. function Camp_Stage3(NPC, Spawn) --Stage 3
  44. local zone = GetZone(NPC)
  45. local Camp_Stage3Spawn1=SpawnByLocationID(zone, 133782491)--Level 18
  46. AddTimer(NPC,6000,"Camp1SpawnCheck_Stage3")
  47. end
  48. function CampSpawnCheck_Stage3(NPC, Spawn) --Stage 3 Living Check
  49. local zone = GetZone(NPC)
  50. local Camp_Stage3Spawn1 = GetSpawnByLocationID(zone, 133782491)
  51. if IsAlive(Camp_Stage2Spawn1) == true then
  52. AddTimer(NPC,6000,"CampSpawnCheck_Stage3",1,Spawn)
  53. else
  54. AddTimer(NPC, 6000, "CampReset")
  55. end
  56. end
  57. function CampReset(NPC)
  58. local zone = GetZone(NPC)
  59. local CampObject = GetSpawnByLocationID(zone, 133782488)
  60. if CampObject~= nil then
  61. Despawn(CampObject)
  62. end
  63. end