2018년 6월 17일 일요일

BfA Map API

채팅창에 /api C_Map 하면 대부분 나옴

Map ID
/dump WorldMapFrame:GetMapID()
Map Info
/dump C_Map.GetMapInfo(MapID)
- mapType, mapID, name, parentMapID

Coordinates
/dump C_Map.GetPlayerMapPosition(MapID, UnitToken):GetXY()
/run local x,y=C_Map.GetPlayerMapPosition(MapUtil.GetDisplayableMapForPlayer(), "player"):GetXY();print(string.format("%.1f %.1f", x*100, y*100))
Current Map
/dump MapUtil.GetDisplayableMapForPlayer();

2018년 6월 13일 수요일

기본 레이드 프레임에 특정 버프 표시

원본 출처 : https://eu.battle.net/forums/en/wow/topic/17613434222

Lua (BfA)
local indicators = {}
local buffs = {}
local_, class = UnitClass("player");

if (class == "PRIEST" ) then
buffs = {
[17] = true, --보막(Power Word: Shield)
[1706] = true --공중 부양
}
end

if (class == "MONK" ) then
buffs = {
[115151] = true --소생의 안개(Renewing Mist)
}
end

local function getIndicator(frame)
local indicator = indicators[frame:GetName()]
if not indicator then
indicator = CreateFrame("Button", nil, frame, "CompactAuraTemplate")
indicator:ClearAllPoints()
indicator:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -3, -2)
indicator:SetSize(22, 22)
indicator:SetAlpha(1)
indicators[frame:GetName()] = indicator
end
return indicator
end

local function updateBuffs(frame)
if not frame:IsVisible() then return end

local indicator = getIndicator(frame)
local sID = nil
for i = 1, 40 do
local buffName, _, _, _, _, _, ut, _, _, sID = UnitBuff(frame.displayedUnit, i);
if not sID then break end
if buffs[sID] and ( ut == "player" or ut == "pet" ) then
indicator:SetSize(frame.buffFrames[1]:GetSize()) -- scale
CompactUnitFrame_UtilSetBuff(indicator, frame.displayedUnit, i, nil);
return
end
end
indicator:Hide()
end
hooksecurefunc("CompactUnitFrame_UpdateBuffs", updateBuffs)

BuffName은 언어별로 다르기 때문에 spell ID를 가지고 우측 위에 표시

2018년 6월 10일 일요일

행동 단축바 배경 없애기

액션바 배경




Legion
MainMenuBarLeftEndCap:Hide();
MainMenuBarRightEndCap:Hide();
MainMenuBarPageNumber:Hide();
ActionBarDownButton:Hide();
ActionBarUpButton:Hide();
for i=0,3 do _G["MainMenuBarTexture"..i]:Hide() end
SlidingActionBarTexture0:SetAlpha(0);
SlidingActionBarTexture1:SetAlpha(0);

 BfA

MainMenuBarArtFrame.LeftEndCap:Hide();
MainMenuBarArtFrame.RightEndCap:Hide();
ActionBarDownButton:Hide();
ActionBarUpButton:Hide();
MainMenuBarArtFrame.PageNumber:Hide();
MainMenuBarArtFrameBackground:Hide();
MicroButtonAndBagsBar.MicroBagBar:Hide();SlidingActionBarTexture0:SetAlpha(0)
SlidingActionBarTexture1:SetAlpha(0)
hooksecurefunc("StanceBar_Update", function()
StanceBarLeft:Hide()
StanceBarMiddle:Hide()
StanceBarRight:Hide()
local SBF=StanceBarFrame;SBF:SetScale(0.8)SBF:ClearAllPoints();SBF:SetPoint("BOTTOMLEFT", ActionButton1, "TOPLEFT", 0, 6);SBF.SetPoint = function() end
end)


추가 행동바
ExtraActionButton1.style:SetAlpha(0)

주둔지 능력/ 경호원 기술 등등 (ZoneAbilityFrame)
ZoneAbilityFrame.SpellButton.Style:SetAlpha(0)

2018년 6월 7일 목요일

자리비움 검사 (AFK)

1. 전투준비 API
/run DoReadyCheck();

2.자리비움 공대원 이름 출력 (공격대 상태일 경우에만 작동)
koKR
/run for i=1, GetNumGroupMembers() do local name, rank, sub, _, _, _ = GetRaidRosterInfo(i);if UnitIsAFK("raid"..i) then print("자리비움 ▶ ["..sub.."파티] "..name)end;end
EnUS
/run for i=1, GetNumGroupMembers() do local name, rank, sub, _, _, _ = GetRaidRosterInfo(i);if UnitIsAFK("raid"..i) then print("AFK ▶ [ Group"..sub.."] "..name)end;end

무작 던전 큐 넣기

Script
/run SetLFGRoles(1,1,1,1);SetLFGDungeon(1,GetRandomDungeonBestChoice());JoinLFG(1)
  • SetLFGRoles(1,1,1,1) - 역할 설정 모두 체크
  • SetLFGDungeon(1,GetRandomDungeonBestChoice()) - 현재 레벨에 적합한 던전으로 설정, 특정 던전 선택시에는 GetRandomDungeonBestChoice() 대신 해당 던전의 queue ID를 입력
  • JoinLFG(1) - 대기 시작

차단 성공/ 실패 알림

Lua
local alert=CreateFrame("Frame")
alert:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
alert:SetScript("OnEvent", function(...)
local _,combatEvent,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags, destRaidFlags,spellID,spellName,_,param1,_,_,param4 = CombatLogGetCurrentEventInfo()

if sourceGUID==UnitGUID("player") and destName~=nil then
    if spellID==183752 or spellID==47528 or spellID==96231 or spellID==106839 or spellID==6552 or spellID==119910 or spellID==57994 or spellID==147362 or spellID==187707 or spellID==2139 or spellID==1766 or spellID==116705 then
    if combatEvent=="SPELL_INTERRUPT" then
        print("\124cffff0000차단\124r : "..destName.."의 "..GetSpellLink(param1)) -- 차단
    else
        print("차단실패 : "..destName)
        end
    end
end
end)

일반적인 주요 전투이벤트 경보는 차단 경보 관련글을 참조

차단에 성공할 경우 차단 : 대상의 주문명, 차단에 실패한 경우 차단실패 : 대상이름이 출력됨
실패 경보를 원하는 사람이 있어서 만들었지만 쓸데없이 스캔범위가 넓어지고 차단 기술의 Spell ID를 일일이 등록해 줘야 하는 단점이 있음

메시지 출력 스크립트 (SendChatMessage) 종족별 언어 적용



와민정음으로 종족 언어를 활용하여 적을 능욕하는 다양한 방법이 알려져 있지만 다들 전투중에 언어를 바꾸기 불편해서 오크어/공용어만 써먹느라 인성질을 찰지게 못하는 것 같아서 내심 안타까웠다.

이제 더 간편하게 종족별 언어를 활용하여 인성질하는 방법을 알아보자.

여기를 많이 참고했어. 출처: http://wowwiki.wikia.com/wiki/API_SendChatMessage



이렇게 생긴 메시지 보내기 스크립트 기본형에서 저 안의 내용들을 바꾸면 된다

/run SendChatMessage("내용" ,"chatType" ,"언어" ,"옵션")


항목별 설명

1. 내용 : 출력될 문구


2. chatType : 대화 종류

"SAY" 일반대화 (/s)

"EMOTE" 감정표현 (/e)
- "/e 테스트" 라고 입력하면 "ㅇㅇ가 테스트" 라고 채팅창에 출력되는 방식. 적에게는 알수없는 행동을 합니다로 나오게 됨. /엉엉 /낄낄같은 감정표현은 이거 말고 /run DoEmote("action")을 사용하면 되는데 감정표현 명령어 리스트는 여기를 참조해. [링크]

"YELL" 외치기 (/y).

"PARTY" 파티 (/p)

"GUILD" 길드 (/g)

"OFFICER" 길드 관리자 (/o)

"RAID" 공격대 (/raid)

"RAID_WARNING" 공격대 경보(/rw)

"INSTANCE_CHAT" 인스턴스 대화 (/i)
- 로컬 파티를 제외한 모든 인스턴스 파티에서 적용. (IsInGroup(2) 결과가 true일 경우)

"BATTLEGROUND" 전장 (/bg)

"WHISPER" 귓속말 (/w)
- "옵션"칸에 대상의 ID를 입력. ex> /run SendChatMessage("내용" ,"WHISPER" ,"" ,"아이디")

"CHANNEL" 채널대화 - "옵션"칸에 채널의 번호를 입력. ex> /run SendChatMessage("내용" ,"CHANNEL" ,"" ,"5")


3. 언어 : 일반 대화 또는 외치기일 경우에만 적용되는데 기본 언어를 사용할 경우 생략하고 종족별 언어를 사용할 경우 언어 번호를 입력.

자신이 구사할 수 있는 언어의 번호를 확인하려면 아래의 스크립트로 확인할 수 있어.
/run for i = 1, GetNumLanguages() do print(GetLanguageByIndex(i)) end
나엘 악사로 저 매크로를 입력하면 결과는 이렇게 출력되겠지?
나이트 엘프어 2
공용어 7
악마어 8

