Quantcast

4.0.1

Kith [07-26-16 - 00:47]
4.0.1
Added Nether Tempest (Mage) to Data: Unique Spells
Added special case to handle Soul Effigy showing auras
Refactored SPELL_SUMMON code
Filename
Ellipsis/AuraData.lua
Ellipsis/Control.lua
Ellipsis/Ellipsis.toc
diff --git a/Ellipsis/AuraData.lua b/Ellipsis/AuraData.lua
index 921ae7b..eae1299 100644
--- a/Ellipsis/AuraData.lua
+++ b/Ellipsis/AuraData.lua
@@ -86,6 +86,7 @@ local dataUniqueAuras = {
 	[61721]		= true, -- Polymorph (Rabbit)
 	[161354]	= true, -- Polymorph (Monkey)
 	[126819]	= true, -- Polymorph (Pig)
+	[114923]	= true, -- Nether Tempest
 	-- MONK
 	[115078]	= true,	-- Paralysis
 	-- PRIEST
diff --git a/Ellipsis/Control.lua b/Ellipsis/Control.lua
index c33c389..fecb396 100644
--- a/Ellipsis/Control.lua
+++ b/Ellipsis/Control.lua
@@ -33,8 +33,9 @@ local playerGUID, petGUID, targetGUID, focusGUID

 local blacklistByGUID = {}	-- 'minions' have no death event, this list filters out minion GUIDS to never show auras (to avoid persisting auras)

-local spellSummonID = false
-local wildImpsCount = 0
+local summonSpellID		= false
+local summonWildImps	= 0
+local summonSoulEffigy	= false

 local totemID	= -1	-- fake totem spellID used to catch blizzard triggering the event for non-totems
 local totemData	= {}	-- reference to active totems to cleanse 'old' auras
@@ -181,45 +182,52 @@ do ------------------------
 					unit:UpdateDisplay(true)
 				end
 			elseif (subEvent == 'SPELL_SUMMON') then
-				spellSummonID = arg1 -- hacky, used to grab the most recent spellID summoned for faking totem data
+				summonSpellID = arg1 -- hacky, used to grab the most recent spellID summoned for faking totem data

-				if (arg1 == 104317) then -- this summon is Wild Imps (special case)
-					wildImpsCount = wildImpsCount + 1
+				if (arg1 == 104317) then -- Wild Imps: track count of how many were summoned in each batch
+					summonWildImps = summonWildImps + 1
 				end

 				if (bit_band(destFlags, COMBATLOG_OBJECT_TYPE_PET) == 0) then -- the summon is not an actual pet, blacklist it
-					blacklistByGUID[destGUID] = timestamp
+					if (arg1 == 205178) then -- Soul Effigy: we want a 'unit' for Effigy but need a way to kill it on despawn
+						if (summonSoulEffigy and activeUnits[summonSoulEffigy]) then -- active Effigy, clear old unit
+							activeUnits[summonSoulEffigy]:Release()
+						end
+
+						summonSoulEffigy = destGUID -- record guid so we can track (and kill) it later
+					else
+						blacklistByGUID[destGUID] = timestamp
+					end
 				end
 			end

-	--[[
-		-- DEBUG FOR WATCHING ALL USEFUL CLEU SUBEVENTS (add varArgs back to function header to use)
-		if (string.find(subEvent, 'DAMAGE') or string.find(subEvent, 'HEAL') or string.find(subEvent, 'ENERGIZE')) then return end
+			--[[
+			-- DEBUG FOR WATCHING ALL USEFUL CLEU SUBEVENTS (add varArgs back to function header to use)
+			if (string.find(subEvent, 'DAMAGE') or string.find(subEvent, 'HEAL') or string.find(subEvent, 'ENERGIZE')) then return end

-		local s = ' id: ' .. arg1
-		local v
+			local s = ' id: ' .. arg1
+			local v

-		for x = 1, select('#', ...) do
-			v = select(x, ...)
+			for x = 1, select('#', ...) do
+				v = select(x, ...)

-			if (type(v) == 'string' or type(v) == 'number') then
-				s = s .. ', ' .. v
-			elseif (type(v) == 'boolean') then
-				s = s .. ', ' .. (v and 'TRUE' or 'FALSE')
-			else
-				s = s .. ', nil'
+				if (type(v) == 'string' or type(v) == 'number') then
+					s = s .. ', ' .. v
+				elseif (type(v) == 'boolean') then
+					s = s .. ', ' .. (v and 'TRUE' or 'FALSE')
+				else
+					s = s .. ', nil'
+				end
 			end
-		end

-		sourceName = sourceName or 'nil'
-		sourceFlags = sourceFlags or '-16'
-		destName = destName or 'nil'
-		destFlags = destFlags or '-16'
+			sourceName = sourceName or 'nil'
+			sourceFlags = sourceFlags or '-16'
+			destName = destName or 'nil'
+			destFlags = destFlags or '-16'


-		Ellipsis:Printf('%.3f [|cff00ff00%s|r] %s (%d) > %s (%d - %d - %d)%s', GetTime(), subEvent, sourceName, sourceFlags, destName, destFlags, destRaidFlags, raidIcon, s)
-	]]
-
+			Ellipsis:Printf('%.3f [|cff00ff00%s|r] %s (%d) > %s (%d - %d - %d)%s', GetTime(), subEvent, sourceName, sourceFlags, destName, destFlags, destRaidFlags, raidIcon, s)
+			]]
 		end
 	end
 end
@@ -254,10 +262,10 @@ function Ellipsis:PLAYER_TOTEM_UPDATE(slot)
 	if (spellID) then -- proper totem
 		totemTexture = GetSpellTexture(spellID)
 	else
-		if (not spellSummonID) then return end -- not even enough info to fake it
+		if (not summonSpellID) then return end -- not even enough info to fake it

-		totemTexture	= GetSpellTexture(spellSummonID)
-		spellID			= spellSummonID -- still needed for blacklist lookup
+		totemTexture	= GetSpellTexture(summonSpellID)
+		spellID			= summonSpellID -- still needed for blacklist lookup
 	end

 	if (blacklist[spellID] or duration <= durationMin or duration >= durationMax) then return end
@@ -277,8 +285,8 @@ function Ellipsis:PLAYER_TOTEM_UPDATE(slot)

 		-- create the aura for this totem (new or otherwise)
 		if (spellID == 104317) then -- this summon is Wild Imps (special case)
-			totemData[slot] = unit:AddAura(Aura:New(currentTime, unit, totemID, totemName, totemTexture, duration, startTime + duration, wildImpsCount))
-			wildImpsCount = 0
+			totemData[slot] = unit:AddAura(Aura:New(currentTime, unit, totemID, totemName, totemTexture, duration, startTime + duration, summonWildImps))
+			summonWildImps = 0
 		else
 			totemData[slot] = unit:AddAura(Aura:New(currentTime, unit, totemID, totemName, totemTexture, duration, startTime + duration, 0))
 		end
@@ -295,6 +303,14 @@ function Ellipsis:PLAYER_TOTEM_UPDATE(slot)
 			totemData[slot]:Release()
 			totemData[slot] = nil
 		end
+
+		if (summonSoulEffigy) then -- special case for Soul Effigy, clear unit if present
+			if (activeUnits[summonSoulEffigy]) then
+				activeUnits[summonSoulEffigy]:Release()
+			end
+
+			summonSoulEffigy = false
+		end
 	end
 end

diff --git a/Ellipsis/Ellipsis.toc b/Ellipsis/Ellipsis.toc
index c375ae7..77af5bb 100644
--- a/Ellipsis/Ellipsis.toc
+++ b/Ellipsis/Ellipsis.toc
@@ -2,7 +2,7 @@
 ## Title: Ellipsis (|cff67b1e9K|cff4779ceith|cff67b1e9M|cff4779ceod|r)
 ## Notes: A full-featured, multi-target Aura (DoTs and HoTs) tracker.
 ## Author: Kith
-## Version: 4.0.0
+## Version: 4.0.1
 ## SavedVariables: EllipsisDB, EllipsisVersion
 ## OptionalDeps: Ace3, LibSharedMedia-3.0, LibSink-2.0
 ## X-Embeds: Ace3, LibSharedMedia-3.0, LibSink-2.0