VintageHalasianWine.lua 857 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/ScaleYard2/VintageHalasianWine.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.28 05:08:24
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 577
  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, 2) then
  18. if SpellName == 'Gather Vintage Halasian Wine' 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, 2) then
  26. AddSpawnAccess(NPC, Spawn)
  27. else
  28. RemoveSpawnAccess(NPC, Spawn)
  29. end
  30. end