MovementwithElevationScroll.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : SpawnScripts/DoF_design_path_script/MovementwithElevationScroll.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.07.19 05:07:37
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Busy = false
  10. function spawn(NPC)
  11. end
  12. function hailed(NPC, Spawn)
  13. Dialog1(NPC,Spawn)
  14. end
  15. function Dialog1(NPC, Spawn)
  16. Dialog.New(NPC, Spawn)
  17. Dialog.AddDialog("This is demonstrating movement loops with a number of points. What would you like to do?")
  18. if Busy == false then
  19. Dialog.AddOption("Setup the Spawns","Setup")
  20. Dialog.AddOption("Nevermind")
  21. else
  22. Dialog.AddOption("Reset the Spawns","Reset")
  23. Dialog.AddOption("Nevermind")
  24. end
  25. Dialog.Start()
  26. end
  27. function Setup(NPC,Spawn)
  28. local zone = GetZone(NPC)
  29. local Points2 = GetSpawnByLocationID(zone, 133785999)
  30. local Points4 = GetSpawnByLocationID(zone, 133786000)
  31. local Points6 = GetSpawnByLocationID(zone, 133785995)
  32. Busy = true
  33. if Points2 ==nil then
  34. SpawnByLocationID(zone, 133785999)
  35. end
  36. if Points4 ==nil then
  37. SpawnByLocationID(zone, 133786000)
  38. end
  39. if Points6 ==nil then
  40. SpawnByLocationID(zone, 133785995)
  41. end
  42. end
  43. function Reset(NPC,Spawn)
  44. local zone = GetZone(NPC)
  45. local Points2 = GetSpawnByLocationID(zone, 133785999)
  46. local Points4 = GetSpawnByLocationID(zone, 133786000)
  47. local Points6 = GetSpawnByLocationID(zone, 133785995)
  48. Busy = false
  49. if Points2 ~=nil then
  50. KillSpawn(Points2)
  51. end
  52. if Points4 ~=nil then
  53. KillSpawn(Points4)
  54. end
  55. if Points6 ~=nil then
  56. KillSpawn(Points6)
  57. end
  58. end