9
3

EnterWarning.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : SpawnScripts/TheDisconcertingMeditation/EnterWarning.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.21 04:11:26
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  10. SetTempVariable(NPC, "Enter", "true")
  11. end
  12. function InRange(NPC,Spawn,Zone)
  13. if GetTempVariable(NPC,"Enter")=="true" then
  14. SetTempVariable(NPC, "Enter", "false")
  15. AddTimer(NPC,15000,"FirstWarning",1,Spawn)
  16. AddTimer(NPC,60000,"SecondWarning",1,Spawn)
  17. AddTimer(NPC,75000,"ThirdWarning",1,Spawn)
  18. AddTimer(NPC,80000,"Shake",1,Spawn)
  19. AddTimer(NPC,84000,"Shake",1,Spawn)
  20. AddTimer(NPC,86000,"Shake",1,Spawn)
  21. AddTimer(NPC,88000,"Shake",1,Spawn)
  22. AddTimer(NPC,90000,"FourthWarning",1,Spawn)
  23. AddTimer(NPC,90300,"Shake",1,Spawn)
  24. AddTimer(NPC,90600,"Shake",1,Spawn)
  25. AddTimer(NPC,90900,"Shake",1,Spawn)
  26. AddTimer(NPC,91000,"Ending",1,Spawn)
  27. end
  28. end
  29. function FirstWarning(Zone,Spawn)
  30. SendMessage(Spawn, "You begin to feel the meditation wane...","yellow")
  31. SendPopUpMessage(Spawn, "You begin to feel the meditation wane...",250,250,250)
  32. zone = GetZone(Spawn)
  33. PerformCameraShake(Spawn, 0.10000000149011612)
  34. SpawnByLocationID(zone,133780775)
  35. SpawnByLocationID(zone,133780776)
  36. end
  37. function SecondWarning(Zone,Spawn)
  38. SendMessage(Spawn, "Only a short time remains before you return to your body...","yellow")
  39. SendPopUpMessage(Spawn, "Only a short time remains before you return to your body...",250,250,250)
  40. zone = GetZone(Spawn)
  41. PerformCameraShake(Spawn, 0.20000000298023224)
  42. SpawnByLocationID(zone,133780777)
  43. SpawnByLocationID(zone,133780778)
  44. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn))
  45. end
  46. function ThirdWarning(Zone,Spawn)
  47. SendMessage(Spawn, "Your concentration is starting to slip...","yellow")
  48. SendPopUpMessage(Spawn, "Your concentration is starting to slip...",250,250,250)
  49. PerformCameraShake(Spawn, 0.699999988079071)
  50. zone = GetZone(Spawn)
  51. SpawnByLocationID(zone,133780779)
  52. SpawnByLocationID(zone,133780780)
  53. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn))
  54. end
  55. function Shake(Zone,Spawn)
  56. PerformCameraShake(Spawn, 0.699999988079071)
  57. end
  58. function FourthWarning(Zone,Spawn)
  59. SendMessage(Spawn, "The mediation ends.","yellow")
  60. SendPopUpMessage(Spawn, "The mediation ends.",250,250,250)
  61. PerformCameraShake(Spawn, 0.699999988079071)
  62. end
  63. function Ending(NPC,Spawn)
  64. NQ = GetZone("northqeynos")
  65. PerformCameraShake(Spawn, 0.10000000149011612)
  66. Zone(NQ,Spawn,281.55, -13.58, 97.29, 283.43)
  67. SpawnSet(Player,"visual_state",0)
  68. end
  69. function respawn(NPC)
  70. spawn(NPC)
  71. end