spawnkraoflaAFesteringProblem2.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/spawnkraoflaAFesteringProblem2.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.04.29 05:04:27
  5. Script Purpose : For Freeport Froglok quest
  6. :
  7. --]]
  8. function spawn(NPC)
  9. Camp1Spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function Camp1Spawn(NPC, Spawn) -- Stage 1
  15. local zone = GetZone(NPC)
  16. local aQeynosianScout1 = SpawnByLocationID(zone, 299822)
  17. local aQeynosianScout2 = SpawnByLocationID(zone, 299824)
  18. local aQeynosianScout3 = SpawnByLocationID(zone, 299825)
  19. local aQeynosianProtector = SpawnByLocationID(zone, 299826)
  20. AddTimer(NPC,6000,"CampSpawnCheck_Stage1")
  21. end
  22. function CampSpawnCheck_Stage1(NPC, Spawn) --Stage 1 Living Check
  23. local zone = GetZone(NPC)
  24. local aQeynosianScout1 = GetSpawnByLocationID(zone, 299822)
  25. local aQeynosianScout2 = GetSpawnByLocationID(zone, 299824)
  26. local aQeynosianScout3 = GetSpawnByLocationID(zone, 299825)
  27. local aQeynosianProtector = GetSpawnByLocationID(zone, 299826)
  28. local Kraofla = GetSpawnByLocationID(zone, 133784668)
  29. if IsAlive(aQeynosianScout1) == true then
  30. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  31. elseif IsAlive(aQeynosianScout2) == true then
  32. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  33. elseif IsAlive(aQeynosianScout3) == true then
  34. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  35. elseif IsAlive(aQeynosianProtector) == true then
  36. AddTimer(NPC,6000,"CampSpawnCheck_Stage1",1, Spawn)
  37. else
  38. AddTimer(NPC,6000,"Camp1_Stage2",1, Spawn)
  39. end
  40. end
  41. function Camp1_Stage2(NPC, Spawn)
  42. local zone = GetZone(NPC)
  43. if GetSpawnByLocationID(zone, 133784668) ==nil then
  44. local Kraofla = SpawnByLocationID(zone, 133784668)
  45. FaceTarget(Kraofla, Spawn)
  46. Attack(Kraofla, Spawn)
  47. end
  48. AddTimer(NPC, 6000, "Camp1_Stage2Check")
  49. end
  50. function Camp1_Stage2Check(NPC, Spawn)
  51. local zone = GetZone(NPC)
  52. local KraoflaSpawn = GetSpawnByLocationID(zone, 133784668)
  53. if IsAlive(KraoflaSpawn) == true then
  54. AddTimer(NPC,6000,"Camp1_Stage2Check",1,Spawn)
  55. else
  56. AddTimer(NPC, 40000, "Camp1Reset",1,Spawn)
  57. end
  58. end
  59. function Camp1Reset(NPC)
  60. Despawn(NPC)
  61. end