Page 3 of 111 FirstFirst 123451353103 ... LastLast
Results 21 to 30 of 1109

Thread: WeakAuras Tutoring Thread

  1. #21

    Default

    Deadly Boss Mods Timer Trigger

    Purpose: This is really just a skeleton trigger to use in conjunction with other triggers for alerts based on DBM timers. By default it's created within a Progress Bar alert, but you can easily convert this skeleton into another type (right-click > Convert To) then add your extra stuff, such as Text, Icon, etc.

    The identifier of the DBM timer is created using a combination of values concatenated into the following form:
    Code:
    [TimerType][SpellId][ModBossId][TimerCount]
    This allows DBM to auto-generate localized timer names for the majority of timers.

    Therefore, first check the DBM .lua file, as described below, to determine what type of timer you're working with and locate the spell ID (if available) or partial localized text ID.

    Spell Id Timer

    DBM Skeleton Import String


    Open the .lua file for the encounter in question (e.g. Atramedes is in Addons/DBM-BlackwingDescent/Atramedes.lua).

    There will be a list of local variables and a section generally for timers, such as:
    Code:
    local timerSearingFlame        = mod:NewNextTimer(46.5, 77840)
    If the creation of the timer (the function after the equals sign, such as NewNextTimer or NewTimer) contains non-string values, it's probably a Spell Id Timer and is using the spell ID. In the case of Searing Flame, we see the first number is the seconds of the timer, and the second number if the ID of the spell to track.

    Therefore, we want to import a DBM Skeleton Trigger and change the "id" variable to the spell Id found in the DBM lua file, so in this case the ID for Searing Flame is 77840.
    Code:
        -- === CONFIG SETTINGS BEGIN ===
        -- id: Exact spellId used by the DBM timer creation code
        local id = 12345;
        [...]
        -- === CONFIG SETTINGS END ===
    On the other hand, some timers are not based on a spell or otherwise auto-generated, and instead are manually named by the author of the mod. For example, the timer for the next Air Phase in Atramedes is in the code as:
    Code:
    local timerAirphase        = mod:NewTimer(85, "TimerAirphase")
    In this case, because there is a string value in the timer creation function, we know it uses a localized string to get the timer ID, so we must refer to the localization file for this zone. These are found in Addons/DBM-ZoneName/localization.en.lua, so for Atramedes, we look in Addons/DBM-BlackwingDescent/localization.en.lua.

    Then find the section of this file for the encounter in question, under which there will be a table function of "L:SetTimerLocalization" with a few values in it. For Atramedes, we have:
    Code:
    L:SetTimerLocalization({
        TimerAirphase        = "Airphase",
        TimerGroundphase    = "Groundphase"
    })
    Within this list of values, find the value that matches the key from the timer creation code -- in this case, NewTimer(85, "TimerAirphase") tells DBM to create a timer and name it the localized string value of whatever "TimerAirphase" is set to, which is "Airphase".

    Thus, we know the ID for our DBM airphase timer on an EN client is "Airphase".
    Code:
        -- id: Exact spellId used by the DBM timer creation code
        --    Can also be partially matched string contained in the localized
        --    bar title within DBM .lua (if no spell ID exists).
        local id = "Airphase";
    Time
    Code:
        -- time: Time remaining at which to trigger (in seconds), can be decimal.
        --    If checkTimeElapsed = true, this is time elapsed at which to trigger instead.
        --    If set to zero or negative, time is set to start the same moment as the DBM bar.
        config.time = 5;
    Pretty simple: set this to the number of seconds at which you want the trigger to fire. By default, triggers will fire based on how much time is remaining before the timer ends, so if I want my WeakAuras trigger to fire when the DBM timer has 4.5 seconds left, I would change "time" to 4.5. If you don't know when you want the trigger to fire, or you want the maximum time of the DBM bar, set time = 0.

    Check Time Elapsed
    Code:
        -- checkTimeElapsed: Default checks against time remaining before the timer ends.
        --    If you want to check against time elapsed instead, change to "true".
        config.checkTimeElapsed = false;
    This is a boolean value, and setting it to true changes the behavior to instead check how much time has elapsed on a given DBM timer against your "Time" settings, rather than the default of how much time is remaining.

    Duration (NEW)
    Code:
        -- duration: Duration the trigger should remain active before untrigger, can be decimal.
        --    If set to default of 0 (zero), trigger expires when timer expires.
        --    If set to a positive value of say 5, trigger will expire 5 seconds after
        --    trigger started, as specified by "time" above.
        config.duration = 5;
    Duration allows you to specify how long the display should remain triggered before it untriggers. This is most useful for creating events midway through a DBM timer, such as a trigger that starts 7 seconds before the timer expires, and lasts 5 seconds total (untriggering at the 2 second mark) as seen in the code example. If duration is set to a value of 0, it is simply ignored and the trigger behaves normally, triggering at the "time" specified and untriggering when the timer expires naturally.

    Sub-ID (NEW)
    Code:
        -- subId: Additional identifier to prevent timer corruption if multiple triggers exist
        --    with the same "id" value.
        local subId = 0;
    This field can be ignored for most triggers, but was added as a necessity to distinguish between simultaneous custom DBM triggers that may be running based on the same spell ID. In such situations, the subId should be altered within each display to any unused integer.

    For example, if I have a "Pre-Breath" warning setup to give me a countdown leading up to 5 seconds before the Breath timer expires, and I have a second display of "Breath" that warns me 2 seconds prior to Breath timer expiring, they will use the same "id" (of the Breath spell in question). Therefore, one display should have a subId unique from the other display, such as subId = 0 for "Pre-Breath" and subId = 1 for "Breath", for example.

    Duration Info (NEW)

    The biggest change to the DBM Skeleton trigger is the addition of custom code to display Duration information about the trigger. Note: This means you must edit the CONFIG DATA in the Custom Trigger code and also set the matching ID value in all three fields of Custom Trigger, Custom Untrigger, and Duration Info.

    The advantage of passing Duration Info to the display is that now the DBM displays can utilize countdowns and progress bar-styles, even if the timings do not match that of the DBM timer itself.

    For example, in the default import, there is a DBM timer with a total duration of 10 seconds. The configuration's "Time" to trigger is specified as the 7 second mark, meaning the trigger will go off at 7 seconds remaining. However, the "Duration" is set to 5 seconds, which causes the display to untrigger after 5 seconds, or when the DBM timer in question has 2 seconds left. This info is passed to the Display section of the trigger, allowing one to use %p and %t custom text values to see the exact time remaining on the trigger before it expires at the 2 second mark.

    Just like the rest of the display, the Duration Info detects the rest of the settings, so if no Duration is specified, one can still see the countdown progress if necessary.

    Adding Additional Triggers

    Once you've configured this DBM trigger to match your settings, it can be used in conjunction with any other set of triggers. Simply add a trigger (such as an aura check, cooldown, etc.) and WeakAuras will only produce a warning if both triggers are firing at the same time!
    Last edited by Kulldam; 06-24-2011 at 12:48 AM.

  2. #22

    Default

    Heroic: Al'Akir Helpers

    Import String


    Not a lot of stuff that is trackable would actually prove useful, so for now just added a warning when afflicted by Lightning Rod to move away from the raid.
    Last edited by Kulldam; 04-28-2011 at 11:29 PM.

  3. #23

    Default

    Due to a recent change in DBM coding policy, I've updated the DBM Triggers post -- any triggers based on Spell Id will need to be changed as outlined in the post.

  4. #24

    Default

    Lo, a number of "long" cooldown spells for DK's, are still based on weather you have the runes at the time to cast the spell, wich kinda messes things up when you just want to track the accual cooldown. Can u add a custom trigger so that it goes after the acuall CD and not CD+cost?. would be very helpfull thanks, (cause there are ways to get instant runes, and for planning ahead).

  5. #25

    Default

    Quote Originally Posted by rhozak View Post
    Lo, a number of "long" cooldown spells for DK's, are still based on weather you have the runes at the time to cast the spell, wich kinda messes things up when you just want to track the accual cooldown. Can u add a custom trigger so that it goes after the acuall CD and not CD+cost?. would be very helpfull thanks, (cause there are ways to get instant runes, and for planning ahead).
    I'm not much of a Death Knight expert, so if you could elaborate a great deal more, perhaps with examples and description, maybe I can help.

    Also, not to be a dick, but you may want to spend some time writing clearly and maybe try spell check so it's possible for me to take your request for help seriously.

  6. #26

    Default

    Quote Originally Posted by Kulldam View Post
    I'm not much of a Death Knight expert, so if you could elaborate a great deal more, perhaps with examples and description, maybe I can help.

    Also, not to be a dick, but you may want to spend some time writing clearly and maybe try spell check so it's possible for me to take your request for help seriously.

    Spell check it is sir!. Take Death and Decay for example, it has a cooldown of 30 seconds and costs one unholy rune, however should it get off cooldown, and you dont have a unholy rune or death rune availble, it will still be counted as on cooldown, eventhough it is not. Point is cost factors in on almost every spell that has a cooldown, and identifys itself as off cooldown only when the cooldown and cost for given spell are availble. Not only when the cooldown is ready, wich would be greatly preferable, as resource management should imo be handled seperatly for maximum oversight.
    Maybe i missed some option in weakauras, but this seems to be the fact on every spell that has a cost. Thanks for any help.

    /rhozak

  7. #27

    Default

    Hey! Since BigWigs won't add this feature, I'd like to implement it with WeakAuras. I'm having trouble with the trigger and could need some help.

  8. #28

    Default

    Quote Originally Posted by rhozak View Post
    Spell check it is sir!. Take Death and Decay for example, it has a cooldown of 30 seconds and costs one unholy rune, however should it get off cooldown, and you dont have a unholy rune or death rune availble, it will still be counted as on cooldown, eventhough it is not. Point is cost factors in on almost every spell that has a cooldown, and identifys itself as off cooldown only when the cooldown and cost for given spell are availble. Not only when the cooldown is ready, wich would be greatly preferable, as resource management should imo be handled seperatly for maximum oversight.
    Maybe i missed some option in weakauras, but this seems to be the fact on every spell that has a cost. Thanks for any help.

    /rhozak
    Hi Rhozak,

    Thanks for the clear explanation and description. I believe I managed to get this one figured out:

    Death Knight Resource Ignorant Cooldown

    Import Text



    Functionality: Displays an icon (can be converted to text or whatever indicator is needed) when an ability comes off cooldown, regardless of the resource availability associated with the spell in question. Can also auto-hide display icon after specified length of time, or can keep icon up permanently while ability is ready to be used.

    Usage: Unfortunately, because the Blizzard API actually forces the cooldown of an ability to update based on the resource availability, setting this up requires manually indicating the cooldown time of the ability in question. Once imported, there is a Group created with one Text and one Icon inside. As usual, you'll probably want to rename the group and the Text/Icon as well if you end up using a lot of these for various abilities.

    There are 3 fields in total that can/should be edited:

    ID: The exact spell ID to be tracked (for my testing I used Death & Decay, which is default)
    Cooldown: The cooldown (in seconds) of the ability.
    Timeout: The timeout (in seconds) after the cooldown is ready/icon appears, after which to hide the icon. If set to 0 (zero), disables hiding, keeping the icon always visible while the ability is ready to be used.

    Caveats: Since this uses the combat log to track player casts, this is currently only setup to track abilities that use the SPELL_CAST_SUCCESS or SPELL_CAST_START combat log event types. While this should be the majority of abilities, if you know an ability uses a different combat log type, modifying the first trigger in "DK CD" will be necessary.

  9. #29

    Default

    Quote Originally Posted by powerranger View Post
    Hey! Since BigWigs won't add this feature, I'd like to implement it with WeakAuras. I'm having trouble with the trigger and could need some help.
    Can't test this one, but this is basically two triggers (one to detect Twilight Blast cast, and another to check if Theralion's target is the player). The /say message is part of the Main Trigger Actions, so change the text of the message there.

    Trigger removed, see below.
    Last edited by Kulldam; 03-15-2011 at 06:03 PM.

  10. #30

    Default

    Quote Originally Posted by Kulldam View Post
    Can't test this one, but this is basically two triggers (one to detect Twilight Blast cast, and another to check if Theralion's target is the player). The /say message is part of the Main Trigger Actions, so change the text of the message there
    Thx for your help, Kulldam! That looks pretty good. I'll test it as soon as possible.

    BTW: Would the 2nd trigger be doable without a focus target? In a similar way a bossmod would do it?

    Those are relevant event handlers of BigWigs and DBM:

    Code:
    do
    	local function checkTarget(sGUID)
    		local bossId = UnitGUID("boss2") == sGUID and "boss2target" or "boss1target"
    		if not UnitName(bossId) then return end --The first is sometimes delayed longer than 0.3
    		if UnitIsUnit(bossId, "player") then
    			mod:LocalMessage(92898, CL["you"]:format(L["blast_message"]), "Personal", 92898, "Long")
    		end
    	end
    	function mod:TwilightBlast(...)
    		local sGUID = select(11, ...)
    		self:ScheduleTimer(checkTarget, 0.3, sGUID)
    	end
    end
    Code:
    function mod:TwilightBlastTarget()
    	local targetname = self:GetBossTarget(45993)
    	if not targetname or blackoutActive then return end
    	if targetname == UnitName("player") then
    		specWarnTwilightBlast:Show()
    		if self.Options.YellOnTwilightBlast then
    			SendChatMessage(L.YellTwilightBlast, "SAY")
    		end
    	elseif targetname then
    		local uId = DBM:GetRaidUnitId(targetname)
    		if uId then
    			local inRange = CheckInteractDistance(uId, 2)
    			local x, y = GetPlayerMapPosition(uId)
    			if x == 0 and y == 0 then
    				SetMapToCurrentZone()
    				x, y = GetPlayerMapPosition(uId)
    			end
    			if inRange then
    				specWarnTwilightBlastNear:Show(targetname)
    				if self.Options.TwilightBlastArrow then
    					DBM.Arrow:ShowRunAway(x, y, 8, 5)
    				end
    			end
    		end
    	end
    end

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •