9
3

sackofcoal.lua 695 B

1234567891011121314151617181920212223242526272829303132
  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. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function SpawnAccess(NPC, Player)
  17. if GetQuestStep(Player, HadAHammer) > 1 then
  18. AddSpawnAccess(NPC, Player)
  19. end
  20. end
  21. function casted_on(Target, Caster, SpellName)
  22. if SpellName == "gather coal" then
  23. if HasItem(Caster, 5771) == false and HasQuest(Caster, HadAHammer) then
  24. SummonItem(Caster, 5771)
  25. end
  26. end
  27. end