SecondChest.lua 753 B

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : SpawnScripts/GobblerocksHideout/SecondChest.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.16 08:07:25
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheStolenSupplies = 5324
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 50, "SpawnAccess")
  11. AddSpawnAccess(NPC, NPC)
  12. end
  13. function SpawnAccess(NPC, Spawn)
  14. if GetQuestStep(Spawn, TheStolenSupplie) == 4 then
  15. AddSpawnAccess(NPC, Spawn)
  16. else
  17. RemoveSpawnAccess(NPC, Spawn)
  18. end
  19. end
  20. function casted_on(NPC, Spawn, SpellName)
  21. if SpellName == 'collect the chest' then
  22. if GetQuestStep(Spawn, TheStolenSupplies) == 4 then
  23. SetStepComplete(Spawn, TheStolenSupplies, 4)
  24. end
  25. end
  26. end