Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- ["outline"] = "OUTLINE",
- ["xOffset"] = 0,
- ["displayText"] = "",
- ["customText"] = "",
- ["yOffset"] = 0,
- ["anchorPoint"] = "CENTER",
- ["cooldownSwipe"] = true,
- ["customTextUpdate"] = "update",
- ["url"] = "https://wago.io/84b4-N5KZ/5",
- ["actions"] = {
- ["start"] = {
- ["sound"] = " custom",
- ["do_sound"] = false,
- },
- ["init"] = {
- ["custom"] = "C_ChatInfo.RegisterAddonMessagePrefix(\\\"WSGFCNamesHP\\\")\\nstr_alliance_flag_drop = \\\"The Alliance Flag was dropped by \\\"\\nstr_horde_flag_drop = \\\"The Horde flag was dropped by \\\"\\nstr_alliance_flag_cap = \\\"captured the Alliance flag\\\"\\nstr_horde_flag_cap = \\\"captured the Horde flag\\\"\\nstr_alliance_flag_pickup = \\\"The Alliance Flag was picked up by \\\"\\nstr_horde_flag_pickup = \\\"The Horde flag was picked up by \\\"\\n\\n\\n\\nlocal name_player, realm_player = UnitFullName(\\\"player\\\")\\nFULLNAME_PLAYER = name_player .. \\\"-\\\" .. realm_player\\n\\ntime_addonmsg = 0\\ntime_announce = 0\\nhp_tracker = -1\\n\\nstr_faction_player = UnitFactionGroup(\\\"player\\\")\\nWSG_TABLE = {\\n [\\\"Alliance\\\"]={\\n txt_flag_holder=nil,\\n str_flag_holder=nil,\\n str_flag_holder_macro = nil,\\n time_announce=0,\\n hp_tracker=1,\\n hp_msg_send=\\\"\\\",\\n hp_received=nil,\\n hp_received_ts=0,\\n },\\n [\\\"Horde\\\"]={\\n txt_flag_holder=nil,\\n str_flag_holder=nil,\\n str_flag_holder_macro = nil,\\n time_announce=0,\\n hp_tracker=1,\\n hp_msg_send=\\\"\\\",\\n hp_received=nil,\\n hp_received_ts=0,\\n },\\n}\\n\\nGET_FLAG_HOLDER_HP = function(faction_flag)\\n if str_faction_player ~= faction_flag then\\n local unitname = WSG_TABLE[faction_flag].str_flag_holder\\n local hp_cur = UnitHealth(unitname)\\n local hp_max = UnitHealthMax(unitname) \\n if hp_max > 0 then\\n return hp_cur/hp_max\\n end\\n else\\n for ii=1,10 do\\n local unit = \\\"raid\\\" .. ii .. \\\"target\\\"\\n if UnitExists(unit) then\\n local hp_cur = UnitHealth(unit) \\n local hp_max = UnitHealthMax(unit) \\n local unitname = GET_NAME_WITH_REALM(unit)\\n if unitname == WSG_TABLE[str_faction_player].str_flag_holder then\\n if hp_max > 0 then\\n return hp_cur/hp_max\\n end\\n end\\n end\\n end\\n end\\n return nil\\nend\\n\\nGET_NAME_WITH_REALM = function(unit)\\n if UnitExists(unit) then\\n local name,realm = UnitName(unit)\\n if realm and realm ~= \\\"\\\" then\\n return name .. \\\"-\\\" .. realm\\n else\\n return name\\n end\\n else\\n return nil\\n end\\nend\\n\\nGET_COLORED_NAME_FROM_BG_SCORE = function (playername)\\n local function GetClassFromBGScore(name_target)\\n --local numScores = GetNumBattlefieldScores()\\n for i=1,20 do\\n local name, killingBlows, honorableKills, deaths, honorGained, faction, rank, race, class, CLASS = GetBattlefieldScore(i);\\n if name == name_target then\\n return CLASS\\n end\\n end\\n return nil\\n end\\n \\n local function DecimalToHex(r,g,b)\\n return string.format(\\\"|cff%02x%02x%02x\\\", r*255, g*255, b*255)\\n end\\n \\n local r,g,b,classcolor,PLAYERCLASS\\n \\n if UnitInRaid(playername) then\\n _,PLAYERCLASS = UnitClass(playername)\\n else\\n PLAYERCLASS = GetClassFromBGScore(playername)\\n end\\n \\n if PLAYERCLASS then\\n classcolor = RAID_CLASS_COLORS[PLAYERCLASS]\\n r,g,b = classcolor.r,classcolor.g,classcolor.b\\n else\\n r,g,b = 0.5,0.5,0.5\\n end\\n \\n local classcolorhex = DecimalToHex(r,g,b)\\n return classcolorhex..playername..\\\"|r\\\"\\nend\\n\\nINITIALIZE_FC_TEXT = function ()\\n local p = {UIWidgetTopCenterContainerFrame:GetChildren()};\\n local f\\n for ii = 1,2 do\\n f = p[ii]\\n if f then\\n if f.tooltip == \\\"Horde flag captures\\\" or f.tooltip == \\\"Alliance flag captures\\\" then\\n if not f.TXT_FLAG_HOLDER and not InCombatLockdown() then\\n local text_ = CreateFrame(\\\"Button\\\", nil, f, \\\"SecureUnitButtonTemplate\\\")\\n text_:SetFrameStrata(\\\"MEDIUM\\\")\\n text_:SetFrameLevel(15)\\n text_:SetPoint(\\\"LEFT\\\",85,0)\\n text_:SetAttribute(\\\"type\\\",\\\"macro\\\")\\n text_:RegisterForClicks(\\\"AnyUp\\\")\\n text_:SetAttribute('macrotext', '')\\n \\n text_.text = text_:CreateFontString(nil,\\\"ARTWORK\\\") \\n text_.text:SetFont(\\\"Fonts\\\\\\\\FRIZQT__.TTF\\\", 14, \\\"OUTLINE\\\")\\n text_.text:SetPoint(\\\"LEFT\\\",0,0)\\n text_.text:SetText(\\\"\\\")\\n \\n text_:SetSize(text_.text:GetWidth(),text_.text:GetHeight())\\n \\n f.TXT_FLAG_HOLDER = text_\\n end\\n end\\n if f.TXT_FLAG_HOLDER then\\n if f.tooltip == \\\"Horde flag captures\\\" then\\n WSG_TABLE[\\\"Alliance\\\"].txt_flag_holder = f.TXT_FLAG_HOLDER\\n elseif f.tooltip == \\\"Alliance flag captures\\\" then\\n WSG_TABLE[\\\"Horde\\\"].txt_flag_holder = f.TXT_FLAG_HOLDER\\n end\\n end\\n end\\n end\\nend\\n\\nINITIALIZE_FC_TEXT()",
- ["do_custom"] = true,
- },
- ["finish"] = {
- },
- },
- ["triggers"] = {
- [1] = {
- ["trigger"] = {
- ["message_operator"] = "find('%s')",
- ["names"] = {
- },
- ["custom_hide"] = "timed",
- ["type"] = "custom",
- ["debuffType"] = "HELPFUL",
- ["unevent"] = "timed",
- ["custom_type"] = "event",
- ["unit"] = "player",
- ["event"] = "Chat Message",
- ["subeventPrefix"] = "SPELL",
- ["message"] = "the sting of defeat at the conclusion of the Third War",
- ["spellIds"] = {
- },
- ["events"] = "CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CHAT_MSG_ADDON",
- ["custom"] = "function(event,msg)\\n if event == \\\"CHAT_MSG_BG_SYSTEM_ALLIANCE\\\" or event == \\\"CHAT_MSG_BG_SYSTEM_HORDE\\\" then\\n INITIALIZE_FC_TEXT()\\n if string.match(msg,str_horde_flag_pickup) then\\n local name = string.gsub(string.gsub(msg,str_horde_flag_pickup,\\\"\\\"),\\\"!\\\",\\\"\\\")\\n WSG_TABLE[\\\"Horde\\\"].str_flag_holder = name\\n WSG_TABLE[\\\"Horde\\\"].hp_tracker = 1\\n RequestBattlefieldScoreData()\\n elseif string.match(msg,str_alliance_flag_pickup) then\\n local name = string.gsub(string.gsub(msg,str_alliance_flag_pickup,\\\"\\\"),\\\"!\\\",\\\"\\\")\\n WSG_TABLE[\\\"Alliance\\\"].str_flag_holder = name\\n WSG_TABLE[\\\"Alliance\\\"].hp_tracker = 1\\n RequestBattlefieldScoreData()\\n elseif string.match(msg,str_horde_flag_drop) or string.match(msg,str_horde_flag_cap) then\\n WSG_TABLE[\\\"Horde\\\"].str_flag_holder = nil\\n WSG_TABLE[\\\"Horde\\\"].hp_tracker = 1\\n elseif string.match(msg,str_alliance_flag_drop) or string.match(msg,str_alliance_flag_cap) then\\n WSG_TABLE[\\\"Alliance\\\"].str_flag_holder = nil\\n WSG_TABLE[\\\"Alliance\\\"].hp_tracker = 1\\n end\\n end\\n \\n \\nend\\n\\n\\n",
- ["use_message"] = false,
- ["subeventSuffix"] = "_CAST_START",
- ["use_messageType"] = false,
- ["messageType"] = "CHAT_MSG_RAID_BOSS_EMOTE",
- },
- ["untrigger"] = {
- },
- },
- [2] = {
- ["trigger"] = {
- ["custom_hide"] = "timed",
- ["type"] = "custom",
- ["custom"] = "function()\\n local f, hp, txt\\n local in_combat = InCombatLockdown()\\n local time_cur = GetTime()\\n \\n for _,faction in pairs({\\\"Alliance\\\",\\\"Horde\\\"}) do\\n f = WSG_TABLE[faction].txt_flag_holder\\n if f then\\n txt = \\\"\\\"\\n if WSG_TABLE[faction].str_flag_holder then\\n txt = txt .. GET_COLORED_NAME_FROM_BG_SCORE(WSG_TABLE[faction].str_flag_holder)\\n \\n hp = GET_FLAG_HOLDER_HP(faction)\\n if hp then\\n txt = txt .. string.format(\\\" (%.1f%%) \\\",hp*100)\\n if faction == str_faction_player then\\n local msg_addon = string.format(\\\"%s@%.4f\\\",WSG_TABLE[faction].str_flag_holder,hp)\\n if msg_addon ~= WSG_TABLE[faction].hp_msg_send or (time_cur - time_addonmsg) > 1 then\\n time_addonmsg = time_cur\\n WSG_TABLE[faction].hp_msg_send = msg_addon\\n C_ChatInfo.SendAddonMessage(\\\"WSGFCNamesHP\\\",msg_addon,\\\"INSTANCE_CHAT\\\")\\n end\\n end\\n elseif faction == str_faction_player then\\n if WSG_TABLE[faction].hp_received and (time_cur - WSG_TABLE[faction].hp_received_ts) < 5 then\\n txt = txt .. string.format(\\\" |cff7f7f7f(%.1f%%)|r \\\",WSG_TABLE[faction].hp_received*100)\\n else\\n WSG_TABLE[faction].hp_received = nil\\n WSG_TABLE[faction].hp_received_ts = 0\\n end\\n end\\n \\n if hp and hp < 0.5 then\\n if math.abs(hp-WSG_TABLE[faction].hp_tracker) >= 0.10 and (time_cur - WSG_TABLE[faction].time_announce) > 3 then\\n WSG_TABLE[faction].hp_tracker = hp\\n WSG_TABLE[faction].time_announce = time_cur\\n if aura_env.config[\\\"AnnounceLowEFCHP\\\"] and faction == str_faction_player then\\n local str = string.format(\\\">>> ENEMY FC: %.1f%% <<<\\\",hp*100)\\n SendChatMessage(str,\\\"INSTANCE_CHAT\\\")\\n else\\n --local str = string.format(\\\"*** OUR FC: %.1f%% ***\\\",hp*100)\\n --SendChatMessage(str,\\\"INSTANCE_CHAT\\\")\\n end\\n end\\n elseif hp then\\n if math.abs(hp-WSG_TABLE[faction].hp_tracker) >= 0.10 then\\n WSG_TABLE[faction].hp_tracker = hp\\n end\\n else\\n if (time_cur-WSG_TABLE[faction].time_announce) > 30 then\\n WSG_TABLE[faction].hp_tracker = 1\\n end\\n end\\n \\n if in_combat and WSG_TABLE[faction].str_flag_holder ~= WSG_TABLE[faction].str_flag_holder_macro then\\n txt = txt .. \\\" (Unclickable)\\\"\\n end\\n end\\n f.text:SetText(txt)\\n \\n if not in_combat then\\n if WSG_TABLE[faction].str_flag_holder then\\n f:SetAttribute('macrotext', '/targetexact ' .. WSG_TABLE[faction].str_flag_holder)\\n else\\n f:SetAttribute('macrotext', '')\\n end\\n WSG_TABLE[faction].str_flag_holder_macro = WSG_TABLE[faction].str_flag_holder\\n f:SetSize(f.text:GetWidth(),f.text:GetHeight())\\n end\\n end\\n end\\n return true\\nend",
- ["subeventSuffix"] = "_CAST_START",
- ["check"] = "update",
- ["custom_type"] = "status",
- ["event"] = "Health",
- ["subeventPrefix"] = "SPELL",
- },
- ["untrigger"] = {
- },
- },
- [3] = {
- ["trigger"] = {
- ["custom_hide"] = "timed",
- ["type"] = "custom",
- ["custom"] = "function(event,prefix,msg,channel,sender)\\n \\n if event == \\\"CHAT_MSG_ADDON\\\" and prefix == \\\"WSGFCNamesHP\\\" and channel == \\\"INSTANCE_CHAT\\\" and sender ~= FULLNAME_PLAYER then\\n local name = string.match(msg,\\\"(.*)@\\\")\\n local hp = string.match(msg,\\\"@(.*)\\\")\\n if hp then hp = tonumber(hp) end\\n if name and name == WSG_TABLE[str_faction_player].str_flag_holder and hp then\\n WSG_TABLE[str_faction_player].hp_received = hp\\n WSG_TABLE[str_faction_player].hp_received_ts = GetTime()\\n end\\n end\\n \\n \\nend",
- ["subeventSuffix"] = "_CAST_START",
- ["events"] = "CHAT_MSG_ADDON",
- ["custom_type"] = "event",
- ["event"] = "Health",
- ["subeventPrefix"] = "SPELL",
- },
- ["untrigger"] = {
- },
- },
- ["disjunctive"] = "any",
- ["activeTriggerMode"] = 2,
- },
- ["internalVersion"] = 45,
- ["keepAspectRatio"] = false,
- ["animation"] = {
- ["start"] = {
- ["type"] = "none",
- ["duration_type"] = "seconds",
- ["easeStrength"] = 3,
- ["easeType"] = "none",
- },
- ["main"] = {
- ["type"] = "none",
- ["duration_type"] = "seconds",
- ["easeStrength"] = 3,
- ["easeType"] = "none",
- },
- ["finish"] = {
- ["type"] = "none",
- ["duration_type"] = "seconds",
- ["easeStrength"] = 3,
- ["easeType"] = "none",
- },
- },
- ["desc"] = "Adds alliance/horde flag carrier names at the top of the screen. Click name to target flag carrier.",
- ["semver"] = "1.0.4",
- ["font"] = "Friz Quadrata TT",
- ["version"] = 5,
- ["subRegions"] = {
- },
- ["height"] = 64,
- ["icon"] = true,
- ["load"] = {
- ["zoneIds"] = "",
- ["use_zone"] = true,
- ["use_never"] = false,
- ["zone"] = "Warsong Gulch",
- ["talent"] = {
- ["multi"] = {
- },
- },
- ["spec"] = {
- ["multi"] = {
- },
- },
- ["class"] = {
- ["multi"] = {
- },
- },
- ["size"] = {
- ["multi"] = {
- },
- },
- },
- ["color"] = {
- [1] = 1,
- [2] = 1,
- [3] = 1,
- [4] = 1,
- },
- ["fontSize"] = 14,
- ["selfPoint"] = "CENTER",
- ["fixedWidth"] = 200,
- ["shadowXOffset"] = 1,
- ["wordWrap"] = "WordWrap",
- ["cooldownEdge"] = false,
- ["preferToUpdate"] = false,
- ["regionType"] = "text",
- ["uid"] = "6aWEt)Vqup8",
- ["desaturate"] = false,
- ["anchorFrameType"] = "SCREEN",
- ["alpha"] = 1,
- ["cooldownTextDisabled"] = false,
- ["justify"] = "LEFT",
- ["zoom"] = 0,
- ["auto"] = true,
- ["tocversion"] = 11304,
- ["id"] = "WSG Flag Carrier Names",
- ["conditions"] = {
- },
- ["frameStrata"] = 1,
- ["width"] = 64,
- ["automaticWidth"] = "Auto",
- ["config"] = {
- ["AnnounceLowEFCHP"] = true,
- },
- ["inverse"] = false,
- ["authorOptions"] = {
- [1] = {
- ["type"] = "toggle",
- ["key"] = "AnnounceLowEFCHP",
- ["desc"] = "Announce when EFC reaches low HP in BG Chat",
- ["default"] = true,
- ["useDesc"] = true,
- ["name"] = "Announce Low EFC HP",
- ["width"] = 1,
- },
- },
- ["shadowColor"] = {
- [1] = 0,
- [2] = 0,
- [3] = 0,
- [4] = 1,
- },
- ["displayIcon"] = 136155,
- ["information"] = {
- ["ignoreOptionsEventErrors"] = true,
- },
- ["shadowYOffset"] = -1,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement