aHauntedTome.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --[[
  2. Script Name : SpawnScripts/TroubledHaunt/aHauntedTome.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.23 04:11:53
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. waypoints(NPC)
  12. end
  13. function waypoints(NPC)
  14. if GetSpawnLocationID(NPC) == 133780856 then
  15. MovementLoopAddLocation(NPC, -6.46, 3.5, -6.29, 2, 2,"GhostCheck")
  16. MovementLoopAddLocation(NPC, -2.45, 3.5, -7.08, 2, 2,"GhostCheck")
  17. MovementLoopAddLocation(NPC, 0.39, 3.5, -8.98, 2, 2,"GhostCheck")
  18. MovementLoopAddLocation(NPC, 4.71, 3.5, -8.72, 2, 2,"GhostCheck")
  19. MovementLoopAddLocation(NPC, 7.48, 3.5, -8.35, 2, 2,"GhostCheck")
  20. MovementLoopAddLocation(NPC, 5.67, 3.5, -2.53, 2, 2,"GhostCheck")
  21. MovementLoopAddLocation(NPC, 2.97, 3.5, -2.96, 2, 2,"GhostCheck")
  22. MovementLoopAddLocation(NPC, 0.42, 3.5, -4.26, 2, 2,"GhostCheck")
  23. MovementLoopAddLocation(NPC, -4.82, 3.5, -6.05, 2, 2,"GhostCheck")
  24. MovementLoopAddLocation(NPC, -7.57, 4.7, -1.58, 2, 2,"GhostCheck")
  25. MovementLoopAddLocation(NPC, -4.93, 4.7, 0.11, 2, 2,"GhostCheck")
  26. MovementLoopAddLocation(NPC, -1.23, 4.7, -1.56, 2, 2,"GhostCheck")
  27. MovementLoopAddLocation(NPC, -0.84, 4.7, -7.96, 2, 2,"GhostCheck")
  28. MovementLoopAddLocation(NPC, 0.52, 4.7, -9.13, 2, 2,"GhostCheck")
  29. MovementLoopAddLocation(NPC, 6.84, 4.7, -7.87, 2, 2,"GhostCheck")
  30. MovementLoopAddLocation(NPC, 7.3, 4.7, -1.78, 2, 2,"GhostCheck")
  31. MovementLoopAddLocation(NPC, -1.07, 3.5, -2.17, 2, 2,"GhostCheck")
  32. MovementLoopAddLocation(NPC, -4.03, 3.5, -6, 2, 2,"GhostCheck")
  33. MovementLoopAddLocation(NPC, -7.42, 3.5, -7.32, 2, 2,"GhostCheck")
  34. MovementLoopAddLocation(NPC, -4.03, 3.5, -6, 2, 2,"GhostCheck")
  35. MovementLoopAddLocation(NPC, -1.07, 3.5, -2.17, 2, 2,"GhostCheck")
  36. MovementLoopAddLocation(NPC, 7.3, 4.7, -1.78, 2, 2,"GhostCheck")
  37. MovementLoopAddLocation(NPC, 6.84, 4.7, -7.87, 2, 2,"GhostCheck")
  38. MovementLoopAddLocation(NPC, 0.52, 4.7, -9.13, 2, 2,"GhostCheck")
  39. MovementLoopAddLocation(NPC, -0.84, 4.7, -7.96, 2, 2,"GhostCheck")
  40. MovementLoopAddLocation(NPC, -1.23, 4.7, -1.56, 2, 2,"GhostCheck")
  41. MovementLoopAddLocation(NPC, -4.93, 4.7, 0.11, 2, 2,"GhostCheck")
  42. MovementLoopAddLocation(NPC, -7.57, 4.7, -1.58, 2, 2,"GhostCheck")
  43. MovementLoopAddLocation(NPC, -4.82, 3.5, -6.05, 2, 2,"GhostCheck")
  44. MovementLoopAddLocation(NPC, 0.42, 3.5, -4.26, 2, 2,"GhostCheck")
  45. MovementLoopAddLocation(NPC, 2.97, 3.5, -2.96, 2, 2,"GhostCheck")
  46. MovementLoopAddLocation(NPC, 5.67, 3.5, -2.53, 2, 2,"GhostCheck")
  47. MovementLoopAddLocation(NPC, 7.48, 3.5, -8.35, 2, 2,"GhostCheck")
  48. MovementLoopAddLocation(NPC, 4.71, 3.5, -8.72, 2, 2,"GhostCheck")
  49. MovementLoopAddLocation(NPC, 0.39, 3.5, -8.98, 2, 2,"GhostCheck")
  50. MovementLoopAddLocation(NPC, -2.45, 3.5, -7.08, 2, 2,"GhostCheck")
  51. MovementLoopAddLocation(NPC, -6.46, 3.5, -6.29, 2, 2,"GhostCheck")
  52. elseif GetSpawnLocationID(NPC) == 133780855 then
  53. MovementLoopAddLocation(NPC, -1.94, 3.5, 7.35, 2, 2,"GhostCheck")
  54. MovementLoopAddLocation(NPC, -5.67, 3.5, 7.94, 2, 2,"GhostCheck")
  55. MovementLoopAddLocation(NPC, -8.91, 3.5, 8.16, 2, 2,"GhostCheck")
  56. MovementLoopAddLocation(NPC, -10.02, 3.5, 5.91, 2, 2,"GhostCheck")
  57. MovementLoopAddLocation(NPC, -4.2, 3.5, 9.15, 2, 2,"GhostCheck")
  58. MovementLoopAddLocation(NPC, -1.64, 3.5, 7.89, 2, 2,"GhostCheck")
  59. MovementLoopAddLocation(NPC, -0.99, 3.5, 4.7, 2, 2,"GhostCheck")
  60. MovementLoopAddLocation(NPC, -2.18, 3.5, 4.57, 2, 2,"GhostCheck")
  61. MovementLoopAddLocation(NPC, -1.63, 3.5, 8.56, 2, 2,"GhostCheck")
  62. MovementLoopAddLocation(NPC, -5.17, 3.5, 9.31, 2, 2,"GhostCheck")
  63. MovementLoopAddLocation(NPC, -7.24, 3.5, 7.15, 2, 2,"GhostCheck")
  64. MovementLoopAddLocation(NPC, -9.82, 3.5, 5.18, 2, 2,"GhostCheck")
  65. MovementLoopAddLocation(NPC, -10.53, 3.5, 6.84, 2, 2,"GhostCheck")
  66. MovementLoopAddLocation(NPC, -6.94, 3.5, 7.23, 2, 2,"GhostCheck")
  67. MovementLoopAddLocation(NPC, 0.68, 3.5, 4.66, 2, 2,"GhostCheck")
  68. MovementLoopAddLocation(NPC, -1.89, 3.5, 8.29, 2, 2,"GhostCheck")
  69. MovementLoopAddLocation(NPC, -3.09, 3.5, 6.53, 2, 2,"GhostCheck")
  70. MovementLoopAddLocation(NPC, -7.7, 3.5, 8.13, 2, 2,"GhostCheck")
  71. MovementLoopAddLocation(NPC, -10.39, 3.5, 6.2, 2, 2,"GhostCheck")
  72. MovementLoopAddLocation(NPC, -7.7, 3.5, 8.13, 2, 2,"GhostCheck")
  73. MovementLoopAddLocation(NPC, -3.09, 3.5, 6.53, 2, 2,"GhostCheck")
  74. MovementLoopAddLocation(NPC, -1.89, 3.5, 8.29, 2, 2,"GhostCheck")
  75. MovementLoopAddLocation(NPC, 0.68, 3.5, 4.66, 2, 2,"GhostCheck")
  76. MovementLoopAddLocation(NPC, -6.94, 3.5, 7.23, 2, 2,"GhostCheck")
  77. MovementLoopAddLocation(NPC, -10.53, 3.5, 6.84, 2, 2,"GhostCheck")
  78. MovementLoopAddLocation(NPC, -9.82, 3.5, 5.18, 2, 2,"GhostCheck")
  79. MovementLoopAddLocation(NPC, -7.24, 3.5, 7.15, 2, 2,"GhostCheck")
  80. MovementLoopAddLocation(NPC, -5.17, 3.5, 9.31, 2, 2,"GhostCheck")
  81. MovementLoopAddLocation(NPC, -1.63, 3.5, 8.56, 2, 2,"GhostCheck")
  82. MovementLoopAddLocation(NPC, -2.18, 3.5, 4.57, 2, 2,"GhostCheck")
  83. MovementLoopAddLocation(NPC, -0.99, 3.5, 4.7, 2, 2,"GhostCheck")
  84. MovementLoopAddLocation(NPC, -1.64, 3.5, 7.89, 2, 2,"GhostCheck")
  85. MovementLoopAddLocation(NPC, -4.2, 3.5, 9.15, 2, 2,"GhostCheck")
  86. MovementLoopAddLocation(NPC, -10.02, 3.5, 5.91, 2, 2,"GhostCheck")
  87. MovementLoopAddLocation(NPC, -8.91, 3.5, 8.16, 2, 2,"GhostCheck")
  88. MovementLoopAddLocation(NPC, -5.67, 3.5, 7.94, 2, 2,"GhostCheck")
  89. MovementLoopAddLocation(NPC, -1.94, 3.5, 7.35, 2, 2,"GhostCheck")
  90. end
  91. end
  92. function GhostCheck(NPC,Spawn)
  93. zone = GetZone(NPC)
  94. if IsAlive(GetSpawnByLocationID(zone,133780859))==true then
  95. else
  96. Despawn(NPC)
  97. PlaySound(NPC,"sounds/ui/place_item.wav",GetX(NPC), GetY(NPC), GetZ(NPC))
  98. end
  99. end
  100. function respawn(NPC)
  101. spawn(NPC)
  102. end