ariverbankmushroom.lua 977 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/ariverbankmushroom.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.21 11:02:56
  5. Script Purpose :
  6. :
  7. --]]
  8. QUEST = 454
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "SpawnAccess", "SpawnAccess")
  11. AddSpawnAccess(NPC, NPC)
  12. end
  13. function casted_on(NPC, Spawn, SpellName)
  14. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 1 or GetQuestStep(Spawn, QUEST) == 2 or GetQuestStep(SPAWN, QUEST) == 3 then
  15. if SpellName == 'Gathering' then
  16. AddStepProgress(Spawn, QUEST, 2, 1)
  17. Despawn(NPC)
  18. end
  19. end
  20. end
  21. function SpawnAccess(NPC, Spawn)
  22. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 1 or GetQuestStep(Spawn, QUEST) == 2 or GetQuestStep(Spawn, QUEST) == 3 then
  23. AddSpawnAccess(NPC, Spawn)
  24. else
  25. RemoveSpawnAccess(NPC, Spawn)
  26. end
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end