9
3

RyGorrfirepittorch.lua 956 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/RyGorrfirepittorch.lua
  3. Script Purpose : for the spawn "Ry'Gorr firepit torch"
  4. Script Author : theFoof
  5. Script Date : 2013.6.20
  6. Script Notes :
  7. --]]
  8. local HighlyMaterials = 74
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. SetRequiredQuest(NPC, HighlyMaterials, 1)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function SpawnAccess(NPC, Spawn)
  18. if HasQuest(Spawn, HighlyMaterials) and not HasItem(Spawn, 47882) then
  19. AddSpawnAccess(NPC, Spawn)
  20. end
  21. end
  22. function casted_on(NPC, Spawn, SpellName)
  23. if SpellName == 'pick up' then
  24. if HasQuest(Spawn, HighlyMaterials) and not HasItem(Spawn, 47882) then
  25. Despawn(NPC)
  26. SummonItem(Spawn, 47882)
  27. if HasQuest(Spawn, HighlyMaterials) and GetQuestStep(Spawn, HighlyMaterials) == 1 then
  28. SetStepComplete(Spawn, HighlyMaterials, 1)
  29. end
  30. end
  31. end
  32. end