1. #1
    Banned Illiterate's Avatar
    10+ Year Old Account
    Join Date
    Feb 2012
    Location
    US-Emerald Dream
    Posts
    3,047

    [LUA] Grounding totem

    Trying to fix an old addon to make it display the name of the spell that gets grounded after dropping the totem. This is what I have so far, but it doesn't seem to work. It worked in mop so I don't know what changed since then.

    Code:
    if (event=="SPELL_MISSED") then
    	if (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
    		local spellName,_,missType = select(13,...)
    		if (missType=="REFLECT") then
    			SpellNotifications_Print("Reflected "..spellName..".","white","small")
    			SendChatMessage("Reflected "..spellName..".", "SAY");
    			elseif (destName=="Grounding Totem") and (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
    			SpellNotifications_Print("Grounded "..spellName..".","white","small")
    			end
    	end
    end
    if (event=="SPELL_DAMAGE") then
    	if bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
    		local spellName = select(13,...)
    		if (destName=="Grounding Totem") then
    			SpellNotifications_Print("Grounded "..spellName..".","white","small")
    			end
    	end
    end
    What do?
    Last edited by Illiterate; 2015-02-01 at 04:58 PM.

  2. #2
    Quote Originally Posted by Illiterate View Post
    Trying to fix an old addon to make it display the name of the spell that gets grounded after dropping the totem. This is what I have so far, but it doesn't seem to work. It worked in mop so I don't know what changed since then.

    Code:
    if (event=="SPELL_MISSED") then
    	if (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
    		local spellName,_,missType = select(13,...)
    		if (missType=="REFLECT") then
    			SpellNotifications_Print("Reflected "..spellName..".","white","small")
    			SendChatMessage("Reflected "..spellName..".", "SAY");
    			elseif (destName=="Grounding Totem") and (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
    			SpellNotifications_Print("Grounded "..spellName..".","white","small")
    			end
    	end
    end
    if (event=="SPELL_DAMAGE") then
    	if bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
    		local spellName = select(13,...)
    		if (destName=="Grounding Totem") then
    			SpellNotifications_Print("Grounded "..spellName..".","white","small")
    			end
    	end
    end
    What do?
    I know they changed the format of guid's in WoD - wouldn't surprise me if they changed flags at the same time. None of my code uses the flags, so someone else might be able to confirm that, but otherwise I can't see anything that would have changed.

    Sidenote, I never knew the flags told you it was one of your minions - that's really cool. I normally cache the guid of anything like that and just check casts against the guid for some of my weirder weakauras.
    Last edited by rijn dael; 2015-02-01 at 08:45 PM.

Posting Permissions

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