아래에 언어 번호 리스트를 써놨지만 패치마다 변동이 있을 수 있으니까 가급적 인게임에서 위의 스크립트로 확인하는것을 추천해

Orcish(오크-호드 공용어) = 1,
Darnassian(나엘) = 2,
Taurahe(타우렌) = 3,
Dwarvish(드워프) = 6,
Common(인간-공용어) = 7,
Demonic(악마어) = 8,
Thalassian(부렐) = 10,
Gnomish(노움) = 13,
Troll(트롤) = 14,
Gutterspeak(언데드)= 33,
Draenei(드레나이)= 35,
Worgen(늑인)= 39,
Goblin(고블린)= 40,
Pandaren1(판다중립)= 42,
Pandaren2(판다얼라)= 43,
Pandaren3(판다호드)= 44

예를 들어서 드레나이 캐릭터로 /run SendChatMessage("웁웁!" ,"YELL","");이라고 입력하면 평범하게 웁웁! 하고 외치게 되지만 /run SendChatMessage("웁웁!" ,"YELL" ,"35"); 라고 입력하면 좀더 귀엽게 드레나이어로 웁웁! 하고 외치게 됨


4. 옵션 : 평소에는 생략. 귓속말이나 채널대화일 경우에만 대상 아이디, 채널번호같은 추가정보 입력


이제 이걸 응용해서 마우스오버나 타게팅한 대상의 유닛이름을 넣어서 써먹을 수도 있음

/run local name = GetUnitName("mouseover",true); SendChatMessage("내용1" .. name .. "내용2", "SAY","")

이런 식으로.

그리고 트롤 캐릭터로 가로쉬 헬스크림 대족장님께 커서를 갖다대고

/run local name = GetUnitName("mouseover",true); SendChatMessage("" .. name .. "XX가지고 XX하고싶다", "SAY", 14)

라는 스크립트를 실행하면 [트롤어] 가로쉬 헬스크림 XX가지고 XX하고싶다 라고 일반대화로 출력됨. 이렇게 말하면 가로쉬님이 들으시더라도 트롤어를 알아들을 리 없으니까 크게 혼나지 않을거야.




이제 알겠지?

그럼 오늘부턴 보다 다양해진 레퍼토리를 활용해서 우리 모두 즐거운 능욕플레이를 하도록 하자

자동 올부공 (SetEveryoneIsAssistant)

내가 공격대장일 경우 전장 입장시 자동으로 부공 권한 부여

Lua
hooksecurefunc("RaidFrameAllAssistCheckButton_UpdateAvailable", function(self)
    if select(2,IsInInstance())=="pvp" and (UnitIsGroupLeader("player"))and not IsEveryoneAssistant() then
            SetEveryoneIsAssistant(true);
    end;
end)

부공 권한 부여 인게임 스크립트. 매크로에 넣고 써도 됨
Script
  • 전체 승급
/run SetEveryoneIsAssistant(true);
  • 특정인 승급
/run PromoteToAssistant("unit")


특정 대상 접근시 경보 - 이름표

이름표를 활성화한 경우 이름표가 보이는 시점에 경보를 울림
if uName == "경보할 유닛 이름" 을 넣어서 사용
은신한 유닛은 이름표가 바로 보이지 않는 경우가 많기 때문에 판정이 정확하지 않음

1. 소리 알림
Lua
 local HTD = CreateFrame("Frame")
HTD:RegisterEvent("NAME_PLATE_UNIT_ADDED")
HTD:SetScript("OnEvent", function(self,event,...)
local uID = ...
local uName = GetUnitName(uID)
if event == "NAME_PLATE_UNIT_ADDED" then
    if uName == "찰스 가스틀리" or uName=="고든 맥켈라르" then
        PlaySound(8960)
    end
end
end)

2. 채팅창+경보프레임 알림
Lua
local HTD = CreateFrame("Frame")
HTD:RegisterEvent("NAME_PLATE_UNIT_ADDED")
HTD:SetScript("OnEvent", function(self,event,...)
local uID = ...
local uName = GetUnitName(uID)
if event == "NAME_PLATE_UNIT_ADDED" then
    if uName == "닉네임" then
        RaidNotice_AddMessage(RaidWarningFrame,uName.." 접근!!",ChatTypeInfo["RAID_WARNING"]);print("124cffff4800접근 경보 ▶ 124r"..uName)
    end
end
end)


전장 전광판(WorldStateScoreFrame) 이동

Lua
--전광판 이동
local function WSF(self);
    self:SetScale(1);
    self:ClearAllPoints();
    self:SetPoint("CENTER",UIParent,"CENTER",0,0);
