TellMeWhen

TellMeWhen

24M Downloads

[CF 1280] Add a way to track damage taken over 5 seconds

tmw-issue-import opened this issue ยท 7 comments

commented

For frenzied regen & death strike. Possibly other things too.


Posted by CurseForge user Cybeloras | Imported from CurseForge issue #1280 | Raw

commented

Has this been implemented yet?

Looking for a way to track Frenzied Regen.

Cheers!


Edited Oct 16, 2016

Posted by CurseForge user Idn0

commented

@Idn0: Go

Would also really like this feature. Tried looking through it myself and through old Blood DK (Death Strike heal) and Resolve/Vengeance ones but I couldn't seem to find anything I could work with- I guess everyone just used the old Blood Shield Tracker addon.


Posted by CurseForge user ash1k1

commented

Here's an icon for Frenzied Regen: https://wow.curseforge.com/addons/tellmewhen/forum/druid/130177-frenzied-regeneration/#p2

I've decided not to implement this behavior into TMW directly, because its just one more thing that I would have to keep track of and keep maintained through each expansion, and there are a lot more intricacies than just damage over last 5 seconds.

If someone can find a weakaura or something similar that will track the death strike heal, i'll make it into a TMW icon.


Edited Nov 5, 2016

Posted by CurseForge user Cybeloras

commented

Thanks for the reply @Cybeloras, though it seems the forums have changed since I last visited (woops!) - is there any chance you could point me in the direction of where/what that link was? I can't seem to find anything regarding the Death Strike heal as I mentioned last time, I think most used BST instead.


Edited Nov 25, 2016

Posted by CurseForge user ash1k1

commented

https://www.curseforge.com/forums/wow-sites/wow-sites-feedback/127024-no-more-project-forums#c11 Curse got rid of the forums. If you'd like to share what you think of this decision with them, you can add your thoughts to this thread that is at the beginning of this comment because copy paste is broken on mobile on the new site and will only paste at the beginning.

 


Edited Nov 26, 2016

Posted by CurseForge user Cybeloras

commented

Here's the export string of the FR icon in the mean time, since I found that I still have it:

 

