WeakAuras

Annoucing target cast for aura that has multiple triggers.

  • 4 posts
    #1 Jul 07, 2011 at 23:09 UTC - 0 likes

    Hello,

    I have a "general" aura setup to watch for target casts of interest. It uses multiple triggers and activates if the target meets the cast condition in any of the triggers. Each trigger is for a different boss so only one can be met at a given time.

    If I want this aura to /s or /raid announce the name of the spell that triggered the aura, how do I do that? Is there a variable I can use (similar to %n, %p, etc..) in the action message text or would this have to be done via a custom action?

    For example I have one aura that warns me, via a texture display, if Beth'liac casts Smoldering Devastation or if Rageface casts Face Rage. I want that aura to have an action that puts '#target is casting #trigger_spell!' into /raid.

    If this has to be done using a custom action, what would be the lua functions and/or code I would need to use?

    Cheers!

    Last edited Jul 07, 2011 by ThufirPriest
    #2 Jul 11, 2011 at 12:20 UTC - 0 likes

    This is for now only possible by using a custom (combat-log) function, the general function header is: (post WoW 4.2)

    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
    

    eg. here is an example for a specific spell-cast by a specific mob/player:

    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
      -- Check spell cast (can also be SPELL_CAST_START or SPELL_CAST_FAILED)
      if message == "SPELL_CAST_SUCCESS" then
        -- Additional arguments
        local spellId, spellName, spellSchool = ...
        
        -- Compare caster and spell
        if sourceName == "<CASTER NAME HERE>" and (spellName == "<SPELL NAME HERE>" or spellId == <SPELL ID HERE>) then
          -- Add chat ("RAID" can also be "RAID_WARNING")
          SendChatMessage(sourceName or "Someone" .. " is casting " .. spellName or "a spell" .. (destName and " on " or "") .. destName or "", "RAID");
    
          -- Show display
          return true
        end
      end
    end
    

    For a complete documentation, you can take a look at http://www.wowpedia.org/COMBAT_LOG_EVENT_UNFILTERED

    The advantage is, that you can query many spells with just one trigger. Either by just adding more if-statements or by adding the spellnames/spellids to the first if-statement. ;)

    Last edited Jul 11, 2011 by CommanderSirow
    #3 Jul 11, 2011 at 15:39 UTC - 0 likes

    @CommanderSirow: Go

    Very

    Quote from CommanderSirow: Go

    This is for now only possible by using a custom (combat-log) function, the general function header is: (post WoW 4.2)

    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
    
    eg. here is an example for a specific spell-cast by a specific mob/player:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
      -- Check spell cast (can also be SPELL_CAST_START or SPELL_CAST_FAILED)
      if message == "SPELL_CAST_SUCCESS" then
        -- Additional arguments
        local spellId, spellName, spellSchool = ...
        
        -- Compare caster and spell
        if sourceName == "<CASTER NAME HERE>" and (spellName == "<SPELL NAME HERE>" or spellId == <SPELL ID HERE>) then
          -- Add chat ("RAID" can also be "RAID_WARNING")
          SendChatMessage(sourceName or "Someone" .. " is casting " .. spellName or "a spell" .. (destName and " on " or "") .. destName or "", "RAID");
    
          -- Show display
          return true
        end
      end
    end
    

    For a complete documentation, you can take a look at http://www.wowpedia.org/COMBAT_LOG_EVENT_UNFILTERED

    The advantage is, that you can query many spells with just one trigger. Either by just adding more if-statements or by adding the spellnames/spellids to the first if-statement. ;)

    Very cool. This is exactly what I was looking for, thank you!

    #4 Sep 05, 2011 at 09:46 UTC - 0 likes

    Adding cross-link for (de-)buff tracking topic: http://www.wowace.com/addons/weakauras/forum/25237-announcing-to-raid-on-multiple-debuff-with-player-names/#p2

  • 4 posts

You must login to post a comment. Don't have an account? Register to get one!