강남쌍칼님, 배틀리님께서 공유해주신 격아용 차단 lua 스크립트 잘 사용중인데요.
기존 루아 스크립트에서 어떻게 고쳐야 할까요. c언어나 이런쪽을 전혀 배운적이 없어서 제 자의대로 고쳐봤는데
--------------------------------------------------------------------------------------
local function sendChatMessage(count, xlink, name, text, ch)
if (count == 1) then
text = name.."의 "..xlink " "..text
else
text = name.."의 "..xlink..text.."x"..count
end
end
local SpellCount, CharName = 0, "";
local si=CreateFrame("Frame")
si:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
si:SetScript("OnEvent",function()
local _,combatEvent,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,
destRaidFlags,spellID,spellName,_,param1,_,_,param4 = CombatLogGetCurrentEventInfo()
if (not combatEvent) then return end
local channel = "SAY";
if sourceGUID == UnitGUID("pet") and combatEvent == "SPELL_INTERRUPT" then -- 소환수 차단 알림
SendChatMessage("Pet's"..GetSpellLink(spellID).."▶"..destName.."의 "..GetSpellLink(param1), channel)
elseif (sourceGUID == UnitGUID("player")) then
if (combatEvent == "SPELL_INTERRUPT" or combatEvent == "SPELL_DISPEL") then
SpellCount = SpellCount + 1
local xlink = combatEvent == GetSpellLink(param1)
local text = combatEvent == "SPELL_INTERRUPT" and " 차단" or combatEvent == "SPELL_DISPEL" and " 해제";
if (SpellCount ~= 0) then
CharName = CharName == destName and destName or "";
sendChatMessage(SpellCount, xlink, CharName, text, channel)
SpellCount, CharName = 0, ""
end
end
CharName = destName
end
end)
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------