Thread Tools Display Modes
04-21-11, 03:43 AM   #1
crowds
A Defias Bandit
Join Date: Apr 2011
Posts: 3
Question Tracking Health of a Boss

Hi

Im pretty new (ok completely) to lua. Although I do have a background in In PHP, XML,HTML and Actionscript.

Im looking for a way to track the health of a Boss but i need to do it in such a way that the health can be tracked even if the Unit is not targeted. Also without the unit being set as /focus. The reason being in a lot of encounters is there are adds to deal with and targets can change. Also healers like to reserve (at least i do) /focus for the tank.

I guess I need a way to monitor a NPC on combat start till combat end independant target or focus. Can anyone point me in the right direction ?

Cheers
Jim
  Reply With Quote
04-21-11, 03:47 AM   #2
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
You use standard ui or any other uf addon?

Most uf addons these day feature a boss frame, it's even there in the default ui afaik?
  Reply With Quote
04-21-11, 04:40 AM   #3
crowds
A Defias Bandit
Join Date: Apr 2011
Posts: 3
I use tukui, which does have a boss frame. But im after a way of triggering an event when the boss health reaches say 15-20% and so do really want to rely on having to keep an eye on the health of the boss frame.
I presume if wow can create a boss frame with or without it being targeted the there is a way of monitoring its health.
Instead of say: local health UnitHealth("target") would it work if I used the boss name : local health UnitHealth("General Husam")... but how could i automaticaly get the boss name without targeting it ?

like... on_combat_start getbossname() type thing
  Reply With Quote
04-21-11, 05:53 AM   #4
Olog
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
I believe you can simply do UnitHealth("boss1")
  Reply With Quote
04-21-11, 10:54 AM   #5
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
What you are suggesting is not (entirely)possible. It would be possible to create a frame with a statusbar after you target a mob and using the combat log to track HP using GUID, but it won't be possible to click them, as targeting requires a unit.

There is a reason why getting the health of a mob requires a unit. The function name even suggests that it requires this: "UnitHealth('target')"

Getting the name of a boss can be done with UnitName, respectively.

IIRC, Tukui by default has boss frames built into the UI.

Last edited by ravagernl : 04-21-11 at 10:57 AM.
  Reply With Quote
04-21-11, 11:36 AM   #6
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by mrruben5 View Post
but it won't be possible to click them, as targeting requires a unit
afaik boss1-bossx (4?) is valid unit id.

[E]

"bossN" The active bosses of the current encounter if available N (1,2,3 or 4). (Added in 3.3.0)

http://www.wowpedia.org/UnitId
  Reply With Quote
04-21-11, 12:13 PM   #7
hankthetank
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 64
Use bossN as suggested. Track event INSTANCE_ENCOUNTER_ENGAGE_UNIT and verify that boss1-MAX_BOSS_FRAMES exists to see if an encounter is in progress (show your frames) otherwise the boss died (hide them). On receiving ZONE_CHANGED_NEW_AREA during encounters the boss fight has ended due to zoning. On engaging register UNIT_HEALTH and check for bossN. There you can ascertain the health by using UnitHealth("bossN"). Unregister the event when the encounter has ended.

Last edited by hankthetank : 04-21-11 at 12:30 PM.
  Reply With Quote
04-25-11, 03:10 AM   #8
crowds
A Defias Bandit
Join Date: Apr 2011
Posts: 3
Thanks for the replies everyone, some food for thought there. will have to look into in further tonight.
  Reply With Quote
04-26-11, 01:12 AM   #9
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by Duugu View Post
afaik boss1-bossx (4?) is valid unit id.

[E]

"bossN" The active bosses of the current encounter if available N (1,2,3 or 4). (Added in 3.3.0)

http://www.wowpedia.org/UnitId
I was referring to this post
Originally Posted by crowds View Post
I use tukui, which does have a boss frame. But im after a way of triggering an event when the boss health reaches say 15-20% and so do really want to rely on having to keep an eye on the health of the boss frame.
I presume if wow can create a boss frame with or without it being targeted the there is a way of monitoring its health.
Instead of say: local health UnitHealth("target") would it work if I used the boss name : local health UnitHealth("General Husam")... but how could i automaticaly get the boss name without targeting it ?

like... on_combat_start getbossname() type thing
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Tracking Health of a Boss

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