Time to die
So I am doing something like the following to figure out how long it will take a mob to die...is there a better way or a "smoother" or more accurate way (it is a time to die driven status bar being you vs your target)it does the calculations for you and your target and sets the value of the status bar off of that along with showing both times to die as text under the bar (RemainingTimeToKill is capped also to prevent infinite errors)
the HPs / MaxHPs are actually updated by unit event handlers but this is the current formula I am using lua Code:
|
This is a more complicated solution that would weight recent performance more strongly and only consider the last 15 seconds.... which should shield you from awkward boss fights that have intermission phases.
Lua Code:
PS, if you think this is a bit too complex (you wouldn't be wrong!) then consider a simple-moving-average... ie, just take the last X seconds and do a single division whenever its more CombatStartTime is beyond some threshold. |
Thanks... I will have to figure out how to work this in to the addon... It should solve the jumpiness nicely. (All the GUID/units my addon tracks.. (They get added from "NAME_PLATE_UNIT_ADDED" initially. Well .5 seconds after as when I tried when the event fired I wasn't getting all the info available) and combat checked when added... I will have to tweak my GUID cache table (already contains names, health data, and more) and put the tables to average in them along with the ticker so I can purge old records but destroy the ticker first... because I don't want to leave a ton of them around. (Well I guess I could make them self delete easily enough which would be even better than purging the records on "PLAYER_REGEN_ENABLED") So many new ideas... Thank You
|
All times are GMT -6. The time now is 06:22 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI