Quantcast
Download
(8 Kb)
Download
Updated: 05/12/18 06:12 AM
Pictures
File Info
Compatibility:
Dragon Bones (3.3)
Updated:05/12/18 06:12 AM
Created:05/05/18 06:22 AM
Monthly downloads:48
Total downloads:236
Favorites:1
MD5:
LibBossFight
Version: 1.41
by: apfelstrudellq [More]
Not totally fleshed out

Boss dataset:
Code:
- name (Boss name)
- health
   # current (Current health)
   # max (Max health)
   # effmax (Max health)
   # delta (Difference between current and max)
- fight
   # start (Timestamp)
   # dps (Current health delta / fight start)
   # last_update (Timestamp)
- is_final (Is final boss [currently only raids])
- unit_tag
- hash (Hash of boss name)
Unit (trashmob) dataset:
Code:
- hash ("name:unit_id")
- unit_id
- name
- registered (timestamp)
- alive 
- damage_taken 
- max_health ( gets set when player targets this mob )
Dungeon dataset:
Code:
- name (localized)
- zone
- fasttravel_node
- access (basegame, dlc, addon)
Callbacks:
Code:
- OnBossTrackingStart(boss) - Triggered when entering boss area

- OnBossTrackingStop(boss) - Triggered when exiting boss area

- OnHardmodeActivation(boss) - Triggered when max health increases while in boss area
# This does not cover when entering the boss area and the hardmode was already activated or hardmodes where no health difference is present (Asylum/Cloudrest detection via amount of bossed killed)
# Use IsHardModeActive should work better in some cases

- OnHardmodeDeactivation(boss) - Triggered when max health decreases while in boss area

- OnBossFightStart(boss, hardmode) - Triggered when boss fight starts

- OnBossFightOver(boss) - Triggered when boss fight ends
# Either boss killed or health resetted to max (wipe)

- OnBossFightBossDPSUpdate(boss, dps, fight_start) - Triggered every X [threshold] seconds
# Boss specific dps update, only single target
# Based on health lost in current-fight_start

- OnBossFightDPSUpdate(dps) - Triggered every X [threshold] seconds
# Returns single target dps for every boss

- OnUnitTrackingStart(unit) - Triggered when trash mob presence detected

- OnUnitTrackingStop(unit) - currently not triggered

- OnUnitDamageTakenUpdate(unit, killing_blow) - Triggered when trash mob takes damage

- OnUnitDeath(unit) - Triggered when trash mob dies
# Only works when max health registered or directly targeted
Dungeon API (available without initializing LBF)
Code:
- PrintDungeonList()

- GetDungeonInfo(dungeon_id)

- GetUnitDungeonInfo(unit) 
# (optional) unit: unit_tag (default: player)

- GetUnitDungeon(unit)
# (optional) unit: unit_tag (default: player)

- TravelToDungeon(dungeon_id)
Functions:
Code:
- Init(dps_threshold_duration, debug_level) - Initializes library
# (optional) dps_threshold_duration: interval in which bossfight dps updates are triggered
# (optional) debug_level: 5 full, 4 critical, 3 error, 2 warning, 1 info, 0 none

- IsInRaidBossFight(raid_id, check_final) - Check if raid boss fight is ongoing
# raid_id: current raid_id [sanity check]
# (optional) check_final: Check if final boss fight

- IsInFight(boss) - Check if in boss fight
# (optional) boss: Returns first found boss dataset

- GetKilledBosses() - Returns amount of killed bosses [works only in raids]

- IsArenaRaid(raid) - Returns if it is a round/arena based raid
# (optional) raid_id: check for raid id or current raid

- GetArenaString() - Returns string of current arena/round

- GetEstimatedScore(raid, tt, duration, remaining, hm, kb) - Calculates estimated score for raid
# (optional) raid
# (optional) target_time
# (optional) current_duration
# (optional) remaining_vitality
# (optional) hardmode_active
# (optional) killed_bosses

- IsHardModeActive() - Returns if hardmode is active

- DetectUnit(unitTag, unitName) - Returns boss based on unitTag or unitName
# (optional) unitTag
# (optional) unitName

- FullFightDPS() - Returns current dps on all currently present bosses

- IsNoTrashRaid(raid) - Returns if it is a raid containing trash mobs or not (AS;CR or rest)
# (optional) raid_id
Implementation in RaidTools (StatusBar, RaidHelper Asylum)

