9
3

Garveninvisiblecube.lua 980 B

123456789101112131415161718192021222324252627282930313233
  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. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  10. SetTempVariable(NPC,"QuestOfferCheck","false")-- Avoids spamming quest offer when when/out of range
  11. end
  12. function InRange(NPC,Spawn)
  13. if GetTempVariable(NPC,"QuestOfferCheck")=="false" then
  14. if GetClass(Spawn)==0 and not HasQuest(Spawn,5725) and not HasCompletedQuest(Spawn, 5725) then
  15. if not HasItem(Spawn,20902) and GetLevel(Spawn) <2 then -- GIVES SMALL BAG
  16. SummonItem(Spawn,20902,1,1)
  17. end
  18. OfferQuest(NPC,Spawn,5725)
  19. SetTempVariable(NPC,"QuestOfferCheck","true")
  20. AddTimer(NPC,10000,"TimerReset")
  21. end
  22. end
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function TimerReset(NPC)
  28. SetTempVariable(NPC,"QuestOfferCheck","false")
  29. end