qst_herga_x5_helm.lua 886 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/qst_herga_x5_helm.lua
  3. Script Purpose : for the helm during the quest "All That Remains"
  4. Script Author : theFoof
  5. Script Date : 2013.6.5
  6. Script Notes :
  7. --]]
  8. local AllRemains = 55
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. end
  13. function casted_on(NPC, Spawn, SpellName)
  14. if SpellName == 'retrieve the helm' then
  15. if GetQuestStep(Spawn, AllRemains) == 1 then
  16. SetStepComplete(Spawn, AllRemains, 1)
  17. local orc = SpawnByLocationID(GetZone(NPC), 33474)
  18. Attack(orc, Spawn)
  19. elseif GetQuestStep(Spawn, AllRemains) == 3 then
  20. SetStepComplete(Spawn, AllRemains, 3)
  21. RemoveSpawnAccess(NPC, Spawn)
  22. end
  23. end
  24. end
  25. function SpawnAccess(NPC, Spawn)
  26. if HasQuest(Spawn, AllRemains) and GetQuestStep(Spawn, AllRemains) < 4 then
  27. AddSpawnAccess(NPC, Spawn)
  28. end
  29. end