InvisCubeCelegThunderingSteppes.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --[[
  2. Script Name : SpawnScripts/ThunderingSteppes/InvisCubeCelegThunderingSteppes.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.07.08 11:07:55
  5. Script Purpose :
  6. :
  7. --]]
  8. local RespawnTimer = false
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC,18, "InRange", "LeaveRange")
  11. end
  12. function hailed(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC,Spawn)
  18. if RespawnTimer == false then --Disable respawns for 11 min
  19. if GetQuestStep(Spawn,5617)==4 then --Player Quest Step Check (should be step 4, but available anywhere between 1-4)
  20. Celeg = GetSpawn(NPC,2490842)
  21. Crows = GetSpawn(NPC,2490843)
  22. if Celeg == nil and Crows == nil then
  23. RespawnTimer = true
  24. zone = GetZone(Spawn)
  25. local CelegSpawn = SpawnByLocationID(zone,133773583)
  26. local Crow1 = SpawnByLocationID(zone,133773585)
  27. local Crow2 = SpawnByLocationID(zone,133773584)
  28. AddTimer(NPC,3000,"CelegShout")
  29. AddTimer(NPC,660000,"ResetTimer")
  30. SetTarget(CelegSpawn,Spawn)
  31. SetTarget(Crow1,Spawn)
  32. SetTarget(Crow2,Spawn)
  33. AddHate(Spawn, CelegSpawn, 100)
  34. AddHate(Spawn, Crow1, 100)
  35. AddHate(Spawn, Crow2, 100)
  36. else --forces spawns to attack if still up
  37. zone = GetZone(Spawn)
  38. local CelegSpawn = SpawnByLocationID(zone,133773583)
  39. local Crow1 = SpawnByLocationID(zone,133773585)
  40. local Crow2 = SpawnByLocationID(zone,133773584)
  41. SetTarget(CelegSpawn,Spawn)
  42. SetTarget(Crow1,Spawn)
  43. SetTarget(Crow2,Spawn)
  44. AddHate(Spawn, CelegSpawn, 100)
  45. AddHate(Spawn, Crow1, 100)
  46. AddHate(Spawn, Crow2, 100)
  47. end
  48. end
  49. end
  50. end
  51. function CelegShout(NPC,Spawn)
  52. Celeg = GetSpawn(NPC,2490842)
  53. if Celeg ~= nil then
  54. PlayFlavor(Celeg,"","You should not have come here, Gildas sends others to do his work I see. I'll make sure you never leave alive!","",0,0)
  55. end
  56. end
  57. function ResetTimer(NPC,Spawn)
  58. RespawnTimer = false
  59. end