9
3

sackofcoal.lua 735 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/sackofcoal.lua
  3. Script Purpose : "sack of coal" sign
  4. Script Author : theFoof
  5. Script Date : 2013.5.15
  6. Script Notes :
  7. --]]
  8. local HadAHammer = 12
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. --SetRequiredQuest(NPC, HadAHammer, 1)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function SpawnAccess(NPC, Player)
  18. if GetQuestStep(Player, HadAHammer) > 1 then
  19. AddSpawnAccess(NPC, Player)
  20. end
  21. end
  22. function casted_on(Target, Caster, SpellName)
  23. if SpellName == "gather coal" then
  24. if HasQuest(Caster, HadAHammer) then
  25. SummonItem(Caster, 5771)
  26. end
  27. end
  28. end