» API Documentation




The Boss Mod Constructor

BossMod = DBM:NewBossMod("ID", "name", "description", "zone", "guiTab", guiSort);

Creates a new boss mod object.

Arguments

(ID, name, description, zone, guiTab, guiSort)
ID
String, needs to be unique and must not contain space characters.
name
String, the boss mod's name to use in the GUI.
description
String, the boss mod's description to show in the GUI.
zone
String, the zone in which the boss mod will receive events. Use DBM_OTHER if you want to enable your boss mod in all zones.
guiTab
String, identifier for the GUI Tab.
guiSort
Number, used to sort the boss mods in the GUI.

Returns

BossMod
A pointer to the created boss mod

Tip

You can always use DBM:GetMod("ID") to get a pointer to the boss mod with the identifier "ID".

Example

local TwinEmps = DBM:NewBossMod("TwinEmps", "Twin Emperors", "Shows timers for the Twin Emperors encounter.", DBM_AQ40, DBMGUI_TAB_AQ40, 6);

Creates a new boss mod for the Twin Emperors in Ahn'Qiraj.

[back to top]



Attributes

Version

BossMod.Version = Version;
Version
String or number, will be used for the smart announce management, the player with the latest version of a boss mod will be the announcer if more players in your raid have announce enabled.

Author

BossMod.Author = "Author";
Author
String, shown in the GUI.

Abbreviation

BossMod.Abbreviation1 = "slash command 1";
BossMod.Abbreviation2 = "slash command 2";
Slash command i
Strings, abbreviations used for short slash commands, default slash command is the mod's name without spaces.

Slash Command Help

BossMod.SlashCmdHelpText = {"line1", "line2", etc...};
Help text
Table, contains strings which will be displayed after the default slash command text for the mod.

Update Interval

BossMod.UpdateInterval = UpdateInterval;
UpdateInterval
Number, time between BossMod:OnUpdate() calls.

Sync Version

BossMod.MinVersionToSync = Version;
Version
Number, minimum DBM (_not_ the boss mod's version!) version to accept sync commands from for this boss mod. Use it if older versions have bad timers.

Extra GUI Tab

BossMod.ExtraGUITab = "GUITab";
GUITab
String, the ID of another GUI tab in which your mod will be displayed. Useful for mods which should be available for both BC and WoW classic.
[back to top]



Boss Mod Methods


AddOption

BossMod:AddOption(name, defaultValue[, guiText, function, dropdownAttributes]);

Adds an option for the boss mod, the value will be saved in the API's saved variables file.

Arguments

(name, defaultValue, guiText, function)
name
String, the options table index to access it by using BossMod.Options[name].
defaultValue
Boolean, the default value for the option.
guiText
String, the text to use in the dropdown menu. There will be no dropdown menu entry if guiText is nil.
function
Function, the function to execute when the button is clicked. Default = DBM:GetMod(ID).Options[name] = not DBM:GetMod(ID).Options[name].
dropdownAttributes
Table, additional attributes for the dropdown button. Example: You can set this to {tooltipTitle = "Tooltip", tooltipText = "Hello, I'm a tooltip :)"} if you want a tooltip for your option.

Example

TwinEmps:AddOption("BugExplode", true, "Show warning when a nearby bug is about to explode");

Adds a dropdown menu button to toggle the bug explode warning.

[back to top]



RegisterCombat

BossMod:RegisterCombat("startMethod"[, delay or "trigger", "bossName", "displayName", "killName", minCombatTime]);

Registers the boss mod for the combat detection system. Executing this method once is required to use the BossMod:OnCombatStart(delay); and BossMod:OnCombatEnd(); methods and the BossMod.InCombat attribute. It's also required for other combat related features like auto responding to whispers during combat, etc.

Arguments

(startMethod, delay or trigger, bossName, displayName, killName, minCombatTime)
startMethod
String, can be "YELL", "EMOTE" or "COMBAT"
delay or trigger
Number for startMethod = "COMBAT", used as delay in seconds to check if the boss is in combat. Default = 5.
String or table for startMethod = "YELL" or "EMOTE", contains the exact text of the yell or emote that is used to detect the pull. Use a table like this {"yell 1", "yell 2"} for bosses that have more than one yell/emote.
bossName
String, the name of the boss. The boss mod's name is used as default value.
displayName
String, the name to show in the "Boss pulled!" and "Boss down!" messages.
killName
String or table, the boss to kill to trigger the combat end event. Use a table like this {"boss1", "boss2"} for encounters with more than one boss (e.g. Four Horsemen).
minCombatTime
Number, minimum time before checking for combat end, use it for bosses where you are out of combat for more than 10 seconds after the combat initiating event. (e.g. Kel'Thuzad).

Examples

Horsemen:RegisterCombat("COMBAT", 5, "Sir Zeliek", "The Four Horsemen", {"Thane Korth'azz", "Highlord Mograine", "Sir Zeliek", "Lady Blaumeux"});

Registers the Four Horsemen boss mod's :OnCombatStart() and :OnCombatEnd() functions.

Maexxna:RegisterCombat("COMBAT");

Registers the Maexxna boss mod's OnCombatStart() and OnCombatEnd() functions. We don't need to give the name because the boss mod's name (which is also Maexxna) will be used as default and a delay of 5 seconds is fine for this encounter.

KelThuzad:RegisterCombat("YELL", DBM_KELTHUZAD_PHASE1_EXPR, nil, nil, nil, 45);

Registers Kel'Thuzad's yell, names aren't needed but a minimum combat time is needed because you are out of combat in the first ~30 seconds.

[back to top]



RegisterEvents

BossMod:RegisterEvents("event1", "event2", etc...);

Registers one or more events which will be received by the BossMod:OnEvent(event, arg1) method. You can also register COMBAT_LOG_EVENT_UNFILTERED subevents. See combat log events for details.

Arguments

(events)
events
String, one or more events to register.
[back to top]



AddMsg

BossMod:AddMsg("msg"[, "prefix"]);

Prints a message to the default chat frame.

Arguments

(msg, prefix)
msg
String, the message.
prefix
String, the prefix. Default = the boss mod's name.
[back to top]



Announce

BossMod:Announce("msg"[, local]);

Broadcasts a message to the raid, using Blizzard's raid warning chat.

Arguments

(msg, color, local)
msg
String, the message.
color
Number (1-4), color. (color 1, color 2, color 3, color 4)
local
Boolean, message will only be shown local if true. Default = false.

Tip

Use ">" and "<" to mark player names to color them! E.g.: ("Evil Debuff on >%s<"):format(target)

[back to top]



AddSpecialWarning

BossMod:AddSpecialWarning("msg"[, flash, shake]);

Adds a huge blue message in the middle of the screen and fires special events to get the user's attention.

Arguments

(msg, flash, shake)
msg
String, the message.
flash
Boolean, show flash effect if enabled. Default = true.
shake
Boolean, show shake effect if enabled. Default = true.
[back to top]



SendHiddenWhisper

BossMod:SendHiddenWhisper("msg", "player");

Sends a hidden whisper message.

Arguments

(msg, player)
msg
String, the message.
player
String, the player who receives the whisper message.
[back to top]



Schedule

BossMod:Schedule(time, function, ...);

Schedules a function to be called after a given time.

Arguments

(time, function, ...)
timer
Number, used as timer.
function
String or function, the function to call.
...
Anything, will be passed as arguments to function.
[back to top]



ScheduleEvent

BossMod:ScheduleEvent(time, ...);

Schedules the boss mod's OnEvent() method to be called after a given time with the given arguments.

Arguments

(time, ...)
timer
Number, used as timer.
...
Anything, will be passed as arguments to :OnEvent().
[back to top]



ScheduleAnnounce

BossMod:ScheduleEvent(time, msg, color, local);

Schedules an announce.

Arguments

(time, msg, color)
timer
Number, used as timer.
msg
String, see :Announce()
color
Number, see :Announce()
local
Boolean, see :Announce()
[back to top]



ScheduleMethod

BossMod:ScheduleMethod(time, method, ...);

Schedules an announce.

Arguments

(time, method, ...)
timer
Number, used as timer.
method
String, the method to call. (--> method = "Announce" would have the same effect as calling :ScheduleAnnounce())
...
Anything, will be passed as arguments to :method().
[back to top]



UnSchedule

BossMod:UnSchedule(function, ...);

Unschedules a scheduled function, can unschedule more than one scheduled task with one call.

Arguments

(function, ...)
function
String or function, the function to unschedule.
...
Anything, arguments of the scheduled function. (optional, see example!)

Tip

You can use :UnScheduleEvent(), :UnScheduleAnnounce() and :UnScheduleMethod() to unschedule scheduled announces, all of these methods receive the same arguments (except the timer) as the :ScheduleX() methods.

Example

self:ScheduleMethod(10, "Foo", 1, 2, 3)
self:ScheduleMethod(10, "Foo", 1, 2, 3)
self:ScheduleMethod(10, "Foo", 1, "a", 3)

self:UnScheduleMethod("Foo") -- will unschedule all 3 tasks
self:UnScheduleMethod("Foo", 1) -- will unschedule all 3 tasks
self:UnScheduleMethod("Foo", 1, 2) -- will unschedule the first 2 tasks
self:UnSchedule(self.Foo, self, 1, "a") -- will unschedule the 3rd task
[back to top]



SetIcon

BossMod:SetIcon(target, [time, icon]);

Sets an icon that will be removed after a specific time.

Arguments

(target, [time, icon])
target
String, name of a raid member.
time
Number, the icon will be removed after time seconds if set.
icon
Number, icon ID. (default = 8 (Skull))
[back to top]



RemoveIcon

BossMod:RemoveIcon(target);

Removes an icon from a raid member.

Arguments

(target, [time, icon])
target
String, name of a raid member.
[back to top]



StartStatusBarTimer

BossMod:StartStatusBarTimer(timer, "name"[, "icon", noBroadcast, repetitions, colorR, colorG, colorB, colorA]);

Starts a status bar timer, the name is used as an ID for synchronization. See localizing bars for localization information.

Arguments

(timer, name, icon, noBroadcast, repetitions, colorR, colorG, colorB, colorA)
timer
Number, the timer.
name
String, the text of the bar and the synchronization ID.
icon
String, path to a texture.
noBroadcast
Boolean, set this to true if you don't want to sync this timer with other clients.
repetitions
Number, the timer will be repeated <x> times.
colorR
Number (0-1), use this to overwrite the user's custom color.
colorG
Number (0-1), use this to overwrite the user's custom color.
colorB
Number (0-1), use this to overwrite the user's custom color.
colorA
Number (0-1), use this to overwrite the user's custom bar transparency.

Localizing Bars

You may never use a localized name to start a status bar timer, because the default name is also used as an ID. You can use the status bar localization table DBM_SBT to localize your bars. Just use the bar's default name/ID as index and the localized name as value:

DBM_SBT["my status bar"] = "my localized status bar";

Now start a status bar timer with the name/id "my status bar", it will be displayed as "my localized status bar". You can also localize bars with dynamic names:

DBM_SBT["bossModID"] = {
   [1] = {
      [1] = "(%w+) (%d+)",
      [2] = "%2 %1",
   },
}

Timer that have names like "text 1000" will now be shown as "1000 text". The two fields in the table will be passed to string.gsub.

[back to top]



UpdateStatusBarTimer

BossMod:UpdateStatusBarTimer("name"[, elapsed, timer, "newName", "newIcon", noBroadcast]);

Updates a status bar timer, this function can change its name, time and elapsed time. All arguments are optional, so if you can set them to nil, if you don't want to change them.

Arguments

(name, elapsed, timer, newName, noBroadcast)
name
String, the name of the timer to update.
elapsed
Number, the new elapsed time since timer start.
timer
Number, the new timer after which the status bar timer expires.
newName
String, the new name of the timer.
newIcon
String, the new icon.
noBroadcast
Boolean, set this to true if you don't want to sync this update event with your raid group.
[back to top]



GetStatusBarTimerTimeLeft

timeLeft, timeElapsed = BossMod:GetStatusBarTimerTimeLeft("name");

Returns the time left and the elapsed time of a status bar timer.

Arguments

(name)
name
String, the name of the timer.

Returns

timeLeft
Number, the time left.
timeElapsed
Number, the elapsed time since the timer was started.



EndStatusBarTimer

BossMod:EndStatusBarTimer("name"[, noBroadcast]);

Ends a status bar timer.

Arguments

(name, noBroadcast)
name
String, the name of the timer.
noBroadcast
Boolean, set this to true if you don't want to sync this with your raid group.
[back to top]



SendSync

BossMod:SendSync(msg);

Sends a sync message. Incoming sync messages will call the boss mod's :OnSync() method.

Arguments

(msg)
msg
String, the message to send.
[back to top]



Deadly Boss Mods by Tandanu
Website Design by Matthew "Agent Spork" McGee
World of Warcraft and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries.