supplycache2.lua 983 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/supplycache2.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.12 07:05:54
  5. Script Purpose :
  6. :
  7. --]]
  8. local BrokenEquipment = 415
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 20, "SpawnAccess", "SpawnAccess")
  11. AddSpawnAccess(NPC, NPC)
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if HasQuest(Spawn, BrokenEquipment) and GetQuestStep(Spawn, BrokenEquipment) == 1 then
  21. if SpellName == 'Check for essence injector' then
  22. SendMessage(Spawn, "The crate does not contain any essence injectors", "white")
  23. end
  24. end
  25. end
  26. function SpawnAccess(NPC, Spawn)
  27. if HasQuest(Spawn, BrokenEquipment) and GetQuestStep(Spawn, BrokenEquipment) == 1 then
  28. AddSpawnAccess(NPC, Spawn)
  29. else
  30. RemoveSpawnAccess(NPC, Spawn)
  31. end
  32. end