Encounter Detection
I'm currently writing an addon to report encounter progress to whispers during a boss fight. It would be cool to be able to return Encounter Journal links to the whisperers. My current NYI strat for this is
I'd then compare the list of creatures to the names of the currently visible boss frames by name to get the current encounter in progress. My questions about this:
Another problem is a boss like Jandice Barov. She disappears at 66% and 33% health, so does her boss frame. I check for a boss presence at INSTANCE_ENCOUNTER_ENGAGE_UNIT and issue a whisper reply if there is a boss frame present. Any idea on how to handle this case? Currently I'm settled on just returning a EJ link to the current encounter, which I could cache at the start of the fight, but it would be nice to be able to return the current health of the boss too. Here my current WIP (EJ functionality NYI). Code is based on SimpleBossWhisperer by Rabbit: lua Code:
|
This is what I have so far: https://github.com/Rainrider/rainBossWhisperer
I still have to work some minors out yet and test this thoroughly, but I think the concept is ok and working. Would be very glad if you guys could review the code, as I'm rather an inexperienced programmer. Could it be done better? Do you spot any flaws? Thank you for your feedback in advance! |
I was working on something like this the other day and thought of a neat solution for any instance in the dungeon journal,
Code:
local function distance2d_squared(x1, y1, x2, y2) Combining this with the event INSTANCE_ENCOUNTER_ENGAGE_UNIT (which fires whenever a unit is added or removed to a boss frame) and IsEncounterInProgress() which returns 1 when you're in a fight you can't release from (ie, an encounter) and you should get something close to what you're after. This is what I was using it for - https://github.com/eggsampler/tattletale (my code is nowhere near finished or working yet though :P) |
Personally, I do encounter detection by having a table of mobs associated with each boss encounter, which is a bit of manual work but not too much (I expect it to become more work when I switch from mob names to mob IDs, as I ought to). It might not be the most elegant solution, but it seems to work easily enough and makes no assumption regarding boss frames and such. You can check it out in this add-on.
|
@exemplar
Your approach might be helpful to get the encounter in case there are no boss frames spawn initially or the shown bosses are not in the encounter's list of creatures. You'd probably better register PLAYER_REGEN_DISABLE, call IsEncounterInProgress() and check further if so. Are the x, y returns from EJ_GetMapEncounter influenced by map scale? @Malsomnus Combat log scanning is way beyond what I want to do with my addon. Maybe you could embed LibBossIDs to get the mobIDs. |
Sorry, maybe I didn't make it clear.
IsEncounterInProgress() and InCombatLockdown() always return false and nil respectively when PLAYER_REGEN_DISABLED fires, the information isn't available to the UI at that point. The easiest way I've found to get both is when INSTANCE_ENCOUNTER_ENGAGE_UNIT fires which is every encounter I've seen. |
All times are GMT -6. The time now is 01:42 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI