Last active
November 19, 2020 10:47
-
-
Save AntoinePlu/85e77d57167bae90ac0d6aabc2d8ffed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"d": { | |
"yOffset": 0, | |
"outline": "OUTLINE", | |
"desaturate": false, | |
"font": "Friz Quadrata TT", | |
"regionType": "text", | |
"animation": { | |
"main": { | |
"type": "none", | |
"duration_type": "seconds" | |
}, | |
"start": { | |
"type": "none", | |
"duration_type": "seconds" | |
}, | |
"finish": { | |
"type": "none", | |
"duration_type": "seconds" | |
} | |
}, | |
"keepAspectRatio": false, | |
"uid": "6aWEt)Vqup8", | |
"cooldownEdge": false, | |
"xOffset": 0, | |
"desc": "Ajoute le nom du porteur de drapeau Alliance/Horde en haut de l'écran. Cliquez sur le nom pour target le porteur.", | |
"authorOptions": [ | |
{ | |
"desc": "Annonce quand le flag carrier est low HP dans le BG Chat", | |
"width": 1, | |
"name": "Annonce Flag Carrier Low HP", | |
"type": "toggle", | |
"useDesc": true, | |
"key": "AnnounceLowEFCHP", | |
"default": true | |
} | |
], | |
"height": 64, | |
"tocversion": 11304, | |
"wordWrap": "WordWrap", | |
"color": [ | |
1, | |
1, | |
1, | |
1 | |
], | |
"selfPoint": "CENTER", | |
"actions": { | |
"init": { | |
"custom": "C_ChatInfo.RegisterAddonMessagePrefix(\"WSGFCNamesHP\")\nstr_alliance_flag_drop = \"Le drapeau de l'Alliance a été laché par \"\nstr_horde_flag_drop = \"Le drapeau de la Horde a été laché par \"\nstr_alliance_flag_cap = \"à capturé le drapeau de l'Alliance\"\nstr_horde_flag_cap = \"à capturé le drapeau de la Horde\"\nstr_alliance_flag_pickup = \"Le drapeau de l'Alliance a été ramassé par \"\nstr_horde_flag_pickup = \"Le drapeau de la Horde a été ramassé par \"\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 | |
}, | |
"start": { | |
"sound": " custom", | |
"do_sound": false | |
}, | |
"finish": [] | |
}, | |
"cooldownTextDisabled": false, | |
"internalVersion": 26, | |
"customTextUpdate": "update", | |
"config": { | |
"AnnounceLowEFCHP": true | |
}, | |
"auto": true, | |
"anchorPoint": "CENTER", | |
"justify": "LEFT", | |
"width": 64, | |
"alpha": 1, | |
"zoom": 0, | |
"id": "WSG Flag Carrier Names", | |
"frameStrata": 1, | |
"icon": true, | |
"displayIcon": 136155, | |
"conditions": [], | |
"customText": "", | |
"cooldownSwipe": true, | |
"automaticWidth": "Auto", | |
"inverse": false, | |
"load": { | |
"use_never": false, | |
"size": { | |
"multi": [] | |
}, | |
"use_zone": true, | |
"spec": { | |
"multi": [] | |
}, | |
"class": { | |
"multi": [] | |
}, | |
"talent": [], | |
"zone": "Warsong Gulch" | |
}, | |
"subRegions": [], | |
"triggers": { | |
"1": { | |
"untrigger": [], | |
"trigger": { | |
"debuffType": "HELPFUL", | |
"messageType": "CHAT_MSG_RAID_BOSS_EMOTE", | |
"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", | |
"message_operator": "find('%s')", | |
"events": "CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CHAT_MSG_ADDON", | |
"names": [], | |
"custom_type": "event", | |
"custom_hide": "timed", | |
"message": "the sting of defeat at the conclusion of the Third War", | |
"unevent": "timed", | |
"spellIds": [], | |
"use_messageType": false, | |
"unit": "player", | |
"event": "Chat Message", | |
"type": "custom", | |
"subeventSuffix": "_CAST_START", | |
"subeventPrefix": "SPELL", | |
"use_message": false | |
} | |
}, | |
"2": { | |
"untrigger": [], | |
"trigger": { | |
"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", | |
"subeventPrefix": "SPELL", | |
"custom_hide": "timed", | |
"event": "Health", | |
"type": "custom", | |
"subeventSuffix": "_CAST_START", | |
"custom_type": "status", | |
"check": "update" | |
} | |
}, | |
"3": { | |
"untrigger": [], | |
"trigger": { | |
"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", | |
"subeventPrefix": "SPELL", | |
"custom_hide": "timed", | |
"event": "Health", | |
"type": "custom", | |
"subeventSuffix": "_CAST_START", | |
"custom_type": "event", | |
"events": "CHAT_MSG_ADDON" | |
} | |
}, | |
"disjunctive": "any", | |
"activeTriggerMode": 2 | |
}, | |
"displayText": "", | |
"anchorFrameType": "SCREEN", | |
"fixedWidth": 200, | |
"fontSize": 14, | |
"url": "https://wago.io/84b4-N5KZ/5", | |
"version": 5, | |
"semver": "1.0.4" | |
}, | |
"m": "d", | |
"s": "2.16.6", | |
"v": 1421, | |
"wagoID": "84b4-N5KZ" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment