Общие для всех классов макросы.
БАЗОВЫЕ МАКРОСЫ НА ШАМАНА:
1.
/run TotemThot()
shLatencyCorrection = 0.052
shScriptDelay = 0.03
shTimeGap = 1
function TotemThot()
local Time = GetTime()
local Latency
if shLatencyCorrection then
Latency = shLatencyCorrection
else
_,_,Latency=GetNetStats()
end
if not LastTotemIsWf then
if LastWfTotemReleaseTime > LastWfTotemTime then
local LastTick = GetLastTick(LastWfTotemReleaseTime, LastWfTotemTime, Latency)
if LastTick and Time - LastWfTotemTime + Latency < 130 then
local value = Time-LastTick
if value < 10 then
if not buffed("Grace of Air") and value < shTimeGap then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
else
CastSpellByName("Windfury Totem")
end
else
CastSpellByName("Windfury Totem")
end
else
CastSpellByName("Windfury Totem")
end
else
local LastTick=GetLastTick(Time, LastWfTotemTime, Latency)
if LastTick then
local value = Time - LastTick
if Time - LastWfTotemTime < shTimeGap+1.5 then -- 1st tick
if not buffed("Grace of Air") and value < shTimeGap+1.5 then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
else -- other tick
if not buffed("Grace of Air") and value < shTimeGap and value > shScriptDelay then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
end
else -- nobody can even remember what wf is
CastSpellByName("Windfury Totem")
end
end
end
function GetLastTick(time1, time2, Latency)
local duration = time1 - time2
if duration + Latency > 130 then return nil end
duration = duration+10-math.ceil(duration/10)*10
if duration>5 then duration=duration-5 end
return (time1 - duration)
end
function wvShamanFrameOnEvent()
local Latency
if shLatencyCorrection then
Latency = shLatencyCorrection
else
_,_,Latency=GetNetStats()
end
if string.find(arg1 or "","You cast Windfury Totem")then
LastWfTotemTime=GetTime()-Latency
LastTotemIsWf=true
elseif
string.find(arg1 or "","You cast Grace of Air Totem")
or
string.find(arg1 or "","You cast Windwall Totem")
or
string.find(arg1 or "","You cast Sentry Totem")
or
string.find(arg1 or "","You cast Nature Resistance Totem")
or
string.find(arg1 or "","You cast Grounding Totem")
or
string.find(arg1 or "","You cast Tranquil Air Totem")
then
if LastTotemIsWf then LastWfTotemReleaseTime=GetTime()-Latency end
LastTotemIsWf=false
end
end
if not wvShamanFrame then
LastWfTotemTime=0
LastWfTotemReleaseTime=0
LastTotemIsWf=false
wvShamanFrame=CreateFrame("FRAME","wvShamanFrame")
wvShamanFrame:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
wvShamanFrame:SetScript("OnEvent", wvShamanFrameOnEvent)
end