FirstChest.lua 852 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/GobblerocksHideout/FirstChest.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.16 08:07:47
  5. Script Purpose : stolen chest script for quest "The Stolen Supplies"
  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) == 3 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) == 3 then
  23. SetStepComplete(Spawn, TheStolenSupplies, 3)
  24. end
  25. end
  26. end
  27. function respawn(NPC)
  28. spawn(NPC)
  29. end