Ich habe ein Addon namens Brez, was mir u.a., immer wenn jemand einen br ausführt in den chat eine print ausgabe für mich gibt, wer wen rezzt.
nun ist es aber in manchen situationen schwierig immer in den chat zu schauen, und eine ausgabe als raidwarnung bzw. raidwarnung nur für mich, fände ich wesentlich besser.
die frage ist nun, was ich genau ändern muss bzw. wie der code aussehen muss um diese print ausgabe als raidwarning zu erhalten.
so sieht die lua aus:
Code:
local brez = CreateFrame("Frame", "bRez", UIParent) brez:SetPoint("CENTER", UIParent, "CENTER") brez:SetWidth(100) brez:SetHeight(30) brez:EnableMouse(true) brez:RegisterForDrag("LeftButton") brez:SetClampedToScreen(true) brez:SetMovable(true) brez:RegisterEvent("PLAYER_LOGIN") brez:SetScript("OnEvent", function(frame, event, ...) frame[event](frame, ...) end) brez:SetScript("OnDragStart", function(frame) if IsAltKeyDown() then frame:StartMoving() end end) brez:SetScript("OnDragStop", function(frame) frame:StopMovingOrSizing() end) brez.cooldown = brez:CreateFontString("bRezCooldownText", "OVERLAY") brez.cooldown:SetHeight(20) brez.cooldown:SetPoint("TOPLEFT", brez, "TOPLEFT") brez.cooldown:SetFont(TextStatusBarText:GetFont(), 11, "OUTLINE") brez.cooldown:SetJustifyH("LEFT") brez.ready = brez:CreateFontString("bRezReadyText", "OVERLAY") brez.ready:SetHeight(20) brez.ready:SetPoint("BOTTOMLEFT", brez.cooldown, "BOTTOMLEFT", 0 , -10) brez.ready:SetFont(TextStatusBarText:GetFont(), 11, "OUTLINE") brez.ready:SetJustifyH("LEFT") brez.count = brez:CreateFontString("bRezCountText", "OVERLAY") brez.count:SetHeight(50) brez.count:SetPoint("RIGHT", brez, "LEFT", -2, -2) brez.count:SetFont(TextStatusBarText:GetFont(), 24, "OUTLINE") brez.count:SetJustifyH("CENTER") local theDead, count = {}, 0 function brez:ZONE_CHANGED_NEW_AREA() local _, type, _, _, maxPlayers = GetInstanceInfo() if type == "raid" then if not self.isEngaged then count = maxPlayers == 10 and 1 or 3 end self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:RegisterEvent("GROUP_ROSTER_UPDATE") self.count:SetFormattedText("|cFF00FF7F%d|r", count) self:Show() else if self:IsShown() then self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:UnregisterEvent("GROUP_ROSTER_UPDATE") self:Hide() wipe(theDead) self.isEngaged = nil end end end function brez:PLAYER_LOGIN() if not bRezDB then bRezDB = {} end self:RegisterEvent("ZONE_CHANGED_NEW_AREA") self:ZONE_CHANGED_NEW_AREA() end function brez:EncounterUpdate(wiped) if wiped then for k in pairs(bRezDB) do bRezDB[k] = 0 end end local _, _, _, _, maxPlayers = GetInstanceInfo() count = maxPlayers == 10 and 1 or 3 self.count:SetFormattedText("|cFF00FF7F%d|r", count) wipe(theDead) end local redemption, feign, lastCheck, IsEncounterInProgress = GetSpellInfo(27827), GetSpellInfo(5384), 0, IsEncounterInProgress local minutes, seconds, ready, cooldown = "%s("..MINUTE_ONELETTER_ABBR:gsub(" ", "")..") ", "%s("..SECOND_ONELETTER_ABBR:gsub(" ", "")..") ", "|cFF00FF7F"..READY.."|r: ", "|cFFFF0000"..ON_COOLDOWN.."|r: " function brez:COMBAT_LOG_EVENT_UNFILTERED(time, event, _, _, name, _, _, _, tarName, _, _, spellId, spellName) -- Rebirth/Raise Ally/Combat Soulstone/Soulstone if (event == "SPELL_RESURRECT" and (spellId == 20484 or spellId == 61999 or spellId == 95750)) or (spellId == 20707 and event == "SPELL_AURA_APPLIED") then bRezDB[name] = time local tbl = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS -- Support custom class color addons, if installed local _, class = UnitClass(tarName) local t = class and tbl[class] or GRAY_FONT_COLOR -- Failsafe, rarely UnitClass can return nil _, class = UnitClass(name) local s = class and tbl[class] or GRAY_FONT_COLOR -- Failsafe, rarely UnitClass can return nil print("|cFF33FF99bRez|r: ", ("|Hplayer:"..name.."|h|cFF%02x%02x%02x["..name.."]|r|h"):format(s.r * 255, s.g * 255, s.b * 255), ">>", "|cFFFF0000|Hspell:"..spellId.."|h["..spellName.."]|h|r", ">>", ("|Hplayer:"..tarName.."|h|cFF%02x%02x%02x["..tarName.."]|r|h"):format(t.r * 255, t.g * 255, t.b * 255) ) if spellId ~= 20707 then -- A warlock just applied a non-combat Soulstone to someone, don't add them to the deaths table theDead[tarName] = "br" end end -- Lots of lovely checks before adding someone to the deaths table if event == "UNIT_DIED" and self.isEngaged and UnitIsPlayer(tarName) and not UnitIsFeignDeath(tarName) and not UnitBuff(tarName, redemption) and not UnitBuff(tarName, feign) then theDead[tarName] = "r" return end if time - lastCheck < 2 then return end if not self.isEngaged and IsEncounterInProgress() then self.isEngaged = true self:EncounterUpdate() elseif self.isEngaged and not IsEncounterInProgress() then self.isEngaged = nil self:EncounterUpdate(true) end for k,v in pairs(theDead) do if UnitBuff(k, redemption) or UnitBuff(k, feign) or UnitIsFeignDeath(k) then -- The backup plan, you need one with Blizz theDead[k] = nil elseif not UnitIsDeadOrGhost(k) and UnitIsConnected(k) and UnitAffectingCombat(k) then local tbl = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS -- Support custom class color addons, if installed local _, class = UnitClass(k) local s = class and tbl[class] or GRAY_FONT_COLOR -- Failsafe, rarely UnitClass can return nil if class == "SHAMAN" and v == "r" then print("|cFF33FF99bRez|r: ", ("|Hplayer:"..k.."|h|cFF%02x%02x%02x["..k.."]|r|h"):format(s.r * 255, s.g * 255, s.b * 255), ">>", "|cFFFF0000|Hspell:20608|h["..GetSpellInfo(20608).."]|h|r" ) else if v == "r" then print("|cFF33FF99bRez|r: ", ("|Hplayer:"..k.."|h|cFF%02x%02x%02x["..k.."]|r|h"):format(s.r * 255, s.g * 255, s.b * 255), ">>", "|cFFFF0000|Hspell:20707|h["..GetSpellInfo(20707).."]|h|r" ) end if self.isEngaged then count = count - 1 end end self.count:SetFormattedText("%s%d|r", count > 0 and "|cFF00FF7F" or "|cFFFF0000", count) theDead[k] = nil end end lastCheck = time local cdnames = cooldown local readynames = ready for k, v in pairs(bRezDB) do -- Replace server names with * local name = k:match("^(.-)%-") name = name and name.."*" or k if v > 0 then local timeleft = (select(2, UnitClass(k)) == "WARLOCK" and 900 or 600) - (time - v) if timeleft > 60 then cdnames = cdnames .. (minutes):format(name, ceil(timeleft / 60)) elseif timeleft < 4 then bRezDB[k] = 0 readynames = readynames .. (UnitIsDeadOrGhost(k) and "|cFFFF0000"..name or "|cFFFFFFFF"..name) .. ". |r" else cdnames = cdnames .. (seconds):format(name, timeleft) end else readynames = readynames .. (UnitIsDeadOrGhost(k) and "|cFFFF0000"..name or "|cFFFFFFFF"..name) .. ". |r" end end self.cooldown:SetText(cdnames) self.ready:SetText(readynames) end function brez:GROUP_ROSTER_UPDATE() local _, type, _, _, maxPlayers = GetInstanceInfo() if type ~= "raid" then return end for k in pairs(bRezDB) do if not UnitInRaid(k) then bRezDB[k] = nil theDead[k] = nil end end for i = 1, GetNumGroupMembers() do local player, _, subgroup, _, _, class = GetRaidRosterInfo(i) if class == "DRUID" or class == "DEATHKNIGHT" or class == "WARLOCK" then if subgroup <= maxPlayers/5 then if not bRezDB[player] then bRezDB[player] = 0 end else bRezDB[player] = nil end end end end