9
3

anicelily.lua 797 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/anicelily.lua
  3. Script Purpose : for the spawn "an ice lily"
  4. Script Author : theFoof
  5. Script Date : 2013.05.21
  6. Script Notes :
  7. --]]
  8. local FieldTesting = 23
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. SpawnSet(NPC, "action_state", "1494")
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function SpawnAccess(NPC, Spawn)
  18. if GetQuestStep(Spawn, FieldTesting) == 1 then
  19. AddSpawnAccess(NPC, Spawn)
  20. else
  21. RemoveSpawnAccess(NPC, Spawn)
  22. end
  23. end
  24. function casted_on(NPC, Caster, SpellName)
  25. if SpellName == 'collect an ice lily' then
  26. if GetQuestStep(Caster, FieldTesting) == 1 then
  27. AddStepProgress(Caster, FieldTesting, 1, 1)
  28. Despawn(NPC)
  29. end
  30. end
  31. end