apatchofpuresoil.lua 820 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : SpawnScripts/Butcherblock/apatchofpuresoil.lua
  3. Script Author : jakejp
  4. Script Date : 2018.06.13 09:06:04
  5. Script Purpose :
  6. :
  7. --]]
  8. local DiggingInTheYard = 313
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 40, "CheckQuest", "CheckQuest")
  12. SetRequiredQuest(NPC, DiggingInTheYard, 1)
  13. end
  14. function casted_on(Target, Caster, SpellName)
  15. if SpellName == "gather" and GetQuestStep(Caster, DiggingInTheYard) == 1 then
  16. Despawn(Target)
  17. end
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function CheckQuest(NPC, Player)
  23. if HasQuest(Player, DiggingInTheYard) and GetQuestStep(Player, DiggingInTheYard) == 1 then
  24. AddSpawnAccess(NPC, Player)
  25. else
  26. RemoveSpawnAccess(NPC, Player)
  27. end
  28. end