Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- for healer, amount in pairs(LEECH) do
- if amount ~= 0 then
- SendChatMessage("Leech from Unstable Felshadow Emulsion by Healer:", "RAID")
- break
- end
- end
- for healer, amount in pairs(LEECH) do
- local left,num,right = string.match(math.floor(amount),'^([^%d]*%d)(%d*)(.-)$')
- formatted_amount = left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
- SendChatMessage(healer .. ": " .. formatted_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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement