WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Identifying Raid Boss Encounter (https://www.wowinterface.com/forums/showthread.php?t=41873)

hershe 11-23-11 12:38 AM

Identifying Raid Boss Encounter
 
Hello everyone again :-) Got another request for help, this one hopefully a little more straight forward than localization...

What's the best way to determine if the combat someone is engadged in is a raid boss? not necessarily of the current expansion but if it could do that too, it would be great :-). Idea is I want my addon to behave differently depending on if they are engadged on a difficult fight or not.

The functions UnitLevel("target") and UnitClassification(unit) look like they could be useful, but still not quite there. Ideally I'd like to avoid having to hard code instances/boss names, but if that's what it takes then so be it :-). Even with that though, I'm still not sure how it would identify the boss unless it was targeted. I assume there's a different, better way.

Thanks for your help!

Phanx 11-23-11 02:36 AM

Have you looked at the code of any boss mods? All of the major ones (BigWigs, DBM, DXE, etc.) have generic boss detection. The basic idea is that when you enter combat, you check not only your target, but the targets of all party/raid members, and if any hostile worldboss-classified units are also in combat, then you have engaged a raid boss.

Also, I'm fairly sure you could use the INSTANCE_ENCOUNTER_ENGAGE_UNIT event. The default UI uses this event to show (or hide) boss frames, so when it fires, just check the boss1/2/3/4 unitIDs for worldbosses in combat.

hershe 11-23-11 12:13 PM

Thanks, I took a look at DBM and saw the INSTANCE_ENCOUNTER_ENGAGE_UNIT - though also noted that they didn't completely rely on it, so just getting some opinons on the matter :-)

Thanks. This one seems pretty reliable for now, assuming boss frames are meant to show on current and future bosses - not necessarily the case always I assume.


All times are GMT -6. The time now is 02:50 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI