Hi!
Just wanted to share a modified version of BattlegroundTargets.
This version includes a Healer Detection system implemented by Nobrainx.
I made some adjustments to ensure compatibility with Mercenary Mode.
I also implemented a callback from my addon BattleGroundHealers to provide enhanced combatlog–based detection, improving BGT’s HD system.
Additionally, I completed the flag carrier tracking feature (the original backport missed Eye of the Storm support), along with some other minor tweaks.
BattlegroundTargets
Features
- Creates clickable pseudo unit frames for battleground enemies.
- Allows targeting (left-click) and focusing (right-click) directly from the frame.
- Special indicators for target, focus, role and other statuses.
- Flag Carrier Tracking System for Warsong Gulch and Eye of the Storm.
- Support for Cross-Faction Battlegrounds and Mercenary Mode.
- Integrated Healer Detection System, including a persistent database.
- Incorporates BattleGroundHealers’ combatlog-based method for improved detection
Slash Commands
/bgt : Opens the configuration panel..
/bgt help : Prints all available commands
/bgt hdlog : Announces each healer detection in your local chat.
Hi, first of all, thank you very much for your contribution.
I haven't been able to get the check range to work. Do you know anything about this?
Hi! You're welcome :)
About the Range-Check feature:
The addon uses two different strategies to estimate whether enemy players are within range, but it’s important to note that both are indirect methods, and the results are always approximations (because the game does not provide exact distance information through the API).
1. ClassSpells-based detection: This method uses a class-specific spell (like Charge for Warriors or SWP for Priests) and checks whether that spell would be in range on a visible enemy unit — such as your target, focus, or even a raid member’s current target (e.g. raid1target).
It relies on the WoW API function IsSpellInRange(spellName, unitID), which is fairly accurate, but it only works when the enemy has a valid unitID.
This check runs every 0.2 seconds per enemy, and the result is temporarily stored to control range-check indicators.
2. CombatLog-based detection: This method listens to all combat events via COMBAT_LOG_EVENT_UNFILTERED*. When an enemy casts a spell that hits you or one of your teammates (or vice versa), and that spell has a known maximum range (from GetSpellInfo(spellId)), the addon assumes the enemy is within that distance.
This approach is more flexible since it can detect enemies without needing a unitID, however, it is also less accurate, more speculative, and heavier on CPU usage due to the high frequency of CLEU events and the processing required to handle them.
* EDIT: After some testing, it seems that the Combatlog-based detection was broken due to a mismatch between the CLEU argument structure in Cata and the one used in WotLK. This is now fixed; you can redownload the addon from the same link.
Personally, I choose not to enable the Range-Check feature, due to its limited precision and performance cost, but it’s totally valid to experiment with it or even contribute improvements.