PileOfBooksNecromechanical.lua 851 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/Freeport/PileOfBooksNecromechanical.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.15 06:08:02
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 574
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 20, "SpawnAccess", "SpawnAccess")
  11. AddSpawnAccess(NPC, NPC)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function casted_on(NPC, Spawn, SpellName)
  17. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 3 then
  18. if SpellName == 'Decipher Equation' then
  19. SetStepComplete(Spawn, QUEST, 3)
  20. end
  21. end
  22. end
  23. function SpawnAccess(NPC, Spawn)
  24. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 3 then
  25. AddSpawnAccess(NPC, Spawn)
  26. else
  27. RemoveSpawnAccess(NPC, Spawn)
  28. end
  29. end