9
3

VigoCerebus.lua 971 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/Zek/VigoCerebus.lua
  3. Script Purpose : Open the gate to Deathfist Citadel upon death and close upon spawning
  4. Script Author : Jabantiz
  5. Script Date : 8/28/2016
  6. Script Notes :
  7. --]]
  8. local GateLower = 1900304
  9. local GateOpenedY = -38
  10. function spawn(NPC)
  11. local bridgeGate = GetSpawn(NPC, GateLower)
  12. if bridgeGate ~= nil and GetY(bridgeGate) == GateOpenedY then
  13. UseWidget(bridgeGate)
  14. end
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function death(NPC, Spawn)
  20. local bridgeGate = GetSpawn(NPC, GateLower)
  21. if bridgeGate ~= nil and GetY(bridgeGate) ~= GateOpenedY then
  22. UseWidget(bridgeGate)
  23. local players = GetPlayersInZone(GetZone(NPC))
  24. for index, player in pairs(players) do
  25. SendPopUpMessage(player, "With the slaying of Vigo, the Deathfist Citadel gate is unlocked!", 255, 0, 0)
  26. SendMessage(player, "With the slaying of Vigo, the Deathfist Citadel gate is unlocked!", "red")
  27. end
  28. end
  29. end