Announce all taunts in chat frame (#2)
This commit is contained in:
parent
028f546427
commit
52303b3484
1 changed files with 42 additions and 6 deletions
48
MyAddon.lua
48
MyAddon.lua
|
@ -10,6 +10,18 @@ StaticPopupDialogs["REPAIR_ALERT"] = {
|
||||||
}
|
}
|
||||||
|
|
||||||
MyAddon.keyItemID = 180653
|
MyAddon.keyItemID = 180653
|
||||||
|
MyAddon.taunts = {
|
||||||
|
[56222] = true, -- Dark Command
|
||||||
|
[51399] = true, -- Death Grip
|
||||||
|
[185245] = true, -- Torment
|
||||||
|
[6795] = true, -- Growl
|
||||||
|
[115546] = true, -- Provke
|
||||||
|
[62124] = true, -- Hand of Reckoning
|
||||||
|
[355] = true, -- Taunt
|
||||||
|
|
||||||
|
[1161] = true, -- Challenging Shout
|
||||||
|
[204079] = true -- Final Stand
|
||||||
|
}
|
||||||
|
|
||||||
function MyAddon.OnEvent(self, event, ...)
|
function MyAddon.OnEvent(self, event, ...)
|
||||||
events[event](self, ...)
|
events[event](self, ...)
|
||||||
|
@ -27,9 +39,8 @@ function events:CHAT_MSG_PARTY(message, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function events:PLAYER_LOGIN(...)
|
function events:COMBAT_LOG_EVENT_UNFILTERED(...)
|
||||||
-- found from some forums
|
MyAddon.announceTaunts(CombatLogGetCurrentEventInfo())
|
||||||
local b=ActionButton8 _MH=_MH or(b:SetAttribute("*type5","macro")or SecureHandlerWrapScript(b,"PreClick",b,'Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [nomod]"..Z)'))or 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function events:MERCHANT_SHOW(...)
|
function events:MERCHANT_SHOW(...)
|
||||||
|
@ -43,15 +54,20 @@ function events:MERCHANT_SHOW(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function events:PLAYER_UPDATE_RESTING(...)
|
function events:PLAYER_LOGIN(...)
|
||||||
-- Notify that we should repair
|
-- found from some forums
|
||||||
if MyAddon.needsRepair() then StaticPopup_Show("REPAIR_ALERT") end
|
local b=ActionButton8 _MH=_MH or(b:SetAttribute("*type5","macro")or SecureHandlerWrapScript(b,"PreClick",b,'Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [nomod]"..Z)'))or 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function events:PLAYER_ROLES_ASSIGNED(...)
|
function events:PLAYER_ROLES_ASSIGNED(...)
|
||||||
if MyAddon.amTankInParty() then MyAddon.markSelfSquare() end
|
if MyAddon.amTankInParty() then MyAddon.markSelfSquare() end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function events:PLAYER_UPDATE_RESTING(...)
|
||||||
|
-- Notify that we should repair
|
||||||
|
if MyAddon.needsRepair() then StaticPopup_Show("REPAIR_ALERT") end
|
||||||
|
end
|
||||||
|
|
||||||
function MyAddon.announceKey()
|
function MyAddon.announceKey()
|
||||||
for bag = 0, NUM_BAG_SLOTS do
|
for bag = 0, NUM_BAG_SLOTS do
|
||||||
for slot = 1, GetContainerNumSlots(bag)do
|
for slot = 1, GetContainerNumSlots(bag)do
|
||||||
|
@ -66,6 +82,26 @@ function MyAddon.announceKey()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MyAddon.announceTaunts(...)
|
||||||
|
event = select(2, ...)
|
||||||
|
spellId = select(12, ...)
|
||||||
|
|
||||||
|
if event ~= 'SPELL_CAST_SUCCESS' or MyAddon.taunts[spellId] ~= true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
srcName = select(5, ...)
|
||||||
|
destName = select(9, ...)
|
||||||
|
spellName = select(13, ...)
|
||||||
|
|
||||||
|
message = format("|cffFF0000TAUNT:|r %s used %s", srcName, spellName)
|
||||||
|
if destName ~= nil then
|
||||||
|
message = format("%s on %s", message, destName)
|
||||||
|
end
|
||||||
|
|
||||||
|
print(message)
|
||||||
|
end
|
||||||
|
|
||||||
function MyAddon.needsRepair()
|
function MyAddon.needsRepair()
|
||||||
local slots = {
|
local slots = {
|
||||||
"HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot",
|
"HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot",
|
||||||
|
|
Loading…
Reference in a new issue