soldierstrinket.lua 740 B

12345678910111213141516171819202122232425262728
  1. --[[
  2. Script Name : SpawnScripts/Darklight/soldierstrinket.lua
  3. Script Purpose : Add spawn access and update for queset Purposeful Trinkets (149)
  4. Script Author : Cynnar
  5. Script Date : 1/3/2016
  6. Script Notes : Soldiers Trinket (341284)
  7. --]]
  8. local PurposefulTrinkets = 149
  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, Spawn)
  17. if HasQuest(Spawn, PurposefulTrinkets) then
  18. AddSpawnAccess(NPC, Spawn)
  19. elseif HasQuest(Spawn, PurposefulTrinkets) and GetQuestStep(Spawn, PurposefulTrinkets ) < 2 then
  20. AddSpawnAccess(NPC, Spawn)
  21. else
  22. RemoveSpawnAccess(NPC, Spawn)
  23. end
  24. end