9
3

afaeriegatekeeper.lua 923 B

123456789101112131415161718192021222324252627282930
  1. --[[
  2. Script Name : SpawnScripts/Peatbog_Classic/afaeriegatekeeper.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.05 04:11:18
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Fairy_PeatBog.lua")
  9. require "SpawnScripts/Generic/NPCModule"
  10. function spawn(NPC, Spawn)
  11. NPCModule(NPC, Spawn)
  12. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  13. end
  14. function InRange(NPC, Spawn)
  15. local invul = IsInvulnerable(Spawn)
  16. if GetLevel(Spawn)<20 and not IsInCombat(NPC) and GetFactionAmount(Spawn,365) >-40000 and invul == false then
  17. if GetSpawnLocationID(NPC)== 133779861 or GetSpawnLocationID(NPC) == 133779859 then
  18. Attack(NPC,Spawn)
  19. SendPopUpMessage(Spawn,"The bog faerie gatekeepers don't take kindly to trespassers.",200,0,0)
  20. end
  21. end
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end