Basic example
Lua Code:
  1. local OLMS_ENGAGEMENT = false
  2. RaidTools.LBF = LibStub('LibBossFight')
  3. RaidTools.LBF:Init()
  4. CALLBACK_MANAGER:RegisterCallback("OnBossFightStart", function(boss, hardmode)
  5.     if RaidTools.LBF:IsInRaidBossFight(TRIAL_ASYLUM_SANCTORIUM, true) then
  6.         OLMS_ENGAGEMENT = true
  7.         d(string.format('Asylum fight started! %s (hm: %s) ', boss.name, tostring(hardmode)))
  8.     end
  9. end)
  10.  
  11. CALLBACK_MANAGER:RegisterCallback("OnBossFightOver", function(boss)
  12.     if OLMS_ENGAGEMENT then
  13.         d('Olms fight over')
  14.     end
  15. end)
  16.  
  17. ---------------------------------------------------------------------------------------------------------
  18. CALLBACK_MANAGER:RegisterCallback("OnUnitDamageTakenUpdate", function(unit, killing_blow)
  19.     d(string.format('OnUnitDamageTakenUpdate(unit: %s, damage: %s [%s], killing_blow: %s)', unit.name, unit.damage_taken, tostring(unit.max_health), tostring(killing_blow)))
  20. end)
  21. CALLBACK_MANAGER:RegisterCallback("OnUnitDeath", function(unit)
  22.     d(string.format('OnUnitDeath(unit: %s)', tostring(unit.name)))
  23.  
  24. end)
  25. CALLBACK_MANAGER:RegisterCallback("OnUnitTrackingStart", function(unit)
  26.     local count = 0
  27.     for _, _ in pairs(unit_list) do
  28.         count = count + 1
  29.     end
  30.     d(string.format('OnUnitTrackingStart(unit: %s, hash: %s, total_units: %s)', unit.name, unit.hash, count))
  31. end)

Public trial/dungeon ids
Lua Code:
  1. -- Craglorn (Basegame)
  2. TRIAL_HEL_RA_CITADEL        = 1
  3. TRIAL_AETHERIAN_ARCHIVE     = 2
  4. TRIAL_SANCTUM_OPHIDIA       = 3
  5. TRIAL_DRAGONSTAR_ARENA      = 4
  6. -- ThievesGuild (DLC)
  7. TRIAL_MAW_OF_LORKHAJ        = 5
  8. -- Orsinium (DLC)
  9. TRIAL_MAELSTROM_ARENA       = 6
  10. -- Morrowind (Addon)
  11. TRIAL_HALLS_OF_FABRICATION  = 7
  12. -- ClockworkCity (DLC)
  13. TRIAL_ASYLUM_SANCTORIUM     = 8
  14. -- Summerset (Addon)
  15. TRIAL_CLOUDREST             = 9
  16.  
  17. -- Basegame
  18. DNG_FUNGAL_GROTTO_I         = 1
  19. DNG_FUNGAL_GROTTO_II        = 2
  20. DNG_SPINDLECLUTCH_I         = 3
  21. DNG_SPINDLECLUTCH_II        = 4
  22. DNG_BANISHED_CELLS_I        = 5
  23. DNG_BANISHED_CELLS_II       = 6
  24. DNG_DARKSHADE_CAVERNS_I     = 7
  25. DNG_DARKSHADE_CAVERNS_II    = 8
  26. DNG_ELDEN_HOLLOW_I          = 9
  27. DNG_ELDEN_HOLLOW_II         = 10
  28. DNG_WAYREST_SEWERS_I        = 11
  29. DNG_WAYREST_SEWERS_II       = 12
  30. DNG_ARX_CORINIUM_I          = 13
  31. DNG_CITY_OF_ASH_I           = 14
  32. DNG_CITY_OF_ASH_II          = 15
  33. DNG_CRYPT_OF_HEARTS_I       = 16
  34. DNG_CRYPT_OF_HEARTS_II      = 17
  35. DNG_DIREFROST_KEEP_I        = 18
  36. DNG_TEMPEST_ISLAND_I        = 19
  37. DNG_VOLENFELL_I             = 20
  38. DNG_BLEACKHEART_HAVEN_I     = 21
  39. DNG_BLESSED_CRUCIBLE_I      = 22
  40. DNG_SELENES_WEB_I           = 23
  41. DNG_VAULTS_OF_MADNESS_I     = 24
  42. -- ImperialCity DLC
  43. DNG_WHITEGOLD_TOWER_I       = 25
  44. DNG_IMPERIAL_CITY_PRISON_I  = 26
  45. -- ShadowOfTheHist DLC
  46. DNG_RUINS_OF_MAZZATUN_I     = 27
  47. DNG_CRADLE_OF_SHADOWS_I     = 28
  48. -- HornsOfTheReach DLC
  49. DNG_BLOODROOT_FORGE_I       = 29
  50. DNG_FALKREATH_HOLD_I        = 30
  51. -- Dragonbones DLC
  52. DNG_FANG_LAIR_I             = 31
  53. DNG_SCALECALLER_PEAK_I      = 32

Raid specifics

LibAsylum
Lua Code:
  1. -- Events:
  2. - OnLlothisPresenceDetected(unit)
  3. - OnFelmsPresenceDetected(unit)
  4. - OnASNonMinibossPresenceDetected(unit)
  5. - FelmsEffect(changeType, effectName, abilityId, unitTag, unitName, beginTime, endTime, stackCount, buffType, effectType)
  6. - LlothisEffect(changeType, effectName, abilityId, unitTag, unitName, beginTime, endTime, stackCount, buffType, effectType)
  7. - FelmsEvent(targeted, result, abilityName, abilityId, sourceType, sourceName, hitValue, powerType)
  8. - LlothisEvent(targeted, result, abilityName, abilityId, sourceType, sourceName, hitValue, powerType)
  9. - OlmsEvent(targeted, result, abilityName, abilityId, sourceType, sourceName, hitValue, powerType)
  10. - OlmsFightStarted
  11. - OlmsFightOver
  12.  
  13. -- Functions:
  14. - GetLlothis()
  15. - GetFelms()
* Version 1.3&1.4 - 10.05.2018 *
- Fixed logic error in trash detection
- Added overview commands for iterating over all currently tracked bosses or trashmobs
- Added dungeon stuff
- Changed trial&dungeon ids to be public variables

* Version 1.2 - 08.05.2018 *
- Added debugging
Optional Files (0)


Archived Files (5)
File Name
Version
Size
Author
Date
1.4
6kB
apfelstrudellq
05/10/18 04:32 AM
1.3
5kB
apfelstrudellq
05/10/18 02:52 AM
1.2
5kB
apfelstrudellq
05/08/18 02:20 PM
1.1
5kB
apfelstrudellq
05/05/18 11:19 AM
1
3kB
apfelstrudellq
05/05/18 06:22 AM


Post A Reply Comment Options
Unread 05/10/18, 04:34 AM  
apfelstrudellq
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 20
Uploads: 2
Originally Posted by Kyoma
I might start using this for Raid Notifier, ever since Asylum there are alot of annoying things that are rather annoying to track and could benefit from centeralizing it (like the mini bosses during HM and such).

Edit: Also, somewhat of a request, a callback/event for (mini)boss health changes since they can't be tracked with boss unit tags. Or a function to retrieve its health by passing boss hash/name
Done. Should be stable enough for tracking purposes in version 1.4
Report comment to moderator  
Reply With Quote
Unread 05/10/18, 04:33 AM  
apfelstrudellq
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 20
Uploads: 2
Originally Posted by Baertram
Hey there, nice library.
Is there a list with the raid_ids of the different raids or is it in the lib somehwere (didn't check it so far).
I meant the ids like "TRIAL_ASYLUM_SANCTORIUM" used in RaidNotifier.
Now available as public variable
Report comment to moderator  
Reply With Quote
Unread 05/05/18, 01:16 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1665
File comments: 1673
Uploads: 46
Hey there, nice library.
Is there a list with the raid_ids of the different raids or is it in the lib somehwere (didn't check it so far).
I meant the ids like "TRIAL_ASYLUM_SANCTORIUM" used in RaidNotifier.
Report comment to moderator  
Reply With Quote
Unread 05/05/18, 07:02 AM  
Kyoma
AddOn Author - Click to view AddOns

Forum posts: 57
File comments: 136
Uploads: 6
I might start using this for Raid Notifier, ever since Asylum there are alot of annoying things that are rather annoying to track and could benefit from centeralizing it (like the mini bosses during HM and such).

Edit: Also, somewhat of a request, a callback/event for (mini)boss health changes since they can't be tracked with boss unit tags. Or a function to retrieve its health by passing boss hash/name
Last edited by Kyoma : 05/05/18 at 07:07 AM.
Report comment to moderator  
Reply With Quote
Unread 05/05/18, 06:56 AM  
apfelstrudellq
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 20
Uploads: 2
Originally Posted by Kyoma
Very interesting idea, had something similar a few years ago but never developed it further. I do wonder about the value and possible overhead of the dps aspects being in the actual library.
Since the whole theme of this library is boss fights and I needed those DPS functions I figured that implementing it wouldn't hurt.
Report comment to moderator  
Reply With Quote
Unread 05/05/18, 06:51 AM  
Kyoma
AddOn Author - Click to view AddOns

Forum posts: 57
File comments: 136
Uploads: 6
Very interesting idea, had something similar a few years ago but never developed it further. I do wonder about the value and possible overhead of the dps aspects being in the actual library.

Edit: Ah so the dps is purely by checking for changes in the boss health which is nessecary anyway for proper tracking so no real overhead because of that.
Last edited by Kyoma : 05/05/18 at 06:59 AM.
Report comment to moderator  
Reply With Quote
Unread 05/05/18, 06:36 AM  
lukkian
 
lukkian's Avatar

Forum posts: 3
File comments: 35
Uploads: 0
So much potential...
Thank you very much and I hope this becomes a success.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: