veliumshard.lua 734 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/veliumshard.lua
  3. Script Purpose : for the spawn "velium shard"
  4. Script Author : theFoof
  5. Script Date : 2013.5.31
  6. Script Notes :
  7. --]]
  8. local NoWork = 41
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function casted_on(NPC, Spawn, SpellName)
  17. if SpellName == 'collect the shard' then
  18. AddStepProgress(Spawn, NoWork, 1, 1)
  19. Despawn(NPC)
  20. end
  21. end
  22. function SpawnAccess(NPC, Spawn)
  23. if GetQuestStep(Spawn, NoWork) == 1 then
  24. AddSpawnAccess(NPC, Spawn)
  25. else
  26. RemoveSpawnAccess(NPC, Spawn)
  27. end
  28. end