1. #1

    WeakAuras raid debuff announcing (multiple targets)

    Hello, I have no knowledge regarding LUA (or weakauras), i've been trying to set up weakaura's to announce a certain debuff that a boss does to the raid which players have been afflicted with.

    example: Blade Lord does Wind Step on 2 people called Alice & Bob, these two get announced then by weakaura's.

    Now I've used http://www.wowace.com/addons/weakaur...ayer-names/#p2 as it had pretty much what I wanted, so far I have the following:

    PHP Code:

    The entire code is denoted using COMBAT_LOG_EVENT_UNFILTERED event:
    PHP Code:
    function(eventtimestampmessagehideCastersourceGUIDsourceNamesourceFlagssourceRaidFlagsdestGUIDdestNamedestFlagsdestRaidFlags, ...)
    Check for new aura eventcan also be 
    --  * SPELL_AURA_APPLIED auraType (new aura)
      --  * 
    SPELL_AURA_REMOVED auraType (aura completely removed)
      --  * 
    SPELL_AURA_APPLIED_DOSE auraType amount (new stack of aura)
      --  * 
    SPELL_AURA_REMOVED_DOSE auraType amount (removed stack of aura)
      --  * 
    SPELL_AURA_REFRESH auraType (existing aura refreshed)
      --  * 
    --  * SPELL_AURA_BROKEN_SPELL extraSpellID    extraSpellName    extraSchool    auraType 
    if message == "SPELL_AURA_APPLIED" then
    -- Additional arguments
        local spellId
    spellNamespellSchoolauraType = ...
    Compare caster and spell
    if sourceName == "PlayerName" and (spellName == "Sated" or spellId == 57724then
    -- Add chat ("RAID" can also be "RAID_WARNING")
    SendChatMessage(sourceName or "UNKNOWN" .. " applied Aura " .. spellName or "UNKNOWN" .. (destName and " to " or "") .. destName or """SAY");

    Want to whisper?
    destName then
    (sourceName or "UNKNOWN" .. " applied Aura " .. spellName or "UNKNOWN" .. " to you!""WHISPER"nildestName);

    -- Show display
    return true
    Now I've tested this code using Bloodlust on my shaman, the event triggers and it works fine however the chat function does not seem to be working correctly. It displays the sourcename and that's it, it does not add the applied aura or any of the rest, the whisper function works as in it whispers myself when I get the sated debuff (with my own BL) but again only with the playername and nothing else. I've had 2 others in the raid but none of them had a message or anything. I've played around slightly and got spellname, sourcename working however destName does not work, if I enter just a simple chat message with destname it just breaks for some reason.

    I've no clue what went wrong with the sendchatmessage, I hope someone could enlighten me.

    Thanks in advance.

  2. #2
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
    	-- Check for new aura event, can also be 
    	--  * SPELL_AURA_APPLIED auraType (new aura)
    	--  * SPELL_AURA_REMOVED auraType (aura completely removed)
    	--  * SPELL_AURA_APPLIED_DOSE auraType amount (new stack of aura)
    	--  * SPELL_AURA_REMOVED_DOSE auraType amount (removed stack of aura)
    	--  * SPELL_AURA_REFRESH auraType (existing aura refreshed)
    	--  * SPELL_AURA_BROKEN auraType
    	--  * SPELL_AURA_BROKEN_SPELL extraSpellID    extraSpellName    extraSchool    auraType 
    	if message == "SPELL_AURA_APPLIED" then
    		-- Additional arguments
    		local spellId, spellName, spellSchool, auraType = ...
    		-- Compare caster and spell
    		if sourceName == "PlayerName" and (spellName == "Sated" or spellId == 57724) then
    			-- Add chat ("RAID" can also be "RAID_WARNING")
    			local message = (sourceName or "UNKNOWN") .. " applied Aura " .. (spellName or "UNKNOWN");
    			if destName ~= nil then
    				message = message .. " to " .. destName;
    			SendChatMessage(message, "SAY");
    			-- Want to whisper?
    			if destName then
    				SendChatMessage((sourceName or "UNKNOWN") .. " applied Aura " .. (spellName or "UNKNOWN") .. " to you!", "WHISPER", nil, destName);
    			-- Show display
    			return true

  3. #3
    I've tried it and it displays 'Playername applied Aura Sated" but doesn't include "to destName", I can't figure out why destination name isn't working at all.

    Thanks anyhow for the help

    [edit]: after using print(sourceName, spellName, destName) it seems that the first two work fine but destName returns nil

    [edit 2]: okay so it seems that spell_cast_start has a return function of nil in the combat log, silly me as I was using this to test.

    [edit 3]: I got it all working now, thanks for the help!

    ---------- Post added 2013-01-19 at 05:47 PM ----------

    One more question, is it possible to give these people a raid marker just like a bossmod does if they have the debuff? (as in use raid markers 1 to 8 and keep overwriting from 1 after it hits 8)
    Last edited by chapelry; 2013-01-19 at 04:19 PM.

  4. #4
    Names are valid unitIDs if the player is in your party or raid. Just pass them to SetRaidTarget (and keep a counter that increments from 1 to 8, then resets to 1.
    UI & AddOns expert | Interface & Macros moderator - My work

  5. #5
    So is it possible to pass destName onto UnitID? http://wowprogramming.com/docs/api_types#unitID seems to not mention it.

  6. #6
    As I said, assuming the dest unit is in your group (it will be for Sated), its name is a valid unitID. Pass it to SetRaidTarget as arg1.
    UI & AddOns expert | Interface & Macros moderator - My work

  7. #7
    oh I see, thanks.

    ---------- Post added 2013-01-20 at 01:15 AM ----------

    Okay so I got everything working but the only problem is how do I implement the function to increment the counter? Global variables don't seem to work in the WeakAura's trigger custom box because right now I have no way of telling the trigger function that it's the 2nd run or so on.

    (Sorry for these questions, I'm completely inexperienced in any sort of coding)

    Thanks in advance.

    Edit: never mind! solved it.
    Last edited by chapelry; 2013-01-20 at 01:26 AM.

Posting Permissions

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