소스코드 보기
-- 전역변수 선언
count = 0
healcount = 0
RunTF = false
local time, subevent, sourceGUID, destGUID, spellId, time2,subevent2, sourceGUID2, destGUID2, spellId2
--아이콘 설정
local _, _, ic = GetSpellInfo(335889) --원시 해일의 핵
local _, _, ic2 = GetSpellInfo(61295) -- 성난 해일
--PTC 선언
local PTC = CreateFrame("Frame",nil,UIParent)
PTC:SetFrameStrata("BACKGROUND")
PTC:SetWidth(35)
PTC:SetHeight(35)
--PTC 텍스쳐 선언
local PTC_T = PTC:CreateTexture(nil,"BACKGROUND")
PTC_T:SetAllPoints(PTC)
PTC:SetPoint("CENTER",-270,80)
--PTC 폰트 선언
PTC.num = PTC:CreateFontString(nil)
PTC.num:SetFont(STANDARD_TEXT_FONT,16,"OUTLINE")
PTC.num:SetPoint("BOTTOMRIGHT", -2, 2)
PTC:Show()
--PTC 횟수 카운팅
local counting = CreateFrame("Frame")
counting:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
counting:SetScript("OnEvent", function(self,event,...)
if UnitName(select(1,...))==UnitName("player") and select(3,...)==61295 then
count = count + 1
elseif UnitName(select(1,...))==UnitName("player") and select(3,...)==326059 then
count = count + 1
end
--PTC 횟수별 아이콘 관리
if count == 0 then
PTC:Hide()
elseif count == 1 then
PTC.num:SetText()
PTC_T:SetTexture(ic2)
PTC:Show()
ActionButton_HideOverlayGlow (PTC)
elseif 1 < count and count < 3 then
PTC.num:SetText(count)
elseif 2 < count then
PTC.num:SetText()
PTC_T:SetTexture(ic)
ActionButton_ShowOverlayGlow (PTC)
end
end)
--전투로그 감지 프레임 선언
local Clog = CreateFrame("Frame")
local Clog2 = CreateFrame("Frame")
local ENTERWORLD = CreateFrame("Frame")
Clog:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
Clog2:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
ENTERWORLD:RegisterEvent("PLAYER_ENTERING_WORLD")
--동시에 시전된 복사 성해인지 확인
local function TF()
if RunTF==ture then
time2,subevent2, _, sourceGUID2, _, _, _, destGUID2, _, _, _, spellId2 = CombatLogGetCurrentEventInfo()
if time + 0.3 > time2 and subevent2 == "SPELL_HEAL" then
if spellId2 == 61295 and destGUID ~= destGUID2 then
PTC.num:SetText()
PTC_T:SetTexture(ic2)
PTC:Show()
ActionButton_HideOverlayGlow (PTC)
count = 1
end
end
if time ~= time2 then
RunTF = false
end
end
end
--기본 성해인지 확인
Clog:SetScript("OnEvent", function(self,event,...)
if RunTF == false then
time, subevent, _, sourceGUID, _, _, _, destGUID, _, _, _, spellId = CombatLogGetCurrentEventInfo()
end
if subevent == "SPELL_HEAL" and sourceGUID == UnitGUID("player") then
if spellId == 61295 then
RunTF = ture
end
end
end)
Clog2:SetScript("OnEvent", TF)
ENTERWORLD:SetScript("OnEvent", function(self,event,...)
if event == "PLAYER_ENTERING_WORLD" then
count = 0
PTC:Hide()
end
end)