PileOfBooksNecromechanical.lua 981 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. SpawnSet(NPC, "display_hand_icon", "0")
  21. SpawnSet(NPC, "show_command_icon", "0")
  22. end
  23. end
  24. end
  25. function SpawnAccess(NPC, Spawn)
  26. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 3 then
  27. AddSpawnAccess(NPC, Spawn)
  28. else
  29. RemoveSpawnAccess(NPC, Spawn)
  30. end
  31. end