9
3

Slate.lua 885 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/TempleStreet2/Slate.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.18 03:08:46
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 575
  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) == 1 then
  18. if SpellName == 'Collect Slate' then
  19. AddStepProgress(Spawn, QUEST, 2, 1)
  20. Despawn(NPC)
  21. end
  22. end
  23. end
  24. function SpawnAccess(NPC, Spawn)
  25. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 1 then
  26. AddSpawnAccess(NPC, Spawn)
  27. else
  28. RemoveSpawnAccess(NPC, Spawn)
  29. end
  30. end