end;
WorldStateScoreFrame:HookScript("OnShow",WSF);
Script
/run local function WSF(self)self:SetScale(1);self:ClearAllPoints();self:SetPoint("CENTER",UIParent,"CENTER",0,0)end;WorldStateScoreFrame:HookScript("OnShow",WSF)


SetPoint("CENTER",UIParent,"CENTER",0,0) 에서 0,0 대신 원하는 좌표 입력
http://wowwiki.wikia.com/wiki/API_Region_SetPoint


<참고>
전광판 말고 맨 위에 깃 스코어같은거 나오는 프레임은
UIWidgetTopCenterContainerFrame

개인 자원바 없이 대상 이름표 위에 특수자원 표시

BfA - 개인자원표시와 적대상 위에 표시 옵션이 별개로 작동하는 것을 확인함
/run SetCVar("nameplateShowSelf", 0);SetCVar("nameplateResourceOnTarget", 1)




Lua
SetCVar("nameplateShowSelf", 1) -- 개인자원바 보기
SetCVar("nameplateResourceOnTarget", 1) --대상 이름표에 특수자원 표시
SetCVar("nameplateShowAll", 1) -- 항상 이름표 표시
SetCVar("nameplatePersonalShowAlways", 1) -- 개인자원바 항상 표시
SetCVar("nameplateSelfAlpha", 0) -- 개인자원바 투명도

Script
/run SetCVar("nameplateShowSelf",1);SetCVar("nameplateResourceOnTarget", 1);SetCVar("nameplateShowAll",1);SetCVar("nameplatePersonalShowAlways",1);SetCVar("nameplateSelfAlpha",0);ReloadUI()

인터페이스 설정-이름에서 대상 이름표에 특수자원 표시를 체크한 뒤 개인 자원바의 투명도를 0으로 설정해 놓아도 이름표가 사라졌다 다시 나타나는 과정에서 다시 보이기도 하기 때문에 부가 설정이 필요함

2018년 6월 6일 수요일

미니맵 위치 표시(Minimap ping)

Lua
 --미니맵 핑테러 검거
CreateFrame("FRAME","p")
p:RegisterEvent("MINIMAP_PING")
p:SetScript("OnEvent",function(s,e,u)
    local pn=UnitName(u)
    local _,c=UnitClass(u)
    local color=RAID_CLASS_COLORS[c]
    if pn~=UnitName("player") then
        print("Ping : \124c"..color.colorStr..pn.."\124r - "..tonumber(date("%H"))..":"..tonumber(date("%M"))..":"..tonumber(date("%S")))
    end
end)

 Script
/run local p=CreateFrame("FRAME")p:RegisterEvent("MINIMAP_PING")p:SetScript("OnEvent",function(s,e,u)local pn=UnitName(u)if pn~=UnitName("player") then print("Ping : \124cffff0000"..pn.."\124r")end end) 
현재 위치에 미니맵 핑 찍기
7.x.x Legion
/run Minimap:PingLocation(GetPlayerMapPosition("player"))
8.0.1 BfA
/run Minimap:PingLocation(C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit("player"),"player"))

개인자원바 버블 이동

Lua
local function fn(...)
if NamePlateDriverFrame:GetClassNameplateBar()~=nil then
if select(2, NamePlatePlayerResourceFrame:GetChildren())~=nil then
local CR=NamePlateDriverFrame:GetClassNameplateBar();
    CR:ClearAllPoints();
    CR:SetPoint("Center",UIParent,"Center",0,-143);
    CR.SetPoint=function()end;
end;
end;
end;
NamePlateDriverFrame:HookScript("OnEvent",fn)

전 클래스 공통으로 사용하는 개인자원바에서 특수 자원 이동
(룬바, 조각, 버블 등등)

PlayerPowerBarAlt (Alternative power bar)



Lua
-- 파워바 옮기기
local am = CreateFrame("Frame", nil, UIParent)
PlayerPowerBarAlt:SetMovable(true)
PlayerPowerBarAlt:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 850)
PlayerPowerBarAlt:SetAlpha(0.75)
PlayerPowerBarAlt:SetUserPlaced(true)
am:SetAllPoints(PlayerPowerBarAlt)

Script
/run local PA=PlayerPowerBarAlt;local am=CreateFrame("Frame","",UIParent);PA:SetMovable(true);PA:SetPoint("BOTTOM", UIParent, "BOTTOM",0,850);PA:SetUserPlaced(true);am:SetAllPoints(PlayerPowerBarAlt)

위치 - SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 850)
투명도 -  SetAlpha(0.75) 기본값 1
 

2018년 6월 5일 화요일

캐릭터 버프 디버프 역순정렬

기본의 우측->좌측 대신 반대 방향인 좌->우로 배열
(Invert BuffFrame growth direction - Left to Right)

Buff
-- 버프 역순정렬/위치이동
hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", function()
    for i = 1, BUFF_ACTUAL_DISPLAY do
        _G["BuffButton"..i]:SetScale(1)
        _G["BuffButton"..i]:ClearAllPoints()

        if i > 1 and mod(i, BUFFS_PER_ROW) == 1 then
            _G["BuffButton"..i]:SetPoint("TOP", _G["BuffButton"..(i-BUFFS_PER_ROW)], "BOTTOM", 0, -BUFF_ROW_SPACING)
        elseif i == 1 then
            _G["BuffButton"..i]:SetPoint("TOPLEFT", UIParent, 40, -125)
        else
            _G["BuffButton"..i]:SetPoint("TOPLEFT", _G["BuffButton"..i-1], 35, 0)
        end
    end
end)


Debuff
-- 디버프 역순정렬/위치이동
hooksecurefunc("DebuffButton_UpdateAnchors", function (buttonName, index)
    local buff = _G[buttonName..index]
    local numBuffRows = math.floor(BUFF_ACTUAL_DISPLAY/9) + 1
    buff:SetScale(1)
    buff:ClearAllPoints()
    if index > 1 and mod(index, BUFFS_PER_ROW) == 1 then
        buff:SetPoint("TOP", _G[buttonName..(index-BUFFS_PER_ROW)], "BOTTOM", 0, -BUFF_ROW_SPACING)
    elseif index == 1 then
        buff:SetPoint("TOPLEFT", _G["BuffButton1"], 0, (-55 + (numBuffRows * -45)))
    else
        buff:SetPoint("TOPLEFT", _G[buttonName..(index-1)], 35, 0)
    end
end)

Nameplate Castbar

이름표 시전바 높이/폰트/아이콘 크기 변경
Lua
local _N = CreateFrame("Frame")
_N:RegisterEvent("NAME_PLATE_UNIT_ADDED")
_N:SetScript("OnEvent", function(self, event, unit)
if self:IsForbidden() then return end
    local p = C_NamePlate.GetNamePlateForUnit(unit).UnitFrame
--Castbar Height
    local defaultH = p.castBar:GetHeight()
    p.castBar:SetHeight(defaultH*2)
--Castbar Font
    local fontName, fontHeight, fontFlags = p.castBar.Text:GetFont()
    p.castBar.Text:SetFont(fontName, fontHeight*1.8)
--Castbar icon
    local defaultS = p.castBar.Icon:GetHeight()
    p.castBar.Icon:SetSize(defaultS*1.5,defaultS*1.5)
    p.castBar.Icon:SetPoint("RIGHT",p.castBar,"LEFT",0,0)
end)
p.castBar:SetHeight(2*defaultH) ->시전바 높이를 기본의 2배로
p.castBar.Text:SetFont(fontName, fontHeight*1.8) -> 시전바 글씨를 원래 크기의 1.8배로
p.castBar.Icon:SetSize(defaultS*1.5,defaultS*1.5) -> 시전바 아이콘 크기를 원래 크기의 1.5배로
p.castBar.Icon:SetPoint("RIGHT",p.castBar,"LEFT",0,0) -> 아이콘 위치 보정

높이 2배/ 폰트 1.8배 적용 예시



[안건종료] 투물추적기

구글 드라이브 링크
 InvisAlert

시시한 투명의 물약 사용시 경보 + 내가 공격대장일 경우 자동으로 올부공 승격

격아 작동 업데이트

Handynotes 모듈 (Draenor, Legion)

한글화 작업했던 것

BfA 8.0.x 클라이언트 호환

HandyNotes_DraenorTreasures

HandyNotes_LegionRaresTreasures

대상 시전바 / 주시대상 시전바

대상 시전바(Target)
/run TargetFrameSpellBar:SetScript("OnShow", nil)TargetFrameSpellBar:ClearAllPoints();TargetFrameSpellBar:SetPoint("CENTER",TargetFrame,"CENTER",0,100);TargetFrameSpellBar.SetPoint = function()end;
주시 시전바(Focus)
/run FocusFrameSpellBar:SetScript("OnShow", nil)FocusFrameSpellBar:ClearAllPoints();FocusFrameSpellBar:SetPoint("CENTER",FocusFrame,"CENTER",0,100);FocusFrameSpellBar.SetPoint = function()end;

유닛프레임에 종속시키기를 원하지 않을 경우 Target/FocusFrame 대신 UIParent 입력

기본 액션바 쿨다운 숫자 크기

Lua
hooksecurefunc("ActionButton_UpdateCooldown", function(button)
local cdt = _G[button:GetName().."Cooldown"];
cdt:SetScale(1);
end)

Script
/run hooksecurefunc("ActionButton_UpdateCooldown", function(button) local cdt = _G[button:GetName().."Cooldown"] cdt:SetScale(1) end)


SetScale(1)에서 기본값인 1 대신 원하는 숫자를 넣어서 조정

연맹전당 상단바 숨기기 (OrderHallCommandBar)

Lua
 -- 연맹전당 바 숨기기
hooksecurefunc("OrderHall_CheckCommandBar", function() if OrderHallCommandBar then OrderHallCommandBar:Hide();end;end)
Script
/run OrderHall_CheckCommandBar = function() end; if OrderHallCommandBar then OrderHallCommandBar:Hide() end

액션바 스킬 자동배치 차단

Lua
-- 스킬 자동배치 차단
IconIntroTracker.RegisterEvent = function() end
IconIntroTracker:UnregisterEvent('SPELL_PUSHED_TO_ACTIONBAR')

새로운 기술 습득시 자동으로 행동 단축바의 빈 칸에 채워지는 현상 방지

경험치바 유물력바 명예바 등등 숨기기 (StatusTrackingBarManager)

↑이거

BfA

StatusTrackingBarManager:Hide();





Legion
Lua
-- 경험치바 숨기기
local bh
for _,bh in next,{MainMenuExpBar, MainMenuBarMaxLevelBar, ReputationWatchBar, ArtifactWatchBar,HonorWatchBar} do
    bh:UnregisterAllEvents();
    bh.pauseUpdates = true
    bh:Hide();
    bh.Show = bh.Hide;
end
Script
/run local bh;for _,bh in next,{MainMenuExpBar, MainMenuBarMaxLevelBar, ReputationWatchBar, ArtifactWatchBar,HonorWatchBar} do bh:UnregisterAllEvents();bh.pauseUpdates = true;bh:Hide();bh.Show=bh.Hide;end

주문 이벤트 경보 (Spell Alert)

BfA
Lua
--Spell Alert
local alert=CreateFrame("Frame")
alert:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
alert:SetScript("OnEvent", function(...)
local _,combatEvent,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags, destRaidFlags,spellID,spellName,_,param1,_,_,param4 = CombatLogGetCurrentEventInfo()

if sourceGUID == UnitGUID("player") and combatEvent=="SPELL_INTERRUPT" then
    print("\124cffff0000차단\124r : "..destName.."의 "..GetSpellLink(param1)) -- 차단 Interrupt
elseif sourceGUID == UnitGUID("player") and combatEvent=="SPELL_DISPEL" and (bit.band(destFlags,COMBATLOG_OBJECT_REACTION_FRIENDLY)==COMBATLOG_OBJECT_REACTION_FRIENDLY) then
    print("\124cff00ff00해제\124r : "..destName.."의 "..GetSpellLink(param1)) -- 해제(아군) Dispel(friendly)
elseif sourceGUID == UnitGUID("player") and combatEvent=="SPELL_DISPEL" and (bit.band(destFlags,COMBATLOG_OBJECT_REACTION_HOSTILE)==COMBATLOG_OBJECT_REACTION_HOSTILE) then
    print("\124cffff0000해제\124r : "..destName.."의 "..GetSpellLink(param1)) -- 해제(적) Dispel(hostile)
elseif sourceGUID == UnitGUID("player") and combatEvent=="SPELL_STOLEN" then
    print("\124cffff0000훔치기\124r : "..destName.."의 "..GetSpellLink(param1)) -- 훔치기 Steal
elseif destGUID == UnitGUID("player") and combatEvent=="SPELL_MISSED" and param1=="REFLECT" then
    print("\124cffff0000반사\124r : "..sourceName.."의 "..GetSpellLink(spellID)) -- 반사 Reflect
end
end)


차단 해제 마훔 반사 등등 이벤트 발생시 개인 채팅창으로 알림
이벤트 : ㅁㅁ의 기술명 형식으로 출력

Example








참조 : 차단 성공/ 실패, 쿨기 사용

중앙 하단 팝업 대화창 (TalkingHeadFrame)

애드온으로 만들 경우 /run 삭제하고 뒷부분만 넣기

Hide
/run if not IsAddOnLoaded("Blizzard_TalkingHeadUI") then LoadAddOn("Blizzard_TalkingHeadUI") end;TalkingHeadFrame:SetScript("OnEvent", nil);TalkingHeadFrame:Hide();




Move
/run LoadAddOn("Blizzard_TalkingHeadUI")local function TH(self)self:SetMovable(true)self.ignoreFramePositionManager=true;self:ClearAllPoints()self:SetPoint("TOP",UIParent,0,-100)end;TalkingHeadFrame:HookScript("OnShow",TH)


"TOP",UIParent,0,-100 대신 다른 위치를 지정해서 원하는 위치로 이동
http://wowwiki.wikia.com/wiki/API_Region_SetPoint

유닛프레임 오라크기

버프 크기(Buff)
/run hooksecurefunc("TargetFrame_UpdateBuffAnchor", function(s,bn,i,_,_,z,...)local B,S=_G[bn..i],z*1.3;B:SetWidth(S);B:SetHeight(S);end)


디버프 크기(Debuff)
/run hooksecurefunc("TargetFrame_UpdateDebuffAnchor", function(s,dn,i,_,_,z,...)local D,S=_G[dn..i],z*1.3 D:SetWidth(S);D:SetHeight(S);end)




1.3 대신 다른 숫자를 넣어서 조절하면 됨

퀘스트창에 현재/전체 퀘스트 갯수 표시


Lua
--퀘스트 갯수 표시
local CurrentQN = CreateFrame("FRAME", "CurrentQN", QuestScrollFrame)
CurrentQN:SetPoint("TOP", QuestScrollFrame, 0, 25)
CurrentQN:SetWidth(200)
CurrentQN:SetHeight(20)

CurrentQN.text = CurrentQN:CreateFontString()
CurrentQN.text:SetPoint("CENTER")
CurrentQN.text:SetSize(200, 20)
CurrentQN.text:SetFont("Fonts\\FRIZQT__.TTF", 12, "")

CurrentQN:RegisterEvent("QUEST_LOG_UPDATE")
CurrentQN:SetScript("OnEvent",function(self)
    self.text:SetText(select(2,GetNumQuestLogEntries()).." / "..MAX_QUESTS)
end)


7 / 25 형식으로 표시
e.g.

채팅창 막타 알림 스크립트

매 결정타 획득시 채팅창으로 ㅁㅁㅁ 처치! 라는 메시지 출력
파티 상태가 아닐 경우는 일반 대화, 파티 상태일 경우 해당 파티에 맞는 대화창으로 출력됨
비슷한 기능을 하는 Killing Blow라는 애드온을 사용할 수도 있음
SendChatMessage나 print 대신 PlaySound API를 넣으면 소리 경보로 변경됨

1. 대화로 출력

local KB=CreateFrame("Frame")
KB:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
KB:SetScript("OnEvent", function(...)
local _,combatEvent,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags, destRaidFlags,spellID,spellName,_,param1,_,_,param4 = CombatLogGetCurrentEventInfo()
if combatEvent=="PARTY_KILL" then
if sourceGUID == UnitGUID("player") then
        if select(1,strsplit("-",destGUID)) == "Player" then
        SendChatMessage(destName.." 처치!", IsInGroup(2) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup(1) and "PARTY" or "SAY")
        end
    end
end
end)
 --막타알림





2. 혼자만 보기

local KB=CreateFrame("Frame")
KB:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
KB:SetScript("OnEvent", function(...)
local _,combatEvent,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags, destRaidFlags,spellID,spellName,_,param1,_,_,param4 = CombatLogGetCurrentEventInfo()
if combatEvent=="PARTY_KILL" then
    if sourceGUID == UnitGUID("player") then
        if select(1,strsplit("-",destGUID)) == "Player" then
        print(destName.." 처치!")
        end
    end
end
end)
--막타알림

기본 레이드 프레임 설정


1. 기본프레임 사각형 크기조절
/run local n="CompactUnitFrameProfilesGeneralOptionsFrame"_G[n.."HeightSlider"]:SetMinMaxValues(100,200);_G[n.."WidthSlider"]:SetMinMaxValues(50,200)
 - 설정범위를 각각 가로 100~200/ 세로 50~200으로 만들어 준다

2. 기본프레임 오라 크기
버프 아이콘
/run hooksecurefunc("CompactUnitFrame_UpdateBuffs", function(frame)for i=1,frame.maxBuffs do local buffFrame=frame.buffFrames[i];buffFrame:SetSize(20,20)end;end)
디버프 아이콘
/run hooksecurefunc("CompactUnitFrame_UpdateDebuffs", function(frame)for i=1,frame.maxDebuffs do local dbuff=frame.debuffFrames[i];dbuff:SetSize(20,20)end;end)
 - 20,20 저게 아이콘 크기다

3. 레이드프레임 프로필 스위칭
/run if GetCVar("activeCUFProfile")=="주 설정"then CompactUnitFrameProfiles_ActivateRaidProfile("투박장")else CompactUnitFrameProfiles_ActivateRaidProfile("주 설정")end
- "주 설정"과 "투박장" 대신 기본프레임 프로필에서 설정된 이름을 넣으면 됨

4. 평소 주 설정을 이용하다가 투기장 입장시 "투박장" 프로필로 자동 교체
Lua

--레이드 프로필 변경
local CRFP = CreateFrame("FRAME")

CRFP:RegisterEvent("PLAYER_ENTERING_WORLD")
CRFP:Setscript("OnEvent", function()
if IsActiveBattlefieldArena() then
    CompactUnitFrameProfiles_ActivateRaidProfile("투박장")
else
    CompactUnitFrameProfiles_ActivateRaidProfile("주 설정")
end
end)
저장할때 인코딩이 UTF-8로 되어 있는지 확인

5. 디버프 아이콘 표시 갯수 늘리기 twitch.tv/cdewx

6. 기본프레임 파티숫자 숨기기+파티별 프레임 붙이기
-- 기본프레임 파티숫자 숨기기+프레임 붙이기
hooksecurefunc("CompactRaidGroup_UpdateLayout",function(f)
f.title:SetHeight(0);f.title:SetWidth(0);f.title:SetText(nil)
local f1 = _G[f:GetName().."Member1"]
f1:ClearAllPoints()
    if (CUF_HORIZONTAL_GROUPS)then
        f1:SetPoint("TOPLEFT")
        f:SetHeight(f1:GetHeight())
    else
        f1:SetPoint("TOP")
        f:SetWidth(f1:GetWidth())
    end
end)

특성 변환 매크로

당연하지만 특성 못바꾸는 상황에서는 안돌아감
1. 전문화(Spec) 2가지 스왑
/run local i=GetSpecialization()if i==1 then SetSpecialization(2)else SetSpecialization(1)end
  • 여기 예시는 특성창 눌렀을 때 1↔2번째 특성을 스왑함 각자 원하는 번호를 저기의 1,2 대신 넣으면 됨
2. 펫 전문화 (격아에서는 펫 특성 변환이 없어짐)
/run local i,S=GetSpecialization(false,true),SetSpecialization;if i==1 then S(2,true)else S(1,true)end
  • 1과 동일한 방식으로 펫 특성 1↔2번째 스왑
/run local i,S=GetSpecialization(false,true),SetSpecialization;if IsAltKeyDown() then S(3,true) elseif i==3 then S(1,true)else S(i+1,true)end
  • 매 클릭마다 펫 특성을 현재 선택한 특성의 다음 특성으로 바꾸되(1->2->3->1) 알트를 누르고 클릭하면 무조건 3번인 교활특성으로 교체
3. 특성(Talent) 스왑
/run local t={2,2,2,1,3,1,1};if IsSpellKnown(247938)then t={3,3,1,1,3,3,3}end;for k, v in pairs(t) do _G["PlayerTalentFrameTalentsTalentRow"..k.."Talent"..v]:Click()end
  • 이건 처음 접속하고 특성창 한번 열어놔야 사용할 수 있음
  • 예시에서는 매 클릭마다 특성 1번 = {2,2,2,1,3,1,1}; 특성2번={3,3,1,1,3,3,3} 을 스왑
  • 숫자는 특성창 열었을때 위에서부터 몇번째 특성 찍었는지 하는거. 예를 들어 3311333을 공홈 전정실에서 보면 이렇게됨 ->클릭
  • 특성1과 특성2를 원하는 숫자로 바꾸고 if IsSpellKnown(247938) 여기다 특성 1번에서만 쓸 수 있는 스킬의 ID를 넣고 사용하면 됨
4. 장비셋 포함 특성 좌우클릭 스왑
/run UseEquipmentSet(SecureCmdOptionParse"[btn:1]"and"혼숙"or"안광");for i,v in next,SecureCmdOptionParse"[btn:1]"and{2,2,2,1,3,1,1}or{3,3,1,1,3,3,3}do _G["PlayerTalentFrameTalentsTalentRow"..i.."Talent"..v]:Click()end
  • 이것도 특성창을 한번 열어야 사용할 수 있음
  • 그냥 클릭하면 {2,2,2,1,3,1,1} 특성과 함께 "혼숙"이라고 된 장비세트를 착용, 우클릭시 {3,3,1,1,3,3,3} 특성과 함께 "안광"이라고 된 장비세트를 착용