- Added Observer channel for Raid Tools, it only reports the cooldown/interrupt/death to you in your chat window.

- More updates on the new plugin Raid Check.
This commit is contained in:
tercio
2014-12-19 22:47:02 -02:00
parent e70b25602e
commit 7c5a420349
12 changed files with 404 additions and 53 deletions
+137 -8
View File
@@ -9,11 +9,14 @@
local _math_floor = math.floor --lua local
local _cstr = string.format --lua local
local _UnitClass = UnitClass
local gump = _detalhes.gump --details local
local _GetSpellInfo = _detalhes.getspellinfo --details api
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants
@@ -273,8 +276,10 @@
-- add canal self pras mortes tbm?
if (who_name == _detalhes.playername) then -- and _detalhes.announce_interrupts.enabled
local channel = _detalhes.announce_interrupts.channel
local channel = _detalhes.announce_interrupts.channel
if (channel ~= "PRINT" and who_name == _detalhes.playername) then
local next = _detalhes.announce_interrupts.next
local custom = _detalhes.announce_interrupts.custom
@@ -314,18 +319,61 @@
_detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper)
end
elseif (channel == "PRINT") then
local custom = _detalhes.announce_interrupts.custom
local spellname
if (spellid > 10) then
spellname = GetSpellLink (extraSpellID)
else
spellname = _GetSpellInfo (extraSpellID)
end
if (custom ~= "") then
custom = custom:gsub ("{spell}", spellname)
custom = custom:gsub ("{next}", who_name)
_detalhes:SendMsgToChannel (custom, "PRINT")
else
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
local _, class = _UnitClass (who_name)
local class_color = "|cFFFF3333"
if (class) then
local coords = CLASS_ICON_TCOORDS [class]
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
if (second < 10) then
second = "0" .. second
end
local msg = "|cFFFFFF00[|r".. minute .. ":" .. second .. "|cFFFFFF00]|r Interrupt: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r)"
_detalhes:SendMsgToChannel (msg, "PRINT")
end
end
end
local ignored_self_cooldowns = {
[119582] = true, -- Purifying Brew
[115308] = true, --Elusive Brew
[115203 ] = true, --Fortifying Brew
}
function _detalhes:cooldown_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname)
if (who_name == _detalhes.playername) then -- and _detalhes.announce_cooldowns.enabled
local channel = _detalhes.announce_cooldowns.channel
if (channel ~= "PRINT" and who_name == _detalhes.playername) then
local ignored = _detalhes.announce_cooldowns.ignored_cooldowns
if (ignored [spellid]) then
return
end
local channel = _detalhes.announce_cooldowns.channel
if (channel == "WHISPER") then
if (alvo_name == Loc ["STRING_RAID_WIDE"]) then
channel = "RAID"
@@ -373,11 +421,63 @@
_detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper)
end
elseif (channel == "PRINT") then
local ignored = _detalhes.announce_cooldowns.ignored_cooldowns
if (ignored [spellid]) then
return
end
if (ignored_self_cooldowns [spellid]) then
return
end
if (who_name == alvo_name and who_name ~= _detalhes.playername) then
return
end
local msg
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
local _, class = _UnitClass (who_name)
local class_color = "|cFFFFFFFF"
local _, class2 = _UnitClass (alvo_name)
local class_color2 = "|cFFFFFFFF"
if (class) then
local coords = CLASS_ICON_TCOORDS [class]
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
if (class2) then
local coords = CLASS_ICON_TCOORDS [class2]
class_color2 = " -> |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class2].colorStr
alvo_name = _detalhes:GetOnlyName (alvo_name)
else
alvo_name = ""
end
local spellname
if (spellid > 10) then
spellname = GetSpellLink (spellid)
else
spellname = _GetSpellInfo (spellid)
end
if (second < 10) then
second = "0" .. second
end
msg = "|cFF8F8FFF[|r".. minute .. ":" .. second .. "|cFF8F8FFF]|r Cooldown: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r" .. class_color2 .. alvo_name .. "|r)"
_detalhes:SendMsgToChannel (msg, "PRINT")
end
end
function _detalhes:death_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at, max_health)
local where = _detalhes.announce_deaths.where
local zone = _detalhes:GetZoneType()
local channel = ""
@@ -413,6 +513,13 @@
if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then
channel = "INSTANCE_CHAT"
end
elseif (where == 4) then --> observer
if (zone ~= "raid" and zone ~= "party") then
return
end
channel = "PRINT"
end
local only_first = _detalhes.announce_deaths.only_first
@@ -426,7 +533,20 @@
alvo_name = _detalhes:GetOnlyName (alvo_name)
local msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":"
local msg
if (where == 4) then --> observer
local _, class = _UnitClass (alvo_name)
local class_color = "|cFFFFFFFF"
if (class) then
local coords = CLASS_ICON_TCOORDS [class]
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
msg = "Death: " .. class_color .. alvo_name .. "|r ->"
else
msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":"
end
local spells = ""
local last = #death_table
@@ -448,6 +568,15 @@
end
msg = msg .. " " .. spells
if (where == 4) then --> observer
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
if (second < 10) then
second = "0" .. second
end
msg = "|cFFFF8800[|r".. minute .. ":" .. second .. "|cFFFF8800]|r " .. msg
end
_detalhes:SendMsgToChannel (msg, channel)
end