From e50ecf3c62c015f86f1c8613e7a0fe12fff6a444 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Sun, 17 Nov 2013 02:16:49 +0400 Subject: [PATCH] Added reincarnation cooldown check --- ElvUI_SLE/modules/autorelease/autorelease.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ElvUI_SLE/modules/autorelease/autorelease.lua b/ElvUI_SLE/modules/autorelease/autorelease.lua index db14260..3ed3e62 100755 --- a/ElvUI_SLE/modules/autorelease/autorelease.lua +++ b/ElvUI_SLE/modules/autorelease/autorelease.lua @@ -6,29 +6,35 @@ local myclass = E.myclass local IsInInstance = IsInInstance local soulstone = GetSpellInfo(20707) local UnitLevel = UnitLevel -local option = false +local GetSpellCooldown = GetSpellCooldown local level = 0 +local cd +local GetTime = GetTime -local function Check(level) +local function Check(level, cd) if ((myclass ~= "SHAMAN") and not (soulstone and UnitBuff("player", soulstone))) then RepopMe() - elseif myclass == "SHAMAN" and level < 32 then + elseif myclass == "SHAMAN" and (level < 32 or cd > 0) then RepopMe() end end function AR:Releasing() local inInstance, instanceType = IsInInstance() - if myclass == "SHAMAN" then level = UnitLevel("player") end + if myclass == "SHAMAN" then + level = UnitLevel("player") + local start, durtion = GetSpellCooldown(20608) + cd = (start + duration - GetTime()) + end if (inInstance and (instanceType == "pvp")) then - if E.db.sle.pvpautorelease then Check(level) end + if E.db.sle.pvpautorelease then Check(level, cd) end end -- auto resurrection for world PvP area...when active if E.db.sle.pvpautorelease then for index = 1, GetNumWorldPVPAreas() do local _, localizedName, isActive = GetWorldPVPAreaInfo(index) - if (GetRealZoneText() == localizedName and isActive) then Check(level) end + if (GetRealZoneText() == localizedName and isActive) then Check(level, cd) end end end end -- 1.7.9.5