Skip to content

Commit

Permalink
Added slash command for DeclineDuel.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Nov 16, 2014
1 parent 9fb85c4 commit 753bc97
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ShestakUI/Modules/Automation/DeclineDuel.lua
Expand Up @@ -4,10 +4,12 @@ if C.automation.decline_duel ~= true then return end
----------------------------------------------------------------------------------------
-- Auto decline duel
----------------------------------------------------------------------------------------
local disable = false
local frame = CreateFrame("Frame")
frame:RegisterEvent("DUEL_REQUESTED")
frame:RegisterEvent("PET_BATTLE_PVP_DUEL_REQUESTED")
frame:SetScript("OnEvent", function(self, event, name)
if disable == true then return end
if event == "DUEL_REQUESTED" then
CancelDuel()
RaidNotice_AddMessage(RaidWarningFrame, L_INFO_DUEL..name, {r = 0.41, g = 0.8, b = 0.94}, 3)
Expand All @@ -19,4 +21,15 @@ frame:SetScript("OnEvent", function(self, event, name)
print(format("|cffffff00"..L_INFO_PET_DUEL..name.."."))
StaticPopup_Hide("PET_BATTLE_PVP_DUEL_REQUESTED")
end
end)
end)

SlashCmdList.DISABLEDECLINE = function()
if not disable then
disable = true
else
disable = false
end
end

SLASH_DISABLEDECLINE1 = "/disduel"
SLASH_DISABLEDECLINE2 = "/вшывгуд"

0 comments on commit 753bc97

Please sign in to comment.