aplankofwood.lua 813 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScriptsFrostfangSeaaplankofwood.lua
  3. Script Purpose : for the spawn "a plank of wood"
  4. Script Author : theFoof
  5. Script Date : 2013.5.6
  6. Script Notes :
  7. --]]
  8. local BoatloadWork = 4
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 40, "CheckQuest", "CheckQuest")
  12. end
  13. function casted_on(Target, Caster, SpellName)
  14. if HasQuest(Caster, BoatloadWork) and GetQuestStep(Caster, BoatloadWork) == 1 and SpellName == "gather " then
  15. AddStepProgress(Caster, BoatloadWork, 1, 1)
  16. Despawn(Target)
  17. end
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function CheckQuest(NPC, Player)
  23. if GetQuestStep(Player, BoatloadWork) == 1 then
  24. AddSpawnAccess(NPC, Player)
  25. else
  26. RemoveSpawnAccess(NPC, Player)
  27. end
  28. end