Thread Tools Display Modes
11-23-11, 12:38 AM   #1
hershe
A Deviate Faerie Dragon
Join Date: Jun 2011
Posts: 10
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!
  Reply With Quote
11-23-11, 02:36 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
  Reply With Quote
11-23-11, 12:13 PM   #3
hershe
A Deviate Faerie Dragon
Join Date: Jun 2011
Posts: 10
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Identifying Raid Boss Encounter

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off