9
3

alazyRyGorrorc.lua 832 B

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/alazyRyGorrorc.lua
  3. Script Purpose : for the lazy Ry'Gorr orc spawn
  4. Script Author : theFoof
  5. Script Date : 2013.6.10
  6. Script Notes :
  7. --]]
  8. local ThroughEyes = 58
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, ThroughEyes, 1)
  11. AddSpawnAccess(NPC, NPC)
  12. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  13. end
  14. function casted_on(NPC, Spawn, SpellName)
  15. if SpellName == "the Ry'Gorr Scrying Eye" then
  16. if GetQuestStep(Spawn, ThroughEyes) == 1 then
  17. SetStepComplete(Spawn, ThroughEyes, 1)
  18. RemoveSpawnAccess(NPC, Spawn)
  19. end
  20. end
  21. end
  22. function SpawnAccess(NPC, Spawn)
  23. if HasQuest(Spawn, ThroughEyes) and GetQuestStep(Spawn, ThroughEyes) < 2 then
  24. AddSpawnAccess(NPC, Spawn)
  25. elseif not HasCompletedQuest(Spawn, ThroughEyes) then
  26. AddSpawnAccess(NPC, Spawn)
  27. end
  28. end