orcpickaxe.lua 821 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/orcpickaxe.lua
  3. Script Purpose : for the spawns "orc pickaxe"
  4. Script Author : theFoof
  5. Script Date : 2013.7.23
  6. Script Notes :
  7. --]]
  8. local MysteryIceberg = 80
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 50, "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, MysteryIceberg) and not QuestStepIsComplete(Spawn, MysteryIceberg, 1) then
  18. if SpellName == 'Gather_Pickaxe' then
  19. AddStepProgress(Spawn, MysteryIceberg, 1, 1)
  20. Despawn(NPC)
  21. end
  22. end
  23. end
  24. function SpawnAccess(NPC, Spawn)
  25. if HasQuest(Spawn, MysteryIceberg) and not QuestStepIsComplete(Spawn, MysteryIceberg, 1) then
  26. AddSpawnAccess(NPC, Spawn)
  27. end
  28. end