9
3

door12.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/WailingCaves/door12.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.18 08:02:02
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function usedoor(NPC, Spawn, IsOpen)
  11. local zone = GetZone(NPC)
  12. local LordRee = GetSpawnByLocationID(zone, 404840)
  13. if GetTempVariable(LordRee, "HAILED1") == "false" and IsOpen == false then
  14. CloseDoor(NPC)
  15. SendMessage(Spawn, "Door is closed.", "yellow")
  16. elseif GetTempVariable(LordRee, "HAILED1") == "false" and IsOpen == true then
  17. CloseDoor(NPC)
  18. SendMessage(Spawn, "Door is closed.", "yellow")
  19. elseif IsAlive(LordRee) and IsOpen == true and HasItem(Spawn, 2006) then
  20. CloseDoor(NPC)
  21. elseif IsAlive(LordRee) and HasItem(Spawn, 2006) and IsOpen == false then
  22. OpenDoor(NPC)
  23. RemoveItem(Spawn, 2006)
  24. elseif not IsAlive(LordRee) and IsOpen == false then
  25. SendMessage(Spawn, "Door is closed.", "yellow")
  26. end
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end