^1^T^SType^Scooldown ^SName^SFrenzied~`Regeneration ^SEnabled^B ^SEvents^T ^N1^T ^SType^SLua ^SLua^S--~`Frenzied~`Regen~`by~`Hamsda~`of~`Mannoroth-EU~`and~`Yumari~`of~`TheMaelstrom-EU~J --~`Adapted~`from~`the~`WeakAura~`at~`https://wago.io/NkogH0_D-~J ~J local~`icon~`=~`...~J ~J if~`TMW.hasInitFR~`then~`return~`end~J TMW.hasInitFR~`=~`true~J icon.aura_env~`=~`{}~J local~`aura_env~`=~`icon.aura_env~J LibStub("AceEvent-3.0"):Embed(aura_env)~J ~J aura_env.showAbsolute~`=~`false~`--set~`to~`true~`to~`show~`absolute~`heal~`value~`instead~`of~`percentage~J ~J aura_env.lastSec~`=~`5~J aura_env.percDmg~`=~`0.5~J aura_env.minHealthPerc~`=~`0.05~J ~J aura_env.table~`=~`{}~J ~J --set~`bonuses~J aura_env.GetNumSetPieces~`=~`function(set,~`class)~`~J ~`~`~`~`class~`=~`class~`or~`select(2,~`UnitClass("player"))~J ~`~`~`~`local~`pieces~`=~`aura_env.sets[class][set]~`or~`{}~J ~`~`~`~`local~`counter~`=~`0~J ~`~`~`~`for~`_,~`itemID~`in~`ipairs(pieces)~`do~J ~`~`~`~`~`~`~`~`if~`IsEquippedItem(itemID)~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`counter~`=~`counter~`+~`1~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J ~`~`~`~`return~`counter~J end~J ~J aura_env.sets~`=~`{~J ~`~`~`~`["DRUID"]~`=~`{~J ~`~`~`~`~`~`~`~`["T18"]~`=~`{~J ~`~`~`~`~`~`~`~`~`~`~`~`124246,~J ~`~`~`~`~`~`~`~`~`~`~`~`124255,~J ~`~`~`~`~`~`~`~`~`~`~`~`124261,~J ~`~`~`~`~`~`~`~`~`~`~`~`124267,~J ~`~`~`~`~`~`~`~`~`~`~`~`124272,~J ~`~`~`~`~`~`~`~`},~J ~`~`~`~`},~J }~J ~J ~J aura_env.text~`=~`function(...)~J ~`~`~`~`local~`i~`=~`1~J ~`~`~`~`local~`cur~`=~`GetTime()~J ~`~`~`~`local~`total~`=~`0~J ~`~`~`~`~J ~`~`~`~`--get~`total~`damage~`taken~J ~`~`~`~`while~`aura_env.table[i]~`do~J ~`~`~`~`~`~`~`~`--grab~`table~`entries~`with~`time~`and~`damage~J ~`~`~`~`~`~`~`~`local~`time~`=~`aura_env.table[i][1]~J ~`~`~`~`~`~`~`~`local~`dmg~`=~`aura_env.table[i][2]~J ~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`--if~`the~`damage~`happened~`outside~`of~`the~`timewindow~J ~`~`~`~`~`~`~`~`if~`cur~`>~`time~`+~`aura_env.lastSec~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`--remove~`the~`entry~J ~`~`~`~`~`~`~`~`~`~`~`~`table.remove(aura_env.table,~`i)~J ~`~`~`~`~`~`~`~`else~`--otherwise~J ~`~`~`~`~`~`~`~`~`~`~`~`--add~`up~`the~`damage~`and~`go~`to~`next~`entry~J ~`~`~`~`~`~`~`~`~`~`~`~`total~`=~`total~`+~`dmg~J ~`~`~`~`~`~`~`~`~`~`~`~`i~`=~`i~`+~`1~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J ~`~`~`~`~J ~`~`~`~`--Mastery~J ~`~`~`~`local~`mastery~`=~`1~`+~`GetMastery()~`/~`200~J ~`~`~`~`~J ~`~`~`~`--Versatility~J ~`~`~`~`local~`vers~`=~`1~`+~`((GetCombatRatingBonus(29)~`+~`GetVersatilityBonus(30))~`/~`100)~J ~`~`~`~`~J ~`~`~`~`--Leech~J ~`~`~`~`local~`leech~`=~`1~`+~`GetLifesteal()~`/~`100~J ~`~`~`~`~J ~`~`~`~`--Guardian~`of~`Elune~J ~`~`~`~`local~`goe~`=~`((select(4,~`GetTalentInfo(6,2,1)))~`and~`UnitBuff("player",~`GetSpellInfo(213680)))~`and~`1.2~`or~`1~J ~`~`~`~`~J ~`~`~`~`--check~`artifact~`traits~J ~`~`~`~`local~`currentRank~`=~`0~J ~`~`~`~`local~`loaded~`=~`IsAddOnLoaded("LibArtifactData-1.0")~`or~`LoadAddOn("LibArtifactData-1.0")~J ~`~`~`~`if~`loaded~`then~J ~`~`~`~`~`~`~`~`aura_env.LAD~`=~`aura_env.LAD~`or~`LibStub("LibArtifactData-1.0")~J ~`~`~`~`~`~`~`~`if~`not~`aura_env.LAD:GetActiveArtifactID()~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`aura_env.LAD:ForceUpdate()~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`local~`_,~`traits~`=~`aura_env.LAD:GetArtifactTraits()~J ~`~`~`~`~`~`~`~`if~`traits~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`for~`_,v~`in~`ipairs(traits)~`do~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`if~`v.spellID~`==~`200400~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`currentRank~`=~`v.currentRank~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`break~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J ~`~`~`~`local~`trait~`=~`1~`+~`0.05~`*~`currentRank~J ~`~`~`~`~J ~`~`~`~`--Guardian~`Spirit~J ~`~`~`~`local~`gs~`=~`UnitBuff("player",~`GetSpellInfo(47788))~`and~`1.4~`or~`1~J ~`~`~`~`~J ~`~`~`~`--Divine~`Hymn~J ~`~`~`~`local~`dh~`=~`UnitBuff("player",~`GetSpellInfo(64844))~`and~`1.1~`or~`1~J ~`~`~`~`~J ~`~`~`~`--Life~`Cocoon~J ~`~`~`~`local~`lc~`=~`UnitBuff("player",~`GetSpellInfo(116849))~`and~`1.5~`or~`1~J ~`~`~`~`~J ~`~`~`~`--T17~J ~`~`~`~`local~`t17~`=~`1~J ~`~`~`~`local~`t17n,~`_,~`_,~`t17s~`=~`UnitBuff("player",~`GetSpellInfo(177969))~J ~`~`~`~`if~`t17n~`then~J ~`~`~`~`~`~`~`~`t17~`=~`1~`+~`t17s~`*~`0.1~J ~`~`~`~`end~J ~`~`~`~`~J ~`~`~`~`--T18~J ~`~`~`~`local~`t18~`=~`UnitBuff("player",~`GetSpellInfo(192081))~`and~`aura_env.GetNumSetPieces("T18")~`>=~`2~`and~`1.2~`or~`1~J ~`~`~`~`~J ~`~`~`~`--T19~J ~`~`~`~`local~`t19~`=~`1~J ~`~`~`~`local~`t19n,~`_,~`_,~`t19s~`=~`UnitBuff("player",~`GetSpellInfo(211160))~J ~`~`~`~`if~`t19n~`then~J ~`~`~`~`~`~`~`~`t19~`=~`1~`+~`(t19s~`/~`3)~J ~`~`~`~`end~J ~`~`~`~`~J ~`~`~`~`--Skysec's~`Hold~J ~`~`~`~`local~`leg~`=~`IsEquippedItem(137025)~`and~`0.100078~`or~`0~`--restores~`~|10%~`of~`mastery~`affected~`maxhp~J ~`~`~`~`if~`leg~`>~`0~`then~J ~`~`~`~`~`~`~`~`--but~`the~`buff~`doesn't~`roll~`over~`like~`FR,~`so~`loses~`value~`if~`uses~`twice~`in~`quick~`succession~J ~`~`~`~`~`~`~`~`local~`exp~`=~`select(7,~`UnitBuff("player",~`GetSpellInfo(208218)))~`or~`GetTime()~J ~`~`~`~`~`~`~`~`local~`rem~`=~`exp~`-~`GetTime()~J ~`~`~`~`~`~`~`~`if~`rem~`>~`2~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`leg~`=~`leg~`*~`1~`/~`3~J ~`~`~`~`~`~`~`~`elseif~`rem~`>~`1~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`leg~`=~`leg~`*~`2~`/~`3~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J ~`~`~`~`~J ~`~`~`~`~J ~`~`~`~`local~`heal~`=~`total~`*~`aura_env.percDmg~`--damage~`taken~`*~`FR~`percentage~J ~`~`~`~`local~`perc~`=~`heal~`/~`UnitHealthMax("player")~`--relative~`to~`maxHP~J ~`~`~`~`perc~`=~`math.max(aura_env.minHealthPerc,~`perc)~`--minimum~`FR~`percentage~J ~`~`~`~`perc~`=~`(perc~`*~`goe~`*~`trait~`*~`t17~`*~`t18~`*~`t19~`*~`vers~`+~`leg)~`*~`mastery~`*~`leech~`*~`gs~`*~`dh~`*~`lc~`--apply~`all~`multipliers~J ~`~`~`~`heal~`=~`perc~`*~`UnitHealthMax("player")~`--get~`the~`actual~`heal~`value~J ~`~`~`~`~J ~`~`~`~`return~`heal~J end~J ~J TMW.C.IconComponent:RegisterDogTag("TMW",~`"FrenziedRegen",~`{~J ~`~`~`~`~`~`~`~`code~`=~`aura_env.text,~J ~`~`~`~`~`~`~`~`events~`=~`"FastUpdate",~J ~`~`~`~`~`~`~`~`ret~`=~`"string",~J ~`~`~`~`~`~`~`~`doc~`=~`"Returns~`the~`predicted~`heal~`amount~`from~`Frenzied~`Regeneration",~J ~`~`~`~`~`~`~`~`example~`=~`'[FrenziedRegen]~`=>~`"326137"',~J ~`~`~`~`~`~`~`~`category~`=~`"Custom",~J })~J ~J function~`aura_env:COMBAT_LOG_EVENT_UNFILTERED(event,~`time,~`subevent,~`...)~J ~`~`~`~`if~`select(6,~`...)~`==~`UnitGUID("player")~`then~J ~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`--set~`selection~`offset~`to~`amount~`for~`baseline~`SWING_DAMAGE~J ~`~`~`~`~`~`~`~`local~`offset~`=~`10~J ~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`--handle~`SPELL_ABSORBED~`events~J ~`~`~`~`~`~`~`~`if~`subevent~`==~`"SPELL_ABSORBED"~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`--if~`a~`spell~`gets~`absorbed,~`there~`are~`3~`additional~`parameters~`regarding~`which~`spell~`got~`absorbed,~`so~`move~`the~`offset~`3~`more~`places~J ~`~`~`~`~`~`~`~`~`~`~`~`if~`GetSpellInfo((select(offset,~`...)))~`==~`(select(offset~`+~`1,~`...))~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`offset~`=~`offset~`+~`3~J ~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`--absorb~`value~`is~`7~`places~`further~J ~`~`~`~`~`~`~`~`~`~`~`~`offset~`=~`offset~`+~`7~J ~`~`~`~`~`~`~`~`~`~`~`~`tinsert(aura_env.table,~`{GetTime(),~`(select(offset,~`...))})~J ~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`--handle~`regular~`XYZ_DAMAGE~`events~J ~`~`~`~`~`~`~`~`elseif~`subevent:find("_DAMAGE")~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`--don't~`include~`environmental~`damage~`(like~`falling~`etc)~J ~`~`~`~`~`~`~`~`~`~`~`~`if~`not~`subevent:find("ENVIRONMENTAL")~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`--move~`offset~`by~`3~`places~`for~`spell~`info~`for~`RANGE_~`and~`SPELL_~`prefixes~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`if~`subevent:find("SPELL")~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`offset~`=~`offset~`+~`3~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`elseif~`subevent:find("RANGE")~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`offset~`=~`offset~`+~`3~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`tinsert(aura_env.table,~`{GetTime(),~`(select(offset,~`...))})~J ~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J end~J aura_env:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")~J ~J ~J ~J  ^SEvent^SOnEventsRestored ^t^Sn^N1 ^t^SSettingsPerView^T ^Sicon^T ^STexts^T ^N1^S ^N2^S[FrenziedRegen:Short] ^t^t^t^SStates^T ^N1^T ^t^N3^T ^t^N4^T ^t^t^t^N82302^S~`~| ^Sicon^^

 

 


Edited Nov 26, 2016

Posted by CurseForge user Cybeloras

commented

Sorry to bump such an old thread, but I'm trying to make this function for death strike on my DK.

 

Have things changed too much in terms of logging for me to directly apply this? It shows the base heal amount no problem, but seems to draw blanks from damage events (tanking the tank dummy doesn't move the amount from 0).

 

The altered lua that I'm using in the icon is 

 

-- Frenzied Regen by Hamsda of Mannoroth-EU and Yumari of TheMaelstrom-EU
-- Adapted from the WeakAura at https://wago.io/NkogH0_D-

local icon = ...

if TMW.hasInitFR then return end
TMW.hasInitFR = true
icon.aura_env = {}
local aura_env = icon.aura_env
LibStub("AceEvent-3.0"):Embed(aura_env)

aura_env.showAbsolute = false --set to true to show absolute heal value instead of percentage

aura_env.lastSec = 5
aura_env.percDmg = 0.25
aura_env.minHealthPerc = 0.07

aura_env.table = {}


aura_env.text = function(...)
    local i = 1
    local cur = GetTime()
    local total = 0
    
    --get total damage taken
    while aura_env.table[i] do
        --grab table entries with time and damage
        local time = aura_env.table[i][1]
        local dmg = aura_env.table[i][2]
        
        --if the damage happened outside of the timewindow
        if cur > time + aura_env.lastSec then
            --remove the entry
            table.remove(aura_env.table, i)
        else --otherwise
            --add up the damage and go to next entry
            total = total + dmg
            i = i + 1
        end
    end
    
    
    
    
    local heal = total * aura_env.percDmg --damage taken * FR percentage
    local perc = heal / UnitHealthMax("player") --relative to maxHP
    perc = math.max(aura_env.minHealthPerc, perc) --minimum FR percentage
    
    heal = perc * UnitHealthMax("player") --get the actual heal value
    
    return heal
end

TMW.C.IconComponent:RegisterDogTag("TMW", "FrenziedRegen", {
        code = aura_env.text,
        events = "FastUpdate",
        ret = "string",
        doc = "Returns the predicted heal amount from Frenzied Regeneration",
        example = '[FrenziedRegen] => "326137"',
        category = "Custom",
})

function aura_env:COMBAT_LOG_EVENT_UNFILTERED(event, time, subevent, ...)
    if select(6, ...) == UnitGUID("player") then
        
        --set selection offset to amount for baseline SWING_DAMAGE
        local offset = 10
        
        --handle SPELL_ABSORBED events
        if subevent == "SPELL_ABSORBED" then
            
            --if a spell gets absorbed, there are 3 additional parameters regarding which spell got absorbed, so move the offset 3 more places
            if GetSpellInfo((select(offset, ...))) == (select(offset + 1, ...)) then
                offset = offset + 3
            end
            
            --absorb value is 7 places further
            offset = offset + 7
            tinsert(aura_env.table, {GetTime(), (select(offset, ...))})
            
            --handle regular XYZ_DAMAGE events
        elseif subevent:find("_DAMAGE") then
            
            --don't include environmental damage (like falling etc)
            if not subevent:find("ENVIRONMENTAL") then
                
                --move offset by 3 places for spell info for RANGE_ and SPELL_ prefixes
                if subevent:find("SPELL") then
                    offset = offset + 3
                elseif subevent:find("RANGE") then
                    offset = offset + 3
                end
                
                tinsert(aura_env.table, {GetTime(), (select(offset, ...))})
            end
        end
    end
end
aura_env:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")





 


Posted by CurseForge user user_976011