Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local a = CreateFrame("Frame")
- a:SetScript("OnEvent",function(self,event)
- if event == "PLAYER_ENTERING_WORLD" then
- -- Debug Chat
- ChatTypeInfo.WHISPER.sticky = 0
- ChatTypeInfo.BN_WHISPER.sticky = 0
- -- Hide DragonFrames at ActionBars etc
- MainMenuBarLeftEndCap:Hide()
- MainMenuBarRightEndCap:Hide()
- MainMenuBarTexture0:Hide()
- MainMenuBarTexture1:Hide()
- MainMenuBarTexture2:Hide()
- MainMenuBarTexture3:Hide()
- BonusActionBarFrameTexture1:SetAlpha(0)
- BonusActionBarFrameTexture2:SetAlpha(0)
- BonusActionBarFrameTexture3:SetAlpha(0)
- BonusActionBarFrameTexture4:SetAlpha(0)
- MainMenuMaxLevelBar0:Hide()
- MainMenuMaxLevelBar1:Hide()
- MainMenuMaxLevelBar2:Hide()
- MainMenuMaxLevelBar3:Hide()
- PetName:Hide()
- TargetFrameTextureFramePVPIcon:SetAlpha(0)
- FocusFrameTextureFramePVPIcon:SetAlpha(0)
- PlayerPVPIcon:SetAlpha(0)
- for i=1,12 do
- _G["ActionButton"..i.."HotKey"]:SetAlpha(0)
- _G["MultiBarBottomRightButton"..i.."HotKey"]:SetAlpha(0)
- _G["MultiBarBottomLeftButton"..i.."HotKey"]:SetAlpha(0)
- _G["BonusActionButton"..i.."HotKey"]:SetAlpha(0)
- _G["MultiBarLeftButton"..i.."HotKey"]:SetAlpha(0)
- _G["MultiBarRightButton"..i.."HotKey"]:SetAlpha(0)
- --_G["ActionButton"..i.."Name"]:SetAlpha(0)
- --_G["MultiBarBottomRightButton"..i.."Name"]:SetAlpha(0)
- --_G["MultiBarBottomLeftButton"..i.."Name"]:SetAlpha(0)
- --_G["BonusActionButton"..i.."Name"]:SetAlpha(0)
- --_G["MultiBarLeftButton"..i.."Name"]:SetAlpha(0)
- --_G["MultiBarRightButton"..i.."Name"]:SetAlpha(0)
- end
- -- Hide Left Raid Frame Manager
- CompactRaidFrameManager:SetAlpha(0)
- -- Bottom Left/Right bar moving
- MultiBarBottomLeft:ClearAllPoints()
- MultiBarBottomLeft:SetPoint("BOTTOMLEFT",ActionButton1,"TOPLEFT",0,6)
- MultiBarBottomLeft.SetPoint = function() end
- MultiBarBottomRight:ClearAllPoints()
- MultiBarBottomRight:SetPoint("BOTTOMLEFT",ActionBarDownButton,"TOPLEFT",9.2,19)
- MultiBarBottomRight.SetPoint = function() end
- -- FocusFrame under TargetFrame
- FocusFrame:ClearAllPoints()
- FocusFrame:SetPoint("CENTER", TargetFrame, "CENTER", 0, -236)
- FocusFrame.SetPoint = function() end
- -- PetBar Moving
- PetActionBarFrame:ClearAllPoints()
- PetActionBarFrame:SetPoint("BOTTOMLEFT",ActionButton1,"TOPLEFT",-7,46.8)
- -- Left/Right Bars moving
- MultiBarLeft:ClearAllPoints()
- MultiBarLeft:SetPoint("BOTTOMRIGHT", UIParent,-43,86)
- MultiBarLeft.SetPoint = function() end
- MultiBarRight:ClearAllPoints()
- MultiBarRight:SetPoint("BOTTOMRIGHT", UIParent,-1,86)
- MultiBarRight.SetPoint = function() end
- -- MultiCastActionBarFrame
- --MultiCastActionBarFrame:ClearAllPoints()
- --MultiCastActionBarFrame:SetPoint("BOTTOMLEFT",ActionButton1,"TOPLEFT",23,45.5)
- --MultiCastActionBarFrame.SetPoint = function() end
- -- Stance Bar moving
- ShapeshiftBarFrame:ClearAllPoints()
- ShapeshiftBarFrame:SetPoint("BOTTOM", UIParent, "BOTTOM", -473, 86)
- ShapeshiftBarFrame.SetPoint = function() end
- -- Silence Stopwatch
- f=CreateFrame("Frame")
- f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- f:SetScript("OnEvent", function(self,event,...)
- if UnitIsEnemy(select(1,...),"player")==1
- and select(5,...)==15487
- then Stopwatch_StartCountdown(0,0,44) Stopwatch_Play()
- end
- end)
- ----------------------------------------------:: Silence Stopwatch
- -- Stopwatch improve
- StopwatchFrame:Show()
- --StopwatchFrame:SetScale(.01)
- --StopwatchFrame:ClearAllPoints()
- --StopwatchFrame:SetPoint("TOPLEFT",40500,0)
- --StopwatchTicker:SetScale(100)
- --StopwatchTicker:SetPoint("TOPLEFT",430,-241)
- --StopwatchFrame:SetMovable(false)
- StopwatchFrame:SetScale(.01)
- StopwatchFrame:ClearAllPoints()
- StopwatchFrame:SetPoint("TOPLEFT",42150,0)
- StopwatchTicker:SetScale(120)
- StopwatchTicker:SetPoint("TOPLEFT",430,-199.4)
- ----------------------------------------------:: Stopwatch improve
- end
- -- Trinket
- if event == "ADDON_LOADED" then
- if IsAddOnLoaded("Blizzard_ArenaUI") then
- --if select(2,IsInInstance()) == "arena" then
- ArenaEnemyFrame1:ClearAllPoints()
- ArenaEnemyFrames:SetScale(1.1)
- ArenaEnemyFrame1:SetPoint("TOPRIGHT",20,6)
- rc=35;rfc=CooldownFrame_SetTimer;aef="ArenaEnemyFrame";hb="HealthBar";trt=GetItemIcon(37865)ctf = CreateFrame;oe="ARENA_OPPONENT_UPDATE"ve="PLAYER_ENTERING_WORLD"tr="RIGHT"LoadAddOn("Blizzard_ArenaUI")
- function Cr(i)local f=ctf("Frame",nil,UIParent)f:SetPoint(tr,_G[aef..i..hb],tr,67,0)f:SetSize(rc,rc)f.t=f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.t:SetTexture(trt)f.c=CreateFrame("Cooldown",nil,f)f.c:SetAllPoints(f)return f;end
- function ur(f,i)f:SetScript("OnEvent",function(_,e,u,_,_,_,s)if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1)elseif(s==7744)then rfc(f.c,GetTime(),30,1)end end end)f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")end
- for i=1,5 do _G["rf"..i]=Cr(i)local f=_G["rf"..i]ur(f,i)f:Hide()end function str(o,m)for i=1, m do local f=_G["rf"..i]if o then f:Show()else f:Hide()f.c:Hide()end end end
- tk=ctf("Frame")tk:SetScript("OnEvent",function(_,e)if e==oe then str(1,GetNumArenaOpponents())else str(nil,5)end end)tk:RegisterEvent(oe)tk:RegisterEvent(ve)
- --end
- end
- end
- a:RegisterEvent("ADDON_LOADED")
- ----------------------------------------------:: Trinket
- -- WotF announce
- local wotf = CreateFrame("Frame")
- wotf.playername = UnitName("player")
- wotf:SetScript("OnEvent",function(...)
- local h = {...}
- if ((h[14]== 7744)
- and (h[11] == wotf.playername)
- and (h[4] == "SPELL_AURA_APPLIED"))
- then
- SendChatMessage("WotF", "PARTY")
- end
- end)
- wotf:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- ----------------------------------------------:: WotF announce
- -- Trinket announce
- local trinket = CreateFrame("Frame")
- trinket.playername = UnitName("player")
- trinket:SetScript("OnEvent",function(...)
- local n = {...}
- if ((n[14]== 42292)
- and (n[11] == trinket.playername)
- and (n[4] == "SPELL_AURA_APPLIED"))
- then
- SendChatMessage("Trinket", "PARTY")
- end
- end)
- trinket:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- -- Hide AFK/DND in chat tabs
- local previd, data, result = 0, {}, nil
- local function filter(self, event, msg, name, _, _, _, _, _, _, _, _, id)
- if previd == id then
- return result
- else
- previd = id
- if data[name] and data[name] == msg then
- result = true
- else
- data[name] = msg
- result = false
- end
- return result
- end
- end
- ChatFrame_AddMessageEventFilter("CHAT_MSG_AFK", filter)
- ChatFrame_AddMessageEventFilter("CHAT_MSG_DND", filter)
- ----------------------------------------------:: Hide AFK/DND in chat tabs
- -- Hide Chat Tabs
- CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0
- CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
- for i=1,NUM_CHAT_WINDOWS do
- local tab = _G["ChatFrame"..i.."Tab"]
- tab.noMouseAlpha = 0
- tab:SetAlpha(0)
- end
- end)
- a:RegisterEvent("PLAYER_ENTERING_WORLD")
- ----------------------------------------------:: Hide Chat Tabs
- ----------------------------------------------:: 3
- _,Class=UnitClass("player");
- if Class == "WARRIOR" then
- bl = {6673,469,871,1719,21118,84584, 85730}
- elseif Class == "SHAMAN" then
- bl={52127,53390,32734,73685}
- elseif Class == "PALADIN" then
- bl = {85497,88819,54149}
- elseif Class == "PRIEST" then
- bl = {6346, 96267, 10060}
- elseif Class == "DRUID" then
- bl={52127,32734,61295,55277,8178,73685,16177,96230,52109}
- elseif Class == "ROGUE" then
- bl={52127,32734,61295,55277,8178,73685,16177,96230,52109}
- elseif Class == "MAGE" then
- bl={64343, 44544, 57761}
- elseif Class == "WARLOCK" then
- bl={52127,32734,61295,55277,8178,73685,16177,96230,52109}
- elseif Class == "HUNTER" then
- bl={52127,32734,61295,55277,8178,73685,16177,96230,52109}
- elseif Class == "DEATHKNIGHT" then
- bl={57330, 81340, 53365}
- end
- ----------------------------------------------:: 1
- bs=30;
- xb=-415.3;
- yb=339.6;
- br=3;
- bdr="BORDER"
- be="UNIT_AURA"
- cbf=CreateFrame;
- gi=GetSpellInfo;
- bm=math.ceil;
- fm=math.floor;
- st=STANDARD_TEXT_FONT;
- function cu(s) return UnitBuff("player",gi(s))end
- ----------------------------------------------:: 2
- function Cb(i,s)
- local _,_,t3=gi(s)
- local f=cbf("Frame")
- f:SetSize(bs,bs)
- f.t=f:CreateTexture(nil,bdr)
- f.t:SetAllPoints(true)
- f.t:SetTexture(t3)
- f.f=f:CreateFontString(nil,bdr)
- f.f:SetFont(st,12,"OUTLINE")
- f.f:SetPoint("BOTTOMRIGHT",0,0)
- return f;
- end
- ----------------------------------------------:: 3
- function vb(s,i,row)
- local b1,_,_,b4=cu(s)
- local f=_G["B"..i]
- if b1 then
- f:Show()
- f:SetPoint("CENTER",xb+(bs+5)*bm((row-1)%br),yb-(bs+10)*bm(row/br))
- if(b4>1)then
- f.f:SetText(b4)
- else
- f.f:SetText("")
- end
- row=row+1;
- end
- return row;
- end
- ----------------------------------------------:: 4
- function ub()
- for i,s in ipairs(bl)do
- local b,_,_,_,_,_,k=cu(s)
- if b then
- local vt=fm(k-GetTime())
- if (vt>=60)then
- vt=bm(vt/60)
- _G["B"..i].c:SetText(vt.."m")
- elseif vt >= 0 then
- _G["B"..i].c:SetText(vt.."s")
- end
- end
- end
- end
- ----------------------------------------------:: 5
- function Cc(f)
- f.c=f:CreateFontString(nil,bdr)
- f.c:SetFont(st,12,"OUTLINE")
- f.c:SetPoint("CENTER",0,-25)
- end
- function db()
- for i in ipairs(bl)do
- _G["B"..i]:Hide()
- end
- end
- ----------------------------------------------:: 6
- for i,s in ipairs(bl)do
- _G["B"..i]=Cb(i,s)
- Cc(_G["B"..i])
- _G["B"..i]:Hide()
- end
- function bb()
- db()
- local bw=1;
- for i,s in ipairs(bl)do
- bw=vb(s,i,bw)
- end
- end
- bk=cbf("Frame")
- bk:SetScript("OnEvent",bb)
- bk:SetScript("OnUpdate",ub)
- bk:RegisterEvent(be)
- ----------------------------------------------:: 7
- cs=15;
- ps=1;
- ctp="CENTER"
- ptp="BOTTOMRIGHT"
- cp=5;
- ct=UNIT_NAME_FONT;
- crt=2;
- cDB={}
- action={}
- ccf=CreateFrame;
- gac=GetActionCooldown;
- ol="OUTLINE"
- cpe="PLAYER_ENTERING_WORLD"
- cau="ACTIONBAR_UPDATE_COOLDOWN"
- co="OnUpdate"
- ----------------------------------------------:: 1
- function rt(f)
- f.e=nil
- f.t:SetText("")
- f:SetScript(co,nil)
- end
- function sf(f,v)
- f.t:SetFont(ct,f.s*v,ol)
- end
- function acv(b)
- local x=b.cooldown
- x.a=b.action
- action[x]=x
- end
- function scv(p,f,po,s)
- if(s>1)then
- f.t:SetPoint(po,p)
- end
- f.s=s;
- end
- ----------------------------------------------:: 2
- function sr(f,e)
- if(e>60)then
- sf(f,0.7)
- if(f.s==cs)then
- return"%d:%02d",e,e
- else
- return"%dm",e+60,e
- end
- elseif(e>=cp)then
- sf(f,1)
- f.t:SetTextColor(1,1,0,1)
- return"%d",e
- elseif(e>1)then
- sf(f,0.9)
- f.t:SetTextColor(1,0,0,1)
- return"%d",e
- else
- return
- end
- end
- ----------------------------------------------:: 3
- function suc(f)
- if not f.e then
- f.e=1;
- f:SetScript(co,function(s,e)
- f.c=f.c+e;
- local fo,v1,v2=sr(f,f.r-f.c)
- if not fo then
- rt(f)
- elseif not v2 then
- f.t:SetFormattedText(fo,v1)
- else
- f.t:SetTextColor(1,1,1,1)
- f.t:SetFormattedText(fo,v1/60,v2%60)
- end
- end)
- end
- end
- ----------------------------------------------:: 4
- function scs(p,f)
- if(p:GetSize()<35)then
- scv(p,f,ptp,ps)
- else
- scv(p,f,ctp,cs)
- end
- end
- function gict(f)
- local c=ccf("Frame",nil,f)
- c:SetFrameLevel(f:GetFrameLevel()+5)
- c.t=c:CreateFontString(nil,"OVERLAY")
- c.t:SetAllPoints(c)
- scs(f:GetParent(),c)
- return c;
- end
- ----------------------------------------------:: 5
- function gct(f)
- if not cDB[f]then
- local c=gict(f)
- c:SetSize(c.s*crt,c.s*crt)
- sf(c,1)
- cDB[f]=c;
- end
- return cDB[f]
- end
- ------------------
- function cvf(f,s,d)
- local c=gct(f)
- if(s and d)then
- c.b=s;
- c.d=d;
- if(s>0 and d>1.5)then
- c.c=0;
- c.r=d-(GetTime()-s);
- suc(c)
- else
- rt(c)
- end
- end
- end
- ----------------------------------------------:: 6
- function cvc(DB)
- for c in pairs(DB)do
- if c.a then
- local s,d=gac(c.a)
- cvf(c,s,d)
- end
- end
- end
- function pcv(_,e)
- if e==cau then
- cvc(action)
- else
- cvc(cDB)
- end
- end
- for _,b in pairs(ActionBarButtonEventsFrame.frames)do
- acv(b)
- end
- ----------------------------------------------:: 7
- vc=ccf("Frame")
- vc:SetScript("OnEvent",pcv)
- vc:RegisterEvent(cpe)
- vc:RegisterEvent(cau)
- hooksecurefunc(getmetatable(ActionButton1Cooldown).__index,"SetCooldown",cvf)
- hooksecurefunc("SetActionUIButton",acv)
- ----------------------------------------------:: 8
- _,Class=UnitClass("player");
- if Class == "WARRIOR" then
- li={}
- cd={}
- elseif Class == "SHAMAN" then
- li={57994,6552,1766,47528,96231,80965,2139,19647}
- cd={5,9,9,9,9,9,23,23}
- elseif Class == "PALADIN" then
- li={57994,6552,1766,47528,96231,80965,2139,19647}
- cd={5,9,9,9,9,9,23,23}
- elseif Class == "PRIEST" then
- li={57994,6552,1766,47528,96231,80965,2139,19647}
- cd={5,9,9,9,9,9,23,23}
- elseif Class == "DRUID" then
- li={}
- cd={}
- elseif Class == "ROGUE" then
- li={}
- cd={}
- elseif Class == "MAGE" then
- li={57994,6552,1766,47528,96231,80965,2139,19647}
- cd={5,9,9,9,9,9,23,23}
- elseif Class == "WARLOCK" then
- li={}
- cd={}
- elseif Class == "DEATHKNIGHT" then
- li={}
- cd={}
- end
- fl=0;
- ic=35;
- xp=-123.5;
- yp=-158.5;
- n=8;
- sfc=CooldownFrame_SetTimer;
- crf=CreateFrame;
- ce=math.ceil;
- ih=IsInInstance;
- gsi=GetSpellInfo;
- up=UIParent
- pe="PLAYER_ENTERING_WORLD"
- cdf="Cooldown"
- function cf(i,s,x,y)
- local _,_,t=gsi(s)
- local f=crf("Frame",nil,up)
- f:SetPoint("CENTER",x,y)
- f:SetSize(ic,ic)
- f.t = f:CreateTexture(nil,"BORDER")
- f.t:SetAllPoints(true)
- f.t:SetTexture(t)
- f.c=CreateFrame(cdf,nil,f)
- f.c:SetAllPoints(f)
- f.c:SetDrawEdge(true)
- f.c:SetReverse(reverse)
- return f;
- end
- function ud(f,ls,lc)
- f:SetScript("OnEvent",
- function(_,_,_,e,_,_,_,b,_,_,_,_,_,s)
- if((bit.band(b,0x40) == 0x40)and e=="SPELL_CAST_SUCCESS"and s==ls)then
- sfc(f.c,GetTime(),lc,1)
- end
- end)
- f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- end
- for i,s in ipairs(li)do
- _G["ib"..i] = cf(i,s,xp+(ic+0)*ce((i-1)%n),yp-(ic+5)*ce(i/n))
- ud(_G["ib"..i],s,cd[i])
- end
- ik=crf("Frame")
- ik:SetScript("OnEvent",
- function()
- local _,t=ih()
- for i,s in ipairs(li)do
- local f=_G["ib"..i]
- if(t=="arena"or fl==0)then
- f:Show()
- f.c:Show()
- else
- f:Hide()
- f.c:Hide()
- end
- end
- end)
- ik:RegisterEvent(pe)
- hooksecurefunc("ActionButton_OnEvent",function(self, event, ...)
- if ( event == "PLAYER_TARGET_CHANGED" ) then
- self.newTimer = self.rangeTimer
- end
- end)
- hooksecurefunc("ActionButton_UpdateUsable",function(self)
- local icon = _G[self:GetName().."Icon"]
- local valid = IsActionInRange(self.action)
- if ( valid == 0 ) then
- icon:SetVertexColor(1.0, 0.1, 0.1) -- SetAlpha(0.3)SetVertexColor(1.0, 0.1, 0.1)
- end
- end)
- hooksecurefunc("ActionButton_OnUpdate",function(self, elapsed)
- local rangeTimer = self.newTimer
- if ( rangeTimer ) then
- rangeTimer = rangeTimer - elapsed
- if ( rangeTimer <= 0 ) then
- ActionButton_UpdateUsable(self)
- rangeTimer = TOOLTIP_UPDATE_TIME
- end
- self.newTimer = rangeTimer
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement