anUnseenHandtaskmaster.lua 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. --[[
  2. Script Name : SpawnScripts/CrowsTomb/anUnseenHandtaskmaster.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.03 06:10:07
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheMotleyMerchantManifest = 5368
  9. function spawn(NPC)
  10. SetTempVariable(NPC, "spoken", "1")
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. if GetTempVariable(NPC, "spoken") == "1" then
  15. PlayFlavor(NPC, "", "Ahh, you must be the new initiates, make yourselves useful and start cleaning up some of the debris. And be quick about it!", "", 1689589577, 4560189, Spawn)
  16. SetTempVariable(NPC, "spoken", "2")
  17. AddTimer(NPC, 60000, "timer", 1, Spawn)
  18. elseif GetTempVariable(NPC, "spoken") == "2" then
  19. PlayFlavor(NPC, "", "Did you not hear me, I told you to clean.", "", 1689589577, 4560189, Spawn)
  20. elseif GetTempVariable(NPC, "spoken") == "3" then
  21. PlayFlavor(NPC, "", "Well since you finished cleaning up here, head to the back and see if there's anything you can do for them.", "", 1689589577, 4560189, Spawn)
  22. elseif HasCompletedQuest(Spawn, TheMotleyMerchantManifest) then
  23. PlayFlavor(NPC, "", "Welcome back, good work on that last task.", "", 1689589577, 4560189, Spawn)
  24. end
  25. end
  26. function timer(NPC, Spawn)
  27. local zone = GetZone(Spawn)
  28. local debris_1 = GetSpawnByLocationID(zone, 487470)
  29. local debris_2 = GetSpawnByLocationID(zone, 487471)
  30. local debris_3 = GetSpawnByLocationID(zone, 487473)
  31. if debris_1 == nil and debris_2 == nil and debris_3 == nil then
  32. SetTempVariable(NPC, "spoken", "3")
  33. else
  34. local initiate1 = GetSpawnByLocationID(zone, 434504)
  35. local initiate2 = GetSpawnByLocationID(zone, 434505)
  36. local initiate3 = GetSpawnByLocationID(zone, 434506)
  37. local initiate4 = GetSpawnByLocationID(zone, 434507)
  38. if initiate1 ~= nil or initiate2 ~= nil or initiate3 ~= nil or initiate4 ~= nil then
  39. SpawnSet(initiate1, "faction", 1)
  40. SpawnSet(initiate2, "faction", 1)
  41. SpawnSet(initiate3, "faction", 1)
  42. SpawnSet(initiate4, "faction", 1)
  43. end
  44. SpawnSet(NPC, "faction", 1)
  45. end
  46. end
  47. function death(NPC, Spawn)
  48. local zone = GetZone(Spawn)
  49. local initiate1 = GetSpawnByLocationID(zone, 434504)
  50. local initiate2 = GetSpawnByLocationID(zone, 434505)
  51. local initiate3 = GetSpawnByLocationID(zone, 434506)
  52. local initiate4 = GetSpawnByLocationID(zone, 434507)
  53. local Rollus = GetSpawnByLocationID(zone, 434508)
  54. if initiate1 ~= nil then
  55. SpawnSet(initiate1, "faction", 1)
  56. elseif initiate2 ~= nil then
  57. SpawnSet(initiate2, "faction", 1)
  58. elseif initiate3 ~= nil then
  59. SpawnSet(initiate3, "faction", 1)
  60. elseif initiate4 ~= nil then
  61. SpawnSet(initiate4, "faction", 1)
  62. end
  63. SpawnSet(Rollus, "attackable", 1)
  64. SpawnSet(Rollus, "show_level", 1)
  65. SpawnSet(Rollus, "show_command_icon", 1)
  66. AddTimer(NPC, 500, "fippy_runaway", 1, Spawn)
  67. end
  68. function fippy_runaway(NPC, Spawn)
  69. if not HasQuest(Spawn, TheMotleyMerchantManifest) and not HasCompletedQuest(Spawn, TheMotleyMerchantManifest) then
  70. local zone = GetZone(Spawn)
  71. local Fippy = GetSpawnByLocationID(zone, 434509)
  72. MoveToLocation(Fippy, 18.47, 1.17, 0.28, 6)
  73. MoveToLocation(Fippy, 20.21, -0.39, -9.02, 6)
  74. MoveToLocation(Fippy, -16.11, -0.39, -8.09, 6)
  75. MoveToLocation(Fippy, -21.92, 0.00, -1.78, 6)
  76. AddTimer(NPC, 13000, "despawn_fippy", 1, Spawn)
  77. end
  78. end
  79. function despawn_fippy(NPC, Spawn)
  80. local zone = GetZone(Spawn)
  81. local Fippy = GetSpawnByLocationID(zone, 434509)
  82. Despawn(Fippy)
  83. end
  84. function respawn(NPC)
  85. spawn(NPC)
  86. end