9
3

Soltrinscorpse.lua 888 B

1234567891011121314151617181920212223242526272829303132333435
  1. --[[
  2. Script Name : SpawnScripts/Darklight/Soltrinscorpse.lua
  3. Script Purpose : Used in quest "The Missing Recruit" (ID 141)
  4. Script Author : Cynnar
  5. Script Date : 1/7/2016
  6. Script Notes : Soltrinscorpse (ID 340800)
  7. --]]
  8. local MissingRecruit = 141
  9. function spawn(NPC)
  10. SpawnSet(NPC, "visual_state", 228)
  11. AddSpawnAccess(NPC, NPC)
  12. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function casted_on(NPC, Spawn, SpellName)
  18. if SpellName == "Search for Soltrin's field kit" and not HasItem(Spawn, 13115, 1) then
  19. SummonItem(Spawn, 13115)
  20. SetStepComplete(Spawn, MissingRecruit, 1)
  21. RemoveSpawnAccess(NPC, Spawn)
  22. end
  23. end
  24. function SpawnAccess(NPC, Spawn)
  25. if HasQuest(Spawn, MissingRecruit) and GetQuestStep(Spawn, MissingRecruit) == 1 then
  26. AddSpawnAccess(NPC, Spawn)
  27. else
  28. RemoveSpawnAccess(NPC, Spawn)
  29. end
  30. end