sackofcoal.lua 748 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : SpawnScripts/Oakmyst/sackofcoal.lua
  3. Script Author : Ememjr
  4. Script Date : 2020.05.08 07:05:16
  5. Script Purpose :
  6. :
  7. --]]
  8. local HadAHammer = 525
  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