Hi guys, I need some LUA help with this WeakAura I found that I'm trying to edit.
This is a WeakAura that is supposed to watch all Leech healing events and watch all buffs that a player has from the Unstable Felshadow Emulsion trinket, and attribute Leech healing to each healer, then print it out at the end of the fight. However, it looks like right now, it's just an estimate (or maybe unintentionally wrong), and I'm trying to see if it's possible to fix it. Here's the WeakAura import string:
Code:
d4eplaGiO0LOuiJcsCkqYQKKcVssQAwsQBbfzxGOFjjLmmiPJbsTmjjpJuOPjv11OuQTbf(gHQghPGZrrADGaMhKI6Ea1bPkwiKspeuMifXffAJuQ0hPuvJKQ0jPuXkLyMuv3ekk7Ku6NsvgkLswkf1tbmvbUkPOTkjfnwjPYzHu4TuQYDPu0Ej5VKQbJomfwmiOhlLMSu5YI2mq(SKy0GQtdXQLKs9AqOMnLCBcz3u53q1WjuwobpxkMorxxqBhs13PuW4bHCEcvwpuu9EqGMpLc19HuK9RwbTkqbisb0Pa6ubkaq4ojacMNkTASkfqhst1o01krqpvOvb0H0iMLH4csisQaSrTkG2WgjUOGeIKkaqHUwjcUdfOUmNZPqkdfCtSyVKUUlxUC5YffG46bcutkv2ftMIkQIh6QWOQ(OwLPyykg9vGWuFXRaeYki4UaXjwQaKjejvaioePElUiXSsz2P0cTcWORdrIG7mS0LcivQKcnQaLubydiDs4k7232OQrmmvdM2xd91GPvbngkqyY2vPaq6uabcgTqmIRY0pZw4kaxOOabKkvsHgLwOvaWtKkWLk7AkQOIH47JQ4Xadt1qvq3VVceMSTgvaqupqGAsPYUycdmGUpg2gdBRbnAQPqRrurvbct97RaSWn6ubkGWMu3LONckiubinSsNufOaefAjrubkPsQa6qabcPn0skovGcquOLerfOKkPcqWOnvbkarHwsevGsQKkabCRufOaefAjrubkPsQacBsDmh3LkiubG54Uub4nTSaHiKtyisJU0sjvasbKkvsbvGcqkoXsfqByJexKci0LONoPcqIik7uaj6PtQaGHlccnKtF8kkGWMup0HivOvb0g2iXfPaaf6ALi4ouY6Peruwpt0tNSEcjKqc1L5CoranD4YPFmcZ7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RoqpnndlcypnDisTgIsuAWdfAtOS5e80kZw4xMZ5CoNZ5CoNZ50pgH5vpOxGh)j4PFmcZREqVap(ZQFALzl8lZ5CoNZ5CoNPR7YCoNZ5CMUUlZ5CoNZjcOPFmcZREqVap(tWGNOoLWt3uiLHcUz66UmNZ5CoNGWfMn4HcTz9SPfxiNiUPygicnO4hJW8Qd0ttZWIaqn7WVmNZ5CoNZ5CIaA6WLt)yeMx71Ghk0M2CkHNUlZ5CoNZ5CoNZ5C6hJW8AVg8qH20MtWtuVmNZ5CoNZ5CMUU5L5CoNZ5CoNt)yeMx71Ghk0M2CcE6hJW8AVg8qH20MZQFIsccu2krqpNvJjknT4c5SAn9JryE1d6f4XhkOUmNZ5CoNPR7YCoNPR7s66UC5YLlxUC5YLlxUC5YLlxUC5YLlxUC5YLlxuaj6Pt2OaG1dZqRNaD)E2xpwnJAd01uRDTJFq0C0K6Owy90uBq0SoqGhZb1rTW6PP2GOz9OwtQTLVh0iAw3C0(rT6MyhapO1pAsTT89GgrZ6MJ2pQvpQ1dA9JMOaAdBK4I0LItSubKONoPcOnSrIlshosxQaKiIYoLujvankGQGeAirfsmuaOR0cD)QGwjvka
And for your convenience, here's the code in question:
Code:
function(e, time, event, ...)
if not LEECH then LEECH = {} end
if not LEECH_SOURCES then LEECH_SOURCES = {} end
if e == "ENCOUNTER_START" or e == "XPLAYER_REGEN_DISABLED" then
wipe(LEECH)
elseif e == "ENCOUNTER_END" or e == "XPLAYER_REGEN_ENABLED" then
SendChatMessage("==Leech trinket healing done==", "RAID")
print("==Leech trinket healing done==")
for healer, amount in pairs(LEECH) do
SendChatMessage(healer .. ": " .. math.floor(amount).." healing", "RAID")
print(healer, ":", amount)
end
elseif event == "SPELL_HEAL" then
local target, _, _, spell, name, _, amount, overhealing = select(7, ...)
if spell ~= 143924 then return end
local effective = amount - overhealing
if effective < 10 then return end
wipe(LEECH_SOURCES)
local LEECH_TOTAL = 0
for i=1, 40 do
local name, _, _, _, _, _, _, source, _, _, aura, _, _, _, leech = UnitAura(target, i)
if not name then
break
end
if aura == 184671 then
LEECH_SOURCES[UnitName(source)] = leech
LEECH_TOTAL = LEECH_TOTAL + leech
end
end
if LEECH_TOTAL == 0 then return end
for source, score in pairs(LEECH_SOURCES) do
if not LEECH[source] then
LEECH[source] = 0
end
LEECH[source] = LEECH[source] + (effective * (score / LEECH_TOTAL))
end
end
end
The total Leech healing attributed to healers often does not match the total Leech healing done according to logs, so you might think that it's working properly. However, it's not, as you can confirm for yourself by looking at the code:
-Any Leech events that did less than 10 effective healing are ignored, possibly for performance reasons.
-When a player has the trinket buff on them, any of their personal Leech is attributed to healers instead.
The reason why the total Leech accounted for by the trinket is less than the total Leech healing done is
-Again, any Leech events that did less than 10 effective healing are ignored
-As long as a player does not have a Leech buff from a healer, their Leech is not attributed to any healers
However, that does not mean it is correct just because the totals don't match, as you can see. Unfortunately, although I can read LUA, I'm not well-versed in it enough to fix the WeakAura. What would be needed would be to grab everyone's Leech ratings dynamically, and I'm not sure how to do that or if it's even possible or how complicated it may be.
Someone on the Monk forums had this to offer, but I'm not sure how to dynamically fetch these values in a Lua script:
Originally Posted by
Modulo
Not sure if it's any use to people working on it but peoples' leech rating can be retrieved from Exorsus Raid Tools' inspect DB.
Code:
/dump GExRT.A.InspectViewer.db.inspectDB.Modulo.leech
Where Modulo is replaced with the characters' name.
Any ideas?
- - - Updated - - -
Oh, also, apparently this WA is a performance hog, so if you have any ideas to reduce the computational load, that would be useful. Is it possible to change the trigger from COMBAT_LOG_EVENT_UNFILTERED to just SPELL_HEAL, for example? I could try that myself and test it, but I figure I could give an example of the kind of stuff I'm looking for.