astrangeicecrystal.lua 811 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/astrangeicecrystal.lua
  3. Script Purpose : for the spawn "a strange ice crystal"
  4. Script Author : theFoof
  5. Script Date : 2013.5.30
  6. Script Notes :
  7. --]]
  8. local BarteringCrystals = 28
  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 hailed(NPC, Spawn)
  17. end
  18. function casted_on(NPC, Spawn, SpellName)
  19. if SpellName == 'pick up a strange ice crystal' then
  20. if GetQuestStep(Spawn, BarteringCrystals) == 1 then
  21. AddStepProgress(Spawn, BarteringCrystals, 1, 1)
  22. Despawn(NPC)
  23. end
  24. end
  25. end
  26. function SpawnAccess(NPC, Spawn)
  27. if GetQuestStep(Spawn, BarteringCrystals) == 1 then
  28. AddSpawnAccess(NPC, Spawn)
  29. end
  30. end