TellMeWhen

TellMeWhen

24M Downloads

[CF 1469] Tracking damage taken during window

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

commented

Hi, I'm not sure if is the best place to ask for support, but found a similar post here, which was close but not what I needed.

I'm trying to make a TMW to track how much damage I take during Temporal Shield. At a high level, I'd like it to do this:

while Temporal Shield activated
    highHP = whatever player's HP% is at the time TS is applied
    currentHP = player's current HP%
    time = 0
    while time < 6
        currentHP = update again to player's current HP%
        differenceHP = highHP - currentHP
        return differenceHP            
        time++
return differenceHP

I don't know Lua, but I sometimes have success editing more basic Lua TMW/WA's. In the past I've been able to piece together what I want using the documentation and an existing TMW/WA. The closest I came to what I want is finding this Frenzied Regen aura that I linked above. I can see the logic, but FR acts differently to TS and don't understand all the different built in functions it's using.

I hope this makes sense, as I said I'm a total novice so I hope my thinking is on the right path. I'm thinking I would return the differenceHP into a counter, then have Dog Tags display the counter as a %?

Huge fan of the addon, been using it for years and now I'm trying to push it (and myself) further by getting a better understanding of Lua

Thanks


Posted by CurseForge user Rukk | Imported from CurseForge issue #1469 | Raw

commented

A good way to track this is by parsing COMBAT_LOG_UNFILTERED and tracking _DAMAGE events. By doing some basic filtering you can track all the damage your character has taken. You can make the function register onShow and deregister onHide. 

 

In terms of what to do with the data - you can update TMW counters like this:

 

TMW.COUNTERS[name] = valueTMW:Fire("TMW_COUNTER_MODIFIED", name)

I have a BrM Black Ox Statue tracker that works based on damage parsing so you can try and reverse engineer it to your needs (it uses TMW Script Tools for counter management but you can just use the method I listed above if you don't want another addon). 

 


Posted by CurseForge user ariehg