Код: Выделить всё
UpdateInterval = 0.2
function CheckTypeCast(Unit)
local spell, _, _, _, _, _, _, _, interrupt = UnitCastingInfo(Unit)
if spell then
if interrupt == false then
return 1
end
if interrupt == true then
return 2
end
end
local spell, _, _, _, _, _, _, interrupt = UnitChannelInfo(Unit)
if spell then
if interrupt == false then
return 1
end
if interrupt == true then
return 2
end
end
return 0
end
local function CalcChannelingStart(startTime)
return GetTime()-startTime/1000;
end
function MyCastRemain(unit, CastType, checkspell, Interruptible)
local spell1, endTime1, notInterruptible1, spell2, startTime2, endTime2, notInterruptible2;
if version8 then
spell1, _, _, _, endTime1, _, _, notInterruptible1, _ = UnitCastingInfo(unit)
spell2, _, _, startTime2, endTime2, _, notInterruptible2, _ = UnitChannelInfo(unit)
else
spell1, _, _, _, _, endTime1, _, _, notInterruptible1, _ = UnitCastingInfo(unit)
spell2, _, _, _, startTime2, endTime2, _, notInterruptible2, _ = UnitChannelInfo(unit)
end;
if (notInterruptible1 and Interruptible) then return 0; end
if (notInterruptible2 and Interruptible) then return 0; end
if spell1 and (CastType == 0 or CastType == 2) and (checkspell == nil or string.upper(checkspell) == string.upper(spell1)) then return CalcCastingFinish(endTime1); end
if spell2 and (CastType == 1 or CastType == 2) and (checkspell == nil or string.upper(checkspell) == string.upper(spell2)) then return CalcChannelingStart(startTime2); end
return 0;
end
Talents = {{}, {}, {}, {}, {}, {}, {}}
local function GetTalents()
for tier=1,7 do
for value=1,3 do
Talents[tier][value] = (select(4, GetTalentInfo(tier, value, 1)))
end
end
end
local Eye = CreateFrame("Frame")
Eye:RegisterEvent("PLAYER_ENTERING_WORLD")
Eye:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
Eye:RegisterEvent("PLAYER_TALENT_UPDATE")
Eye:SetScript("OnEvent",
function(self, event, ...)
if event == "PLAYER_TALENT_UPDATE" then
GetTalents()
elseif event == "PLAYER_SPECIALIZATION_CHANGED" then
GetTalents()
elseif event == "PLAYER_ENTERING_WORLD" then
GetTalents()
Eye:UnregisterEvent("PLAYER_ENTERING_WORLD")
end
end
)