local addonName = ...
local frame = CreateFrame("Frame")
-- 음소거할 사운드 (포에버 기본 사운드 FileDataID)
-- 포에버에서 소리가 계속 겹치면 이 번호가 다른 것이므로 교체 필요
local mutedSounds = {
568893, -- 소멸 (Vanish)
569555, -- 기습/매복 (Backstab/Ambush)
}
-- 스킬 이름 → 재생할 클래식 사운드 FileDataID
-- 한국어 클라이언트는 한국어 이름, 영어 클라이언트는 영어 이름으로 매칭
local spellSounds = {
["기습"] = 569059, ["Backstab"] = 569059, -- Strike.ogg
["매복"] = 569059, ["Ambush"] = 569059,
["소멸"] = 568798, ["Vanish"] = 568798,
}
local isEnabled = true
local isDebug = false
local getName = (C_Spell and C_Spell.GetSpellName)
or function(id) return (GetSpellInfo(id)) end
local function MuteAll()
for _, id in ipairs(mutedSounds) do MuteSoundFile(id) end
end
local function UnmuteAll()
for _, id in ipairs(mutedSounds) do UnmuteSoundFile(id) end
end
local function Msg(text)
print("|cff00ff00RogueVanilla|r: " .. text)
end
-- /rv : 켜기/끄기
-- /rv debug : 스킬 사용 시 이름·ID 출력 켜기/끄기
-- /rv test : 교체 사운드 미리 듣기
SLASH_ROGUEVANILLA1 = "/rv"
SlashCmdList["ROGUEVANILLA"] = function(msg)
msg = (msg or ""):lower()
if msg == "debug" then
isDebug = not isDebug
Msg("디버그 " .. (isDebug and "켜짐" or "꺼짐"))
elseif msg == "test" then
PlaySoundFile(569059, "SFX")
Msg("Strike.ogg 재생")
else
isEnabled = not isEnabled
if isEnabled then MuteAll() else UnmuteAll() end
Msg(isEnabled and "켜짐" or "꺼짐")
end
end
frame:RegisterEvent("ADDON_LOADED")
frame:RegisterEvent("PLAYER_LOGOUT")
frame:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
frame:SetScript("OnEvent", function(self, event, ...)
if event == "ADDON_LOADED" then
if ... == addonName then
MuteAll()
Msg("로드됨. /rv 켜기·끄기, /rv debug, /rv test")
end
elseif event == "PLAYER_LOGOUT" then
UnmuteAll()
elseif event == "UNIT_SPELLCAST_SUCCEEDED" and isEnabled then
local _, _, spellID = ...
local name = spellID and getName(spellID)
if isDebug then Msg(tostring(name) .. " : " .. tostring(spellID)) end
if name and spellSounds[name] then
PlaySoundFile(spellSounds[name], "SFX")
end
end
end)