Thread Tools Display Modes
10-21-11, 05:04 AM   #1
jlnugnez
A Murloc Raider
Join Date: Oct 2011
Posts: 4
Detecting if instance is finished

Hello!

I'm writing an addon and trying to detect if an instance is finished.

Right now I can detect in LFG instances the event: LFG_COMPLETION_REWARD

But that event is only thrown when in a LFG party (not a party you create by yourself) and only if there is a reward (for example, if you do the Headless Horseman instance twice in a day, you only get that event the 1st time).

I imagine I could create a table with the last boss of each instance and when he dies I could register it as the end of the instance... but seems a "dirty" way of doing it... there must be somesort of event thrown that I can catch and detect it.

Has anyone had this problem or is there a developer reading this thread that can give a hand?

Thanks!!
  Reply With Quote
10-21-11, 05:49 AM   #2
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
To my knowledge, there is no event fired for completing a dungeon in a manually formed party. You can use /eventtrace a few seconds prior to killing the final boss to make sure.

Iterating through a table containing boss GUID's when something dies is probably going to be your only option.
  Reply With Quote
10-21-11, 06:01 AM   #3
jlnugnez
A Murloc Raider
Join Date: Oct 2011
Posts: 4
Originally Posted by ForeverTheGM View Post
To my knowledge, there is no event fired for completing a dungeon in a manually formed party. You can use /eventtrace a few seconds prior to killing the final boss to make sure.

Iterating through a table containing boss GUID's when something dies is probably going to be your only option.
I'm checking /eventtrace but the amount of events thrown in those couple of seconds is enormous. Havent seen any event that may be useful, that is why I thought about asking...

Not being able to manage it in "normal" groups would be ok for the moment... but the "headless horseman" instance worries me, as it is a LFG instance but with no reward at certain times
  Reply With Quote
10-21-11, 06:41 AM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
My man, in LFD you got an event that fires when the dungeon end boss dies, but otherwise you don't really know unless you track the combat log deaths... I made an addon a while ago LFDRating (back when you played with people from ~4-5 other realms) to keep some sort of karma system going on, in any case I had to detect boss deaths too and the only way I found was finding their deaths in the combatlog.
  Reply With Quote
10-21-11, 06:43 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
End-boss GUIDs (you can find a comprehensive list of all bosses - not just end in LibBossIDs-1.0) and checking those at C_L_E_U|UNIT_DIED would cover 90% of cases.

The other 10% are when the end boss changes depending on instance level / heroic mode (eg. Deadmines, SFK etc)
and when the end boss doesn't actually die but instead flees and spawns a lootbox or whatever alternative mechanic
(eg. LK in 5man, Mal'ganis in culling of Stratholme etc)
These would need to be detected by monitoring boss yell or emote for the specific end-trigger.

That's the only way to cover all your bases afaik.
  Reply With Quote
10-21-11, 11:27 AM   #6
jlnugnez
A Murloc Raider
Join Date: Oct 2011
Posts: 4
Originally Posted by Vladinator View Post
My man, in LFD you got an event that fires when the dungeon end boss dies, but otherwise you don't really know unless you track the combat log deaths... I made an addon a while ago LFDRating (back when you played with people from ~4-5 other realms) to keep some sort of karma system going on, in any case I had to detect boss deaths too and the only way I found was finding their deaths in the combatlog.
Hehehe, didn't know your addon existed, otherwise I'd started there! Its a good thing anyway, I needed to start from scratch to learn more, my programming skills are very rusty.

That's what I'm doing, keeping some rating of random LFD dungeons as I'm tired of getting quitters and people I'd rather have in the ignore list. Getting the instance start is easy, but the end is becoming tricky. I don't get that having the LFG_COMPLETION_REWARD, I guess that there's also some sort of end-dungeon event in for guild experience in guild-dungeon runs, and probably some others... those event's are thrown only under some circumstances and there's nothing that marks the end of the instance every time.
  Reply With Quote
10-21-11, 11:41 AM   #7
jlnugnez
A Murloc Raider
Join Date: Oct 2011
Posts: 4
Originally Posted by Dridzt View Post
End-boss GUIDs (you can find a comprehensive list of all bosses - not just end in LibBossIDs-1.0) and checking those at C_L_E_U|UNIT_DIED would cover 90% of cases.

The other 10% are when the end boss changes depending on instance level / heroic mode (eg. Deadmines, SFK etc)
and when the end boss doesn't actually die but instead flees and spawns a lootbox or whatever alternative mechanic
(eg. LK in 5man, Mal'ganis in culling of Stratholme etc)
These would need to be detected by monitoring boss yell or emote for the specific end-trigger.

That's the only way to cover all your bases afaik.
Thanks! In the end it's a little more cumbersome but with LibBossIDs I guess it can be solved easily...

Hmm, maybe a "InstanceEndLib" could be useful for someone else too... if I manage to finish my addon I'll encapsulate that functionality in a library.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Detecting if instance is finished

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