1. #1

    WA to display caster's name

    So I've been trying to get a weakaura to display the caster's name that gave me a specific buff. For example, when "John" gives me a Hand of Sacrifice, I want his name to show up under the icon for Hand of Sacrifice.

    I know I can manually hardcode every potential healers name for the external, but I'm sure theres a way to do it with a LUA script.

    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
        if message == "SPELL_CAST_SUCCESS" then
            local spellId, spellName, spellSchool = ...
            if spellName == "Hand of Sacrifice" then   
                name = sourceName
                return true
            end
        end
    end
    All I'm getting is the name of the ability, not the name of the person giving me the buff.

    Any idea?

  2. #2
    Quote Originally Posted by Angrybathtub View Post

    All I'm getting is the name of the ability, not the name of the person giving me the buff.

    Any idea?
    http://www.wowwiki.com/API_UnitBuff

    I would start up there. Instead of looking at who cast the spell, look at the buff attached to your character and figure out it's source.

    getting the source of the buff gives you the unit id, from there you need to get the player name.

  3. #3
    Deleted
    Quote Originally Posted by Angrybathtub View Post
    So I've been trying to get a weakaura to display the caster's name that gave me a specific buff. For example, when "John" gives me a Hand of Sacrifice, I want his name to show up under the icon for Hand of Sacrifice.

    I know I can manually hardcode every potential healers name for the external, but I'm sure theres a way to do it with a LUA script.

    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
        if message == "SPELL_CAST_SUCCESS" then
            local spellId, spellName, spellSchool = ...
            if spellName == "Hand of Sacrifice" then   
                name = sourceName
                return true
            end
        end
    end
    All I'm getting is the name of the ability, not the name of the person giving me the buff.

    Any idea?

    Did you add this to the custom name function and set %n as the display text?

    Code:
    function()
        return name
    end

Posting Permissions

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