9
3

Garveninvisiblecube.lua 763 B

123456789101112131415161718192021222324252627282930
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/Garveninvisiblecube.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.09 06:09:23
  5. Script Purpose :
  6. :
  7. --]]
  8. local QuestOfferCheck = false -- Avoids spamming quest offer when when/out of range
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. end
  12. function InRange(NPC,Spawn)
  13. if QuestOfferCheck==false then
  14. if GetClass(Spawn)==0 and not HasQuest(Spawn,5725) and not HasCompletedQuest(Spawn, 5725) then
  15. OfferQuest(NPC,Spawn,5725)
  16. QuestOfferCheck = true
  17. AddTimer(NPC,7000,"TimerReset")
  18. end
  19. end
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end
  24. function TimerReset(NPC)
  25. QuestOfferCheck = false
  26. end