FrenzyRoot.lua 966 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/FrenzyRoot.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.28 09:02:09
  5. Script Purpose :
  6. :
  7. --]]
  8. QUEST = 402
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 50, "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 == 'Gather' then
  16. AddStepProgress(Spawn, QUEST, 